mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Addition of a /ping/ endpoint to give basic HA info.
This commit is contained in:
@@ -194,6 +194,7 @@ activity_stream_urls = patterns('awx.api.views',
|
|||||||
|
|
||||||
v1_urls = patterns('awx.api.views',
|
v1_urls = patterns('awx.api.views',
|
||||||
url(r'^$', 'api_v1_root_view'),
|
url(r'^$', 'api_v1_root_view'),
|
||||||
|
url(r'^ping/$', 'api_v1_ping_view'),
|
||||||
url(r'^config/$', 'api_v1_config_view'),
|
url(r'^config/$', 'api_v1_config_view'),
|
||||||
url(r'^authtoken/$', 'auth_token_view'),
|
url(r'^authtoken/$', 'auth_token_view'),
|
||||||
url(r'^me/$', 'user_me_list'),
|
url(r'^me/$', 'user_me_list'),
|
||||||
|
|||||||
@@ -114,6 +114,27 @@ class ApiV1RootView(APIView):
|
|||||||
data['activity_stream'] = reverse('api:activity_stream_list')
|
data['activity_stream'] = reverse('api:activity_stream_list')
|
||||||
return Response(data)
|
return Response(data)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiV1PingView(APIView):
|
||||||
|
"""A simple view that reports very basic information about this Tower
|
||||||
|
instance, which is acceptable to be public information.
|
||||||
|
"""
|
||||||
|
permission_classes = (AllowAny,)
|
||||||
|
authentication_classes = ()
|
||||||
|
view_name = 'Ping'
|
||||||
|
|
||||||
|
def get(self, request, format=None):
|
||||||
|
"""Return some basic information about this Tower instance.
|
||||||
|
|
||||||
|
Everything returned here should be considered public / insecure, as
|
||||||
|
this requires no auth and is intended for use by the installer process.
|
||||||
|
"""
|
||||||
|
return Response({
|
||||||
|
'role': 'standalone', # FIXME: Make this dynamic.
|
||||||
|
'version': get_awx_version(),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
class ApiV1ConfigView(APIView):
|
class ApiV1ConfigView(APIView):
|
||||||
|
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
|||||||
Reference in New Issue
Block a user