Skip to content

Commit da8f91c

Browse files
committed
chore(views): standardized naming
1 parent 721c06a commit da8f91c

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

rootfs/api/urls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,11 @@
247247
# nodes
248248
re_path(
249249
r'^nodes/(?P<node>[a-zA-Z0-9-]+)/proxy/metrics(?:/(?P<metrics>[^/]+))?/?$',
250-
views.ProxyMetricsView.as_view()),
250+
views.MetricsProxyView.as_view()),
251251
# prometheus
252252
re_path(
253-
r'^prometheus/(?P<username>[\w.@+-]+)/(?P<path>.+)/?$', views.PrometheusProxy.as_view()),
253+
r'^prometheus/(?P<username>[\w.@+-]+)/(?P<path>.+)/?$',
254+
views.PrometheusProxyView.as_view()),
254255
# tokens
255256
re_path(r'^tokens/?$', views.TokenViewSet.as_view({'get': 'list'})),
256257
re_path(

rootfs/api/views.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ def metric(self, request, **kwargs):
12631263
)
12641264

12651265

1266-
class ProxyMetricsView(View):
1266+
class MetricsProxyView(View):
12671267
cache = {}
12681268
match_meta = staticmethod(
12691269
re.compile(r'^(?:# (?:HELP|TYPE) )([a-zA-Z_][a-zA-Z0-9_:.-]*)').match)
@@ -1333,7 +1333,7 @@ async def stream_response():
13331333

13341334

13351335
@method_decorator(csrf_exempt, name='dispatch')
1336-
class PrometheusProxy(View):
1336+
class PrometheusProxyView(View):
13371337
timeout = aiohttp.ClientTimeout(total=30, connect=10, sock_read=15)
13381338
authentication = authentication.DryccAuthentication()
13391339

@@ -1356,3 +1356,4 @@ async def proxy(self, request, username, path):
13561356
return JsonResponse(data, status=status)
13571357

13581358
get = post = proxy
1359+

0 commit comments

Comments
 (0)