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({ |
| 8 | 'nodes': reverse('node-list', request=request, format=format), |
| 9 | 'sites': reverse('site-list', request=request, format=format), |
| 10 | 'deploymentNetworks': reverse('deploymentnetwork-list', request=request, format=format), |
| 11 | 'slices': reverse('slice-list', request=request, format=format) |
| 12 | }) |