mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 20:51:21 -03:30
Add discoverability on /api/v1 to show available top level resources.
This commit is contained in:
parent
2a013a5cfe
commit
f18f3a339c
@ -39,6 +39,8 @@ from base_views import *
|
||||
class ApiRootView(APIView):
|
||||
|
||||
def get(self, request, format=None):
|
||||
''' list supported API versions '''
|
||||
|
||||
current = reverse(lib.urls.views_ApiV1RootView, args=[])
|
||||
data = dict(
|
||||
description = 'Ansible Commander REST API',
|
||||
@ -52,7 +54,19 @@ class ApiRootView(APIView):
|
||||
class ApiV1RootView(APIView):
|
||||
|
||||
def get(self, request, format=None):
|
||||
data = {}
|
||||
''' list top level resources '''
|
||||
|
||||
data = dict(
|
||||
organizations = reverse(lib.urls.views_OrganizationsList, args=[]),
|
||||
users = reverse(lib.urls.views_UsersList, args=[]),
|
||||
projects = reverse(lib.urls.views_ProjectsList, args=[]),
|
||||
teams = reverse(lib.urls.views_TeamsList, args=[]),
|
||||
inventory = reverse(lib.urls.views_InventoryList, args=[]),
|
||||
groups = reverse(lib.urls.views_GroupsList, args=[]),
|
||||
hosts = reverse(lib.urls.views_HostsList, args=[]),
|
||||
job_templates = reverse(lib.urls.views_JobTemplatesList, args=[]),
|
||||
jobs = reverse(lib.urls.views_JobsList, args=[]),
|
||||
)
|
||||
return Response(data)
|
||||
|
||||
class AuthTokenView(ObtainAuthToken):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user