blob: d469881834de7e79ae88b755504d90d6d6cdd164 [file] [log] [blame]
Tony Mack7130ac32013-03-22 21:58:00 -04001from django.conf.urls import patterns, include, url
2
3# Uncomment the next two lines to enable the admin:
4from django.contrib import admin
Tony Mack29c287f2013-04-11 21:07:16 -04005from plstackapi.core.views.roles import RoleListCreate, RoleRetrieveUpdateDestroy
6from plstackapi.core.views.sites import SiteListCreate, SiteRetrieveUpdateDestroy
7from plstackapi.core.views.site_privileges import SitePrivilegeListCreate, SitePrivilegeRetrieveUpdateDestroy
8from plstackapi.core.views.users import UserListCreate, UserRetrieveUpdateDestroy
9from plstackapi.core.views.slices import SliceListCreate, SliceRetrieveUpdateDestroy
10from plstackapi.core.views.slice_memberships import SliceMembershipListCreate, SliceMembershipRetrieveUpdateDestroy
Tony Mack29c287f2013-04-11 21:07:16 -040011from plstackapi.core.views.slivers import SliverListCreate, SliverRetrieveUpdateDestroy
12from plstackapi.core.views.keys import KeyListCreate, KeyRetrieveUpdateDestroy
13from plstackapi.core.views.deployment_networks import DeploymentNetworkListCreate, DeploymentNetworkRetrieveUpdateDestroy
14from plstackapi.core.views.images import ImageListCreate, ImageRetrieveUpdateDestroy
Tony Mack29c287f2013-04-11 21:07:16 -040015from plstackapi.core.views.nodes import NodeListCreate, NodeRetrieveUpdateDestroy
Tony Mackf1c12242013-04-09 16:08:43 -040016from plstackapi.core.models import Site
Tony Mack29c287f2013-04-11 21:07:16 -040017from plstackapi.core.api_root import api_root
Tony Mack7130ac32013-03-22 21:58:00 -040018from rest_framework import generics
19
20admin.autodiscover()
21
22urlpatterns = patterns('',
23 # Examples:
24 # url(r'^$', 'planetstack.views.home', name='home'),
25 # url(r'^planetstack/', include('planetstack.foo.urls')),
26
27 # Uncomment the admin/doc line below to enable admin documentation:
28 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
29
30 # Uncomment the next line to enable the admin:
31 url(r'^admin/', include(admin.site.urls)),
32
Tony Mack7d97f062013-04-09 20:25:08 -040033 url(r'^plstackapi/$', api_root),
Tony Mack29c287f2013-04-11 21:07:16 -040034
35 url(r'^plstackapi/roles/$', RoleListCreate.as_view(), name='role-list'),
36 url(r'^plstackapi/roles/(?P<pk>[a-zA-Z0-9]+)/$', RoleRetrieveUpdateDestroy.as_view(), name='role-detail'),
Tony Mack7130ac32013-03-22 21:58:00 -040037
Tony Mack29c287f2013-04-11 21:07:16 -040038 url(r'^plstackapi/users/$', UserListCreate.as_view(), name='user-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040039 url(r'^plstackapi/users/(?P<pk>[a-zA-Z0-9_\-]+)/$', UserRetrieveUpdateDestroy.as_view(), name='user-detail'),
Tony Mack5cc16ba2013-04-09 10:30:45 -040040
Tony Mack29c287f2013-04-11 21:07:16 -040041 url(r'^plstackapi/keys/$', KeyListCreate.as_view(), name='key-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040042 url(r'^plstackapi/keys/(?P<pk>[a-zA-Z0-9_\-]+)/$', KeyRetrieveUpdateDestroy.as_view(), name='key-detail'),
Tony Macke4cee7a2013-04-09 12:45:32 -040043
Tony Mack29c287f2013-04-11 21:07:16 -040044 url(r'^plstackapi/sites/$', SiteListCreate.as_view(), name='site-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040045 url(r'^plstackapi/sites/(?P<pk>[a-zA-Z0-9_\-]+)/$', SiteRetrieveUpdateDestroy.as_view(), name='site-detail'),
Siobhan Tully4bc09f22013-04-10 21:15:21 -040046
Tony Mack29c287f2013-04-11 21:07:16 -040047 url(r'^plstackapi/site_privileges/$', SitePrivilegeListCreate.as_view(), name='siteprivilege-list'),
48 url(r'^plstackapi/site_privileges/(?P<pk>[a-zA-Z0-9_]+)/$', SitePrivilegeRetrieveUpdateDestroy.as_view(), name='siteprivilege-detail'),
Tony Mack7130ac32013-03-22 21:58:00 -040049
Tony Mack29c287f2013-04-11 21:07:16 -040050 url(r'^plstackapi/slices/$', SliceListCreate.as_view(), name='slice-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040051 url(r'^plstackapi/slices/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceRetrieveUpdateDestroy.as_view(), name='slice-detail'),
Tony Macke4cee7a2013-04-09 12:45:32 -040052
Tony Mack29c287f2013-04-11 21:07:16 -040053 url(r'^plstackapi/slice_memberships/$', SliceMembershipListCreate.as_view(), name='slice_membership-list'),
54 url(r'^plstackapi/slice_memberships/(?P<pk>[0-9]+)/$', SliceMembershipRetrieveUpdateDestroy.as_view(), name='slice_membership-detail'),
55
Tony Mack29c287f2013-04-11 21:07:16 -040056 url(r'^plstackapi/slivers/$', SliverListCreate.as_view(), name='sliver-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040057 url(r'^plstackapi/slivers/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliverRetrieveUpdateDestroy.as_view(), name='sliver-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040058
59 url(r'^plstackapi/nodes/$', NodeListCreate.as_view(), name='node-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040060 url(r'^plstackapi/nodes/(?P<pk>[a-zA-Z0-9_\-]+)/$', NodeRetrieveUpdateDestroy.as_view(), name='node-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040061
62 url(r'^plstackapi/deploymentnetworks/$', DeploymentNetworkListCreate.as_view(), name='deploymentnetwork-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040063 url(r'^plstackapi/deploymentnetworks/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentNetworkRetrieveUpdateDestroy.as_view(), name='deploymentnetwork-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040064
65 url(r'^plstackapi/images/$', ImageListCreate.as_view(), name='image-list'),
Tony Mack227d9ab2013-05-02 15:44:32 -040066 url(r'^plstackapi/images/(?P<pk>[a-zA-Z0-9_\-]+)/$', ImageRetrieveUpdateDestroy.as_view(), name='image-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040067
Tony Mack7130ac32013-03-22 21:58:00 -040068 #Adding in rest_framework urls
Tony Mack9a3511e2013-04-09 19:06:01 -040069 url(r'^plstackapi/', include('rest_framework.urls', namespace='rest_framework')),
Tony Mack7130ac32013-03-22 21:58:00 -040070
71)