diff --git a/awx/api/urls.py b/awx/api/urls.py index 131072bc14..8baa0e17e7 100644 --- a/awx/api/urls.py +++ b/awx/api/urls.py @@ -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'), diff --git a/awx/api/views.py b/awx/api/views.py index 75bb53eb25..91e55ce88d 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -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,)