blob: ca997d903249d2a1ae976448942ccea97b3d5774 [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
Sapan Bhatiadea39432014-06-13 03:10:36 -04005
6# This is the generated API
7from genapi import *
8
smbaker7225f722013-10-29 18:33:51 -07009from core.views.legacyapi import LegacyXMLRPC
Scott Bakera60d2742014-05-30 15:10:17 -070010#from core.views.analytics import AnalyticsAjaxView
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040011from core.models import *
Tony Mack7130ac32013-03-22 21:58:00 -040012from rest_framework import generics
Scott Bakera60d2742014-05-30 15:10:17 -070013from core.dashboard.sites import SitePlus
Scott Baker40695e12014-03-13 22:50:45 -070014from django.http import HttpResponseRedirect
Tony Mack7130ac32013-03-22 21:58:00 -040015
Siobhan Tullycf04fb62014-01-11 11:25:57 -050016admin.site = SitePlus()
Tony Mack7130ac32013-03-22 21:58:00 -040017admin.autodiscover()
18
Scott Baker40695e12014-03-13 22:50:45 -070019def redirect_to_apache(request):
20 """ bounce a request back to the apache server that is running on the machine """
21 apache_url = "http://%s%s" % (request.META['HOSTNAME'], request.path)
22 return HttpResponseRedirect(apache_url)
23
Tony Mack7130ac32013-03-22 21:58:00 -040024urlpatterns = patterns('',
25 # Examples:
26 # url(r'^$', 'planetstack.views.home', name='home'),
27 # url(r'^planetstack/', include('planetstack.foo.urls')),
28
29 # Uncomment the admin/doc line below to enable admin documentation:
Siobhan Tullycf04fb62014-01-11 11:25:57 -050030 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Tony Mack7130ac32013-03-22 21:58:00 -040031
32 # Uncomment the next line to enable the admin:
33 url(r'^admin/', include(admin.site.urls)),
Siobhan Tullycf04fb62014-01-11 11:25:57 -050034 url(r'^', include(admin.site.urls)),
35 #url(r'^profile/home', 'core.views.home'),
Tony Mack7130ac32013-03-22 21:58:00 -040036
Tony Mack7d97f062013-04-09 20:25:08 -040037 url(r'^plstackapi/$', api_root),
Scott Bakera60d2742014-05-30 15:10:17 -070038
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040039 url(r'^plstackapi/deployments/$', DeploymentList.as_view(), name='deployment-list'),
40 url(r'^plstackapi/deployments/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentDetail.as_view(), name='deployment-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040041
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040042 url(r'^plstackapi/images/$', ImageList.as_view(), name='image-list'),
43 url(r'^plstackapi/images/(?P<pk>[a-zA-Z0-9_\-]+)/$', ImageDetail.as_view(), name='image-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040044
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040045 url(r'^plstackapi/nodes/$', NodeList.as_view(), name='node-list'),
46 url(r'^plstackapi/nodes/(?P<pk>[a-zA-Z0-9_\-]+)/$', NodeDetail.as_view(), name='node-detail'),
47
48 url(r'^plstackapi/projects/$', ProjectList.as_view(), name='project-list'),
49 url(r'^plstackapi/projects/(?P<pk>[a-zA-Z0-9_\-]+)/$', ProjectDetail.as_view(), name='project-detail'),
50
51 url(r'^plstackapi/reservations/$', ReservationList.as_view(), name='reservation-list'),
52 url(r'^plstackapi/reservations/(?P<pk>[a-zA-Z0-9_\-]+)/$', ReservationDetail.as_view(), name='reservation-detail'),
53
54 url(r'^plstackapi/roles/$', RoleList.as_view(), name='role-list'),
55 url(r'^plstackapi/roles/(?P<pk>[a-zA-Z0-9]+)/$', RoleDetail.as_view(), name='role-detail'),
56
57 url(r'^plstackapi/serviceclasses/$', ServiceClassList.as_view(), name='serviceclass-list'),
58 url(r'^plstackapi/serviceclasses/(?P<pk>[a-zA-Z0-9]+)/$', ServiceClassDetail.as_view(), name='serviceclass-detail'),
59
60 url(r'^plstackapi/serviceresources/$', ServiceResourceList.as_view(), name='serviceresource-list'),
61 url(r'^plstackapi/serviceresources/(?P<pk>[a-zA-Z0-9]+)/$', ServiceResourceDetail.as_view(), name='serviceresource-detail'),
62
63 url(r'^plstackapi/site_privileges/$', SitePrivilegeList.as_view(), name='siteprivilege-list'),
64 url(r'^plstackapi/site_privileges/(?P<pk>[a-zA-Z0-9_]+)/$', SitePrivilegeDetail.as_view(), name='siteprivilege-detail'),
65
66 url(r'^plstackapi/sites/$', SiteList.as_view(), name='site-list'),
67 url(r'^plstackapi/sites/(?P<pk>[a-zA-Z0-9_\-]+)/$', SiteDetail.as_view(), name='site-detail'),
68
Sapan Bhatiadea39432014-06-13 03:10:36 -040069 url(r'^plstackapi/networks/$', NetworkList.as_view(), name='network-list'),
70 url(r'^plstackapi/networks/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkDetail.as_view(), name='network-detail'),
71
72 url(r'^plstackapi/services/$', SliceList.as_view(), name='service-list'),
73 url(r'^plstackapi/services/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceDetail.as_view(), name='service-detail'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040074
Sapan Bhatiadea39432014-06-13 03:10:36 -040075 url(r'^plstackapi/slices/$', SliceList.as_view(), name='slice-list'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040076 url(r'^plstackapi/slices/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceDetail.as_view(), name='slice-detail'),
77
78 url(r'^plstackapi/slice_memberships/$', SlicePrivilegeList.as_view(), name='sliceprivilege-list'),
79 url(r'^plstackapi/slice_memberships/(?P<pk>[0-9]+)/$', SlicePrivilegeDetail.as_view(), name='sliceprivilege-detail'),
80
81 url(r'^plstackapi/slivers/$', SliverList.as_view(), name='sliver-list'),
82 url(r'^plstackapi/slivers/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliverDetail.as_view(), name='sliver-detail'),
83
84 url(r'^plstackapi/tags/$', TagList.as_view(), name='tag-list'),
85 url(r'^plstackapi/tags/(?P<pk>[a-zA-Z0-9_\-]+)/$', TagDetail.as_view(), name='tag-detail'),
86
87 url(r'^plstackapi/users/$', UserList.as_view(), name='user-list'),
88 url(r'^plstackapi/users/(?P<pk>[a-zA-Z0-9_\-]+)/$', UserDetail.as_view(), name='user-detail'),
89
smbakere36a7de2013-10-29 17:25:25 -070090 url(r'^legacyapi/$', 'core.views.legacyapi.LegacyXMLRPC', name='xmlrpc'),
91
Scott Bakera60d2742014-05-30 15:10:17 -070092# url(r'^analytics/(?P<name>\w+)/$', AnalyticsAjaxView.as_view(), name="analytics"),
93
Scott Baker40695e12014-03-13 22:50:45 -070094 url(r'^files/', redirect_to_apache),
smbakere36a7de2013-10-29 17:25:25 -070095
Tony Mack7130ac32013-03-22 21:58:00 -040096 #Adding in rest_framework urls
Tony Mack9a3511e2013-04-09 19:06:01 -040097 url(r'^plstackapi/', include('rest_framework.urls', namespace='rest_framework')),
Tony Mack7130ac32013-03-22 21:58:00 -040098
99)