mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
Addition of a /ping/ endpoint to give basic HA info.
This commit is contained in:
parent
5d4444235a
commit
f5b7d500a5
@ -194,6 +194,7 @@ activity_stream_urls = patterns('awx.api.views',
|
||||
|
||||
v1_urls = patterns('awx.api.views',
|
||||
url(r'^$', 'api_v1_root_view'),
|
||||
url(r'^ping/$', 'api_v1_ping_view'),
|
||||
url(r'^config/$', 'api_v1_config_view'),
|
||||
url(r'^authtoken/$', 'auth_token_view'),
|
||||
url(r'^me/$', 'user_me_list'),
|
||||
|
||||
@ -114,6 +114,27 @@ class ApiV1RootView(APIView):
|
||||
data['activity_stream'] = reverse('api:activity_stream_list')
|
||||
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):
|
||||
|
||||
permission_classes = (IsAuthenticated,)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user