Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 1 | from django.conf.urls import patterns, include, url |
| 2 | |
| 3 | # Uncomment the next two lines to enable the admin: |
| 4 | from django.contrib import admin |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 5 | from plstackapi.core.views.roles import RoleListCreate, RoleRetrieveUpdateDestroy |
| 6 | from plstackapi.core.views.sites import SiteListCreate, SiteRetrieveUpdateDestroy |
| 7 | from plstackapi.core.views.site_privileges import SitePrivilegeListCreate, SitePrivilegeRetrieveUpdateDestroy |
| 8 | from plstackapi.core.views.users import UserListCreate, UserRetrieveUpdateDestroy |
| 9 | from plstackapi.core.views.slices import SliceListCreate, SliceRetrieveUpdateDestroy |
| 10 | from plstackapi.core.views.slice_memberships import SliceMembershipListCreate, SliceMembershipRetrieveUpdateDestroy |
| 11 | from plstackapi.core.views.subnets import SubnetListCreate, SubnetRetrieveUpdateDestroy |
| 12 | from plstackapi.core.views.slivers import SliverListCreate, SliverRetrieveUpdateDestroy |
| 13 | from plstackapi.core.views.keys import KeyListCreate, KeyRetrieveUpdateDestroy |
| 14 | from plstackapi.core.views.deployment_networks import DeploymentNetworkListCreate, DeploymentNetworkRetrieveUpdateDestroy |
| 15 | from plstackapi.core.views.images import ImageListCreate, ImageRetrieveUpdateDestroy |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 16 | from plstackapi.core.views.nodes import NodeListCreate, NodeRetrieveUpdateDestroy |
Tony Mack | f1c1224 | 2013-04-09 16:08:43 -0400 | [diff] [blame] | 17 | from plstackapi.core.models import Site |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 18 | from plstackapi.core.api_root import api_root |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 19 | from rest_framework import generics |
| 20 | |
| 21 | admin.autodiscover() |
| 22 | |
| 23 | urlpatterns = patterns('', |
| 24 | # Examples: |
| 25 | # url(r'^$', 'planetstack.views.home', name='home'), |
| 26 | # url(r'^planetstack/', include('planetstack.foo.urls')), |
| 27 | |
| 28 | # Uncomment the admin/doc line below to enable admin documentation: |
| 29 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), |
| 30 | |
| 31 | # Uncomment the next line to enable the admin: |
| 32 | url(r'^admin/', include(admin.site.urls)), |
| 33 | |
Tony Mack | 7d97f06 | 2013-04-09 20:25:08 -0400 | [diff] [blame] | 34 | url(r'^plstackapi/$', api_root), |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 35 | |
| 36 | url(r'^plstackapi/roles/$', RoleListCreate.as_view(), name='role-list'), |
| 37 | url(r'^plstackapi/roles/(?P<pk>[a-zA-Z0-9]+)/$', RoleRetrieveUpdateDestroy.as_view(), name='role-detail'), |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 38 | |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 39 | url(r'^plstackapi/users/$', UserListCreate.as_view(), name='user-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 40 | url(r'^plstackapi/users/(?P<pk>[a-zA-Z0-9_\-]+)/$', UserRetrieveUpdateDestroy.as_view(), name='user-detail'), |
Tony Mack | 5cc16ba | 2013-04-09 10:30:45 -0400 | [diff] [blame] | 41 | |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 42 | url(r'^plstackapi/keys/$', KeyListCreate.as_view(), name='key-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 43 | url(r'^plstackapi/keys/(?P<pk>[a-zA-Z0-9_\-]+)/$', KeyRetrieveUpdateDestroy.as_view(), name='key-detail'), |
Tony Mack | e4cee7a | 2013-04-09 12:45:32 -0400 | [diff] [blame] | 44 | |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 45 | url(r'^plstackapi/sites/$', SiteListCreate.as_view(), name='site-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 46 | url(r'^plstackapi/sites/(?P<pk>[a-zA-Z0-9_\-]+)/$', SiteRetrieveUpdateDestroy.as_view(), name='site-detail'), |
Siobhan Tully | 4bc09f2 | 2013-04-10 21:15:21 -0400 | [diff] [blame] | 47 | |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 48 | url(r'^plstackapi/site_privileges/$', SitePrivilegeListCreate.as_view(), name='siteprivilege-list'), |
| 49 | url(r'^plstackapi/site_privileges/(?P<pk>[a-zA-Z0-9_]+)/$', SitePrivilegeRetrieveUpdateDestroy.as_view(), name='siteprivilege-detail'), |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 50 | |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 51 | url(r'^plstackapi/slices/$', SliceListCreate.as_view(), name='slice-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 52 | url(r'^plstackapi/slices/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceRetrieveUpdateDestroy.as_view(), name='slice-detail'), |
Tony Mack | e4cee7a | 2013-04-09 12:45:32 -0400 | [diff] [blame] | 53 | |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 54 | url(r'^plstackapi/slice_memberships/$', SliceMembershipListCreate.as_view(), name='slice_membership-list'), |
| 55 | url(r'^plstackapi/slice_memberships/(?P<pk>[0-9]+)/$', SliceMembershipRetrieveUpdateDestroy.as_view(), name='slice_membership-detail'), |
| 56 | |
| 57 | url(r'^plstackapi/subnets/$', SubnetListCreate.as_view(), name='subnet-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 58 | url(r'^plstackapi/subnets/(?P<pk>[a-zA-Z0-9_\-]+)/$', SubnetRetrieveUpdateDestroy.as_view(), name='subnet-detail'), |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 59 | |
| 60 | url(r'^plstackapi/slivers/$', SliverListCreate.as_view(), name='sliver-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 61 | url(r'^plstackapi/slivers/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliverRetrieveUpdateDestroy.as_view(), name='sliver-detail'), |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 62 | |
| 63 | url(r'^plstackapi/nodes/$', NodeListCreate.as_view(), name='node-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 64 | url(r'^plstackapi/nodes/(?P<pk>[a-zA-Z0-9_\-]+)/$', NodeRetrieveUpdateDestroy.as_view(), name='node-detail'), |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 65 | |
| 66 | url(r'^plstackapi/deploymentnetworks/$', DeploymentNetworkListCreate.as_view(), name='deploymentnetwork-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 67 | url(r'^plstackapi/deploymentnetworks/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentNetworkRetrieveUpdateDestroy.as_view(), name='deploymentnetwork-detail'), |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 68 | |
| 69 | url(r'^plstackapi/images/$', ImageListCreate.as_view(), name='image-list'), |
Tony Mack | 227d9ab | 2013-05-02 15:44:32 -0400 | [diff] [blame^] | 70 | url(r'^plstackapi/images/(?P<pk>[a-zA-Z0-9_\-]+)/$', ImageRetrieveUpdateDestroy.as_view(), name='image-detail'), |
Tony Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 71 | |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 72 | #Adding in rest_framework urls |
Tony Mack | 9a3511e | 2013-04-09 19:06:01 -0400 | [diff] [blame] | 73 | url(r'^plstackapi/', include('rest_framework.urls', namespace='rest_framework')), |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 74 | |
| 75 | ) |