Tony Mack | 0b2b804 | 2013-04-07 19:55:27 -0400 | [diff] [blame] | 1 | from rest_framework.decorators import api_view |
| 2 | from rest_framework.response import Response |
| 3 | from rest_framework.reverse import reverse |
| 4 | |
| 5 | @api_view(['GET']) |
| 6 | def api_root(request, format=None): |
| 7 | return Response({ |
Siobhan Tully | 5d7dc8d | 2013-07-02 13:17:33 -0400 | [diff] [blame] | 8 | 'deployments': reverse('deployment-list', request=request, format=format), |
Tony Mack | 5331008 | 2013-04-09 09:26:12 -0400 | [diff] [blame] | 9 | 'images': reverse('image-list', request=request, format=format), |
Siobhan Tully | 6136709 | 2013-07-07 17:20:18 -0400 | [diff] [blame] | 10 | 'nodes': reverse('node-list', request=request, format=format), |
| 11 | 'projects': reverse('project-list', request=request, format=format), |
| 12 | 'reservations': reverse('reservation-list', request=request, format=format), |
| 13 | 'roles': reverse('role-list', request=request, format=format), |
| 14 | 'serviceclasses': reverse('serviceclass-list', request=request, format=format), |
| 15 | 'serviceresources': reverse('serviceresource-list', request=request, format=format), |
| 16 | 'sites': reverse('site-list', request=request, format=format), |
| 17 | 'slices': reverse('slice-list', request=request, format=format), |
| 18 | 'slivers': reverse('sliver-list', request=request, format=format), |
| 19 | 'tags': reverse('tag-list', request=request, format=format), |
| 20 | 'users': reverse('user-list', request=request, format=format), |
Tony Mack | 0b2b804 | 2013-04-07 19:55:27 -0400 | [diff] [blame] | 21 | }) |