blob: ec02c71de4799b15bd02c5061e53de33f26c83a1 [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
Scott Bakerdcc9bee2014-07-13 16:21:38 -070015#from core.xoslib import XOSLibDataView
Tony Mack7130ac32013-03-22 21:58:00 -040016
Siobhan Tullycf04fb62014-01-11 11:25:57 -050017admin.site = SitePlus()
Tony Mack7130ac32013-03-22 21:58:00 -040018admin.autodiscover()
19
Scott Baker40695e12014-03-13 22:50:45 -070020def redirect_to_apache(request):
21 """ bounce a request back to the apache server that is running on the machine """
22 apache_url = "http://%s%s" % (request.META['HOSTNAME'], request.path)
23 return HttpResponseRedirect(apache_url)
24
Tony Mack7130ac32013-03-22 21:58:00 -040025urlpatterns = patterns('',
26 # Examples:
27 # url(r'^$', 'planetstack.views.home', name='home'),
28 # url(r'^planetstack/', include('planetstack.foo.urls')),
29
30 # Uncomment the admin/doc line below to enable admin documentation:
Siobhan Tullycf04fb62014-01-11 11:25:57 -050031 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Tony Mack7130ac32013-03-22 21:58:00 -040032
33 # Uncomment the next line to enable the admin:
34 url(r'^admin/', include(admin.site.urls)),
Siobhan Tullycf04fb62014-01-11 11:25:57 -050035 url(r'^', include(admin.site.urls)),
36 #url(r'^profile/home', 'core.views.home'),
Tony Mack7130ac32013-03-22 21:58:00 -040037
Scott Bakerdcc9bee2014-07-13 16:21:38 -070038# url(r'^admin/xoslib/(?P<name>\w+)/$', XOSLibDataView.as_view(), name="xoslib"),
39
Tony Mack7d97f062013-04-09 20:25:08 -040040 url(r'^plstackapi/$', api_root),
Scott Bakera60d2742014-05-30 15:10:17 -070041
Sapan Bhatia7b5c5522014-06-20 02:22:37 -040042 url(r'^plstackapi/dashboardviews/$', DashboardViewList.as_view(), name='dashboardview-list'),
43 url(r'^plstackapi/dashboardview/(?P<pk>[a-zA-Z0-9\-]+)/$', DashboardViewDetail.as_view(), name='dashboardview-detail'),
44
45 url(r'^plstackapi/payments/$', PaymentList.as_view(), name='payment-list'),
46 url(r'^plstackapi/payments/(?P<pk>[a-zA-Z0-9\-]+)/$', PaymentDetail.as_view(), name='payment-detail'),
47
48 url(r'^plstackapi/charges/$', ChargeList.as_view(), name='charge-list'),
49 url(r'^plstackapi/charges/(?P<pk>[a-zA-Z0-9\-]+)/$', ChargeDetail.as_view(), name='charge-detail'),
50
51 url(r'^plstackapi/accounts/$', AccountList.as_view(), name='account-list'),
52 url(r'^plstackapi/accounts/(?P<pk>[a-zA-Z0-9\-]+)/$', AccountDetail.as_view(), name='account-detail'),
53
Scott Baker0bd90762014-10-27 16:49:10 -070054 url(r'^plstackapi/flavors/$', FlavorList.as_view(), name='flavor-list'),
55 url(r'^plstackapi/flavors/(?P<pk>[a-zA-Z0-9\-]+)/$', FlavorDetail.as_view(), name='flavor-detail'),
56
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040057 url(r'^plstackapi/deployments/$', DeploymentList.as_view(), name='deployment-list'),
58 url(r'^plstackapi/deployments/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentDetail.as_view(), name='deployment-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040059
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040060 url(r'^plstackapi/images/$', ImageList.as_view(), name='image-list'),
61 url(r'^plstackapi/images/(?P<pk>[a-zA-Z0-9_\-]+)/$', ImageDetail.as_view(), name='image-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040062
Sapan Bhatia7b5c5522014-06-20 02:22:37 -040063 url(r'^plstackapi/networkparametertypes/$', NodeList.as_view(), name='node-list'),
64 url(r'^plstackapi/networkparametertypes/(?P<pk>[a-zA-Z0-9_\-]+)/$', NodeDetail.as_view(), name='node-detail'),
65
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040066 url(r'^plstackapi/nodes/$', NodeList.as_view(), name='node-list'),
67 url(r'^plstackapi/nodes/(?P<pk>[a-zA-Z0-9_\-]+)/$', NodeDetail.as_view(), name='node-detail'),
68
69 url(r'^plstackapi/projects/$', ProjectList.as_view(), name='project-list'),
70 url(r'^plstackapi/projects/(?P<pk>[a-zA-Z0-9_\-]+)/$', ProjectDetail.as_view(), name='project-detail'),
71
72 url(r'^plstackapi/reservations/$', ReservationList.as_view(), name='reservation-list'),
73 url(r'^plstackapi/reservations/(?P<pk>[a-zA-Z0-9_\-]+)/$', ReservationDetail.as_view(), name='reservation-detail'),
74
75 url(r'^plstackapi/roles/$', RoleList.as_view(), name='role-list'),
76 url(r'^plstackapi/roles/(?P<pk>[a-zA-Z0-9]+)/$', RoleDetail.as_view(), name='role-detail'),
77
78 url(r'^plstackapi/serviceclasses/$', ServiceClassList.as_view(), name='serviceclass-list'),
79 url(r'^plstackapi/serviceclasses/(?P<pk>[a-zA-Z0-9]+)/$', ServiceClassDetail.as_view(), name='serviceclass-detail'),
80
81 url(r'^plstackapi/serviceresources/$', ServiceResourceList.as_view(), name='serviceresource-list'),
82 url(r'^plstackapi/serviceresources/(?P<pk>[a-zA-Z0-9]+)/$', ServiceResourceDetail.as_view(), name='serviceresource-detail'),
83
84 url(r'^plstackapi/site_privileges/$', SitePrivilegeList.as_view(), name='siteprivilege-list'),
85 url(r'^plstackapi/site_privileges/(?P<pk>[a-zA-Z0-9_]+)/$', SitePrivilegeDetail.as_view(), name='siteprivilege-detail'),
Scott Baker7f4a9a02014-10-07 12:07:09 -070086
Scott Baker5ee48942014-10-07 12:11:34 -070087 url(r'^plstackapi/site_roles/$', SiteRoleList.as_view(), name='siterole-list'),
88 url(r'^plstackapi/site_roles/(?P<pk>[a-zA-Z0-9_\-]+)/$', SiteRoleDetail.as_view(), name='siterole-detail'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040089
90 url(r'^plstackapi/sites/$', SiteList.as_view(), name='site-list'),
91 url(r'^plstackapi/sites/(?P<pk>[a-zA-Z0-9_\-]+)/$', SiteDetail.as_view(), name='site-detail'),
92
Sapan Bhatia7b5c5522014-06-20 02:22:37 -040093 url(r'^plstackapi/accounts/$', AccountList.as_view(), name='account-list'),
94 url(r'^plstackapi/accounts/(?P<pk>[a-zA-Z0-9_\-]+)/$', AccountDetail.as_view(), name='account-detail'),
95
Scott Bakercc8477d2014-08-12 18:29:52 -070096 url(r'^plstackapi/networktemplates/$', NetworkTemplateList.as_view(), name='networktemplate-list'),
97 url(r'^plstackapi/networktemplates/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkTemplateDetail.as_view(), name='networktemplate-detail'),
Sapan Bhatia7b5c5522014-06-20 02:22:37 -040098
99 url(r'^plstackapi/networkslices/$', NetworkSliceList.as_view(), name='networkslice-list'),
100 url(r'^plstackapi/networkslices/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkSliceDetail.as_view(), name='networkslice-detail'),
101
Scott Baker53567da2014-08-12 12:05:41 -0700102 url(r'^plstackapi/networkslivers/$', NetworkSliverList.as_view(), name='networksliver-list'),
103 url(r'^plstackapi/networkslivers/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkSliverDetail.as_view(), name='networksliver-detail'),
104
Scott Baker296a36e2014-10-31 16:43:32 -0700105 url(r'^plstackapi/networkdeployments/$', NetworkDeploymentsList.as_view(), name='networkdeployment-list'),
106 url(r'^plstackapi/networkdeployments/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkDeploymentsDetail.as_view(), name='networkdeployment-detail'),
107
Sapan Bhatia7b5c5522014-06-20 02:22:37 -0400108 url(r'^plstackapi/networks/$', NetworkList.as_view(), name='network-list'),
109 url(r'^plstackapi/networks/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkDetail.as_view(), name='network-detail'),
110
Scott Bakerdb43ba62014-10-27 22:45:43 -0700111 url(r'^plstackapi/services/$', ServiceList.as_view(), name='service-list'),
112 url(r'^plstackapi/services/(?P<pk>[a-zA-Z0-9_\-]+)/$', ServiceDetail.as_view(), name='service-detail'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400113
Sapan Bhatiadea39432014-06-13 03:10:36 -0400114 url(r'^plstackapi/slices/$', SliceList.as_view(), name='slice-list'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400115 url(r'^plstackapi/slices/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceDetail.as_view(), name='slice-detail'),
116
Scott Baker5ee48942014-10-07 12:11:34 -0700117 url(r'^plstackapi/slice_roles/$', SliceRoleList.as_view(), name='slicerole-list'),
118 url(r'^plstackapi/slice_roles/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceRoleDetail.as_view(), name='slicerole-detail'),
119
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400120 url(r'^plstackapi/slice_memberships/$', SlicePrivilegeList.as_view(), name='sliceprivilege-list'),
121 url(r'^plstackapi/slice_memberships/(?P<pk>[0-9]+)/$', SlicePrivilegeDetail.as_view(), name='sliceprivilege-detail'),
Scott Baker0fb59632014-10-29 10:06:16 -0700122
123 url(r'^plstackapi/slice_deployments/$', SliceDeploymentsList.as_view(), name='slicedeployments-list'),
124 url(r'^plstackapi/slice_deployments/(?P<pk>[0-9]+)/$', SliceDeploymentsDetail.as_view(), name='slicedeployments-detail'),
Scott Bakerf88bbcb2014-10-30 00:06:37 -0700125
126 url(r'^plstackapi/slice_privileges/$', SlicePrivilegeList.as_view(), name='sliceprivilege-list'),
127 url(r'^plstackapi/slice_privileges/(?P<pk>[0-9]+)/$', SlicePrivilegeDetail.as_view(), name='sliceprivilege-detail'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400128
129 url(r'^plstackapi/slivers/$', SliverList.as_view(), name='sliver-list'),
130 url(r'^plstackapi/slivers/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliverDetail.as_view(), name='sliver-detail'),
131
132 url(r'^plstackapi/tags/$', TagList.as_view(), name='tag-list'),
133 url(r'^plstackapi/tags/(?P<pk>[a-zA-Z0-9_\-]+)/$', TagDetail.as_view(), name='tag-detail'),
134
135 url(r'^plstackapi/users/$', UserList.as_view(), name='user-list'),
136 url(r'^plstackapi/users/(?P<pk>[a-zA-Z0-9_\-]+)/$', UserDetail.as_view(), name='user-detail'),
137
Scott Baker296a36e2014-10-31 16:43:32 -0700138 url(r'^plstackapi/user_deployments/$', UserDeploymentsList.as_view(), name='userdeployments-list'),
139 url(r'^plstackapi/user_deployments/(?P<pk>[a-zA-Z0-9_\-]+)/$', UserDeploymentsDetail.as_view(), name='userdeployments-detail'),
140
Scott Bakerf93c26b2014-08-01 14:56:49 -0700141 url(r'^xmlrpc/legacyapi/$', 'core.views.legacyapi.LegacyXMLRPC', name='xmlrpc'),
smbakere36a7de2013-10-29 17:25:25 -0700142
Scott Bakera60d2742014-05-30 15:10:17 -0700143# url(r'^analytics/(?P<name>\w+)/$', AnalyticsAjaxView.as_view(), name="analytics"),
144
Scott Baker40695e12014-03-13 22:50:45 -0700145 url(r'^files/', redirect_to_apache),
smbakere36a7de2013-10-29 17:25:25 -0700146
Tony Mack7130ac32013-03-22 21:58:00 -0400147 #Adding in rest_framework urls
Tony Mack9a3511e2013-04-09 19:06:01 -0400148 url(r'^plstackapi/', include('rest_framework.urls', namespace='rest_framework')),
Scott Bakerdcc9bee2014-07-13 16:21:38 -0700149
150 # XOSLib rest methods
151 url(r'^xoslib/', include('core.xoslib.methods', namespace='xoslib')),
Tony Mack7130ac32013-03-22 21:58:00 -0400152)