blob: 3513a38228ee3a2b97393030052e71c4a3cb8ecf [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
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040054 url(r'^plstackapi/deployments/$', DeploymentList.as_view(), name='deployment-list'),
55 url(r'^plstackapi/deployments/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentDetail.as_view(), name='deployment-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040056
Siobhan Tully5d7dc8d2013-07-02 13:17:33 -040057 url(r'^plstackapi/images/$', ImageList.as_view(), name='image-list'),
58 url(r'^plstackapi/images/(?P<pk>[a-zA-Z0-9_\-]+)/$', ImageDetail.as_view(), name='image-detail'),
Tony Mack29c287f2013-04-11 21:07:16 -040059
Sapan Bhatia7b5c5522014-06-20 02:22:37 -040060 url(r'^plstackapi/networkparametertypes/$', NodeList.as_view(), name='node-list'),
61 url(r'^plstackapi/networkparametertypes/(?P<pk>[a-zA-Z0-9_\-]+)/$', NodeDetail.as_view(), name='node-detail'),
62
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040063 url(r'^plstackapi/nodes/$', NodeList.as_view(), name='node-list'),
64 url(r'^plstackapi/nodes/(?P<pk>[a-zA-Z0-9_\-]+)/$', NodeDetail.as_view(), name='node-detail'),
65
66 url(r'^plstackapi/projects/$', ProjectList.as_view(), name='project-list'),
67 url(r'^plstackapi/projects/(?P<pk>[a-zA-Z0-9_\-]+)/$', ProjectDetail.as_view(), name='project-detail'),
68
69 url(r'^plstackapi/reservations/$', ReservationList.as_view(), name='reservation-list'),
70 url(r'^plstackapi/reservations/(?P<pk>[a-zA-Z0-9_\-]+)/$', ReservationDetail.as_view(), name='reservation-detail'),
71
72 url(r'^plstackapi/roles/$', RoleList.as_view(), name='role-list'),
73 url(r'^plstackapi/roles/(?P<pk>[a-zA-Z0-9]+)/$', RoleDetail.as_view(), name='role-detail'),
74
75 url(r'^plstackapi/serviceclasses/$', ServiceClassList.as_view(), name='serviceclass-list'),
76 url(r'^plstackapi/serviceclasses/(?P<pk>[a-zA-Z0-9]+)/$', ServiceClassDetail.as_view(), name='serviceclass-detail'),
77
78 url(r'^plstackapi/serviceresources/$', ServiceResourceList.as_view(), name='serviceresource-list'),
79 url(r'^plstackapi/serviceresources/(?P<pk>[a-zA-Z0-9]+)/$', ServiceResourceDetail.as_view(), name='serviceresource-detail'),
80
81 url(r'^plstackapi/site_privileges/$', SitePrivilegeList.as_view(), name='siteprivilege-list'),
82 url(r'^plstackapi/site_privileges/(?P<pk>[a-zA-Z0-9_]+)/$', SitePrivilegeDetail.as_view(), name='siteprivilege-detail'),
83
84 url(r'^plstackapi/sites/$', SiteList.as_view(), name='site-list'),
85 url(r'^plstackapi/sites/(?P<pk>[a-zA-Z0-9_\-]+)/$', SiteDetail.as_view(), name='site-detail'),
86
Sapan Bhatia7b5c5522014-06-20 02:22:37 -040087 url(r'^plstackapi/accounts/$', AccountList.as_view(), name='account-list'),
88 url(r'^plstackapi/accounts/(?P<pk>[a-zA-Z0-9_\-]+)/$', AccountDetail.as_view(), name='account-detail'),
89
90 url(r'^plstackapi/networktemplates/$', NetworkSliceList.as_view(), name='networkslice-list'),
91 url(r'^plstackapi/networktemplates/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkSliceDetail.as_view(), name='networkslice-detail'),
92
93 url(r'^plstackapi/networkslices/$', NetworkSliceList.as_view(), name='networkslice-list'),
94 url(r'^plstackapi/networkslices/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkSliceDetail.as_view(), name='networkslice-detail'),
95
96 url(r'^plstackapi/networks/$', NetworkList.as_view(), name='network-list'),
97 url(r'^plstackapi/networks/(?P<pk>[a-zA-Z0-9_\-]+)/$', NetworkDetail.as_view(), name='network-detail'),
98
99 url(r'^plstackapi/services/$', SliceList.as_view(), name='service-list'),
Sapan Bhatiadea39432014-06-13 03:10:36 -0400100 url(r'^plstackapi/services/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceDetail.as_view(), name='service-detail'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400101
Sapan Bhatiadea39432014-06-13 03:10:36 -0400102 url(r'^plstackapi/slices/$', SliceList.as_view(), name='slice-list'),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400103 url(r'^plstackapi/slices/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceDetail.as_view(), name='slice-detail'),
104
105 url(r'^plstackapi/slice_memberships/$', SlicePrivilegeList.as_view(), name='sliceprivilege-list'),
106 url(r'^plstackapi/slice_memberships/(?P<pk>[0-9]+)/$', SlicePrivilegeDetail.as_view(), name='sliceprivilege-detail'),
107
108 url(r'^plstackapi/slivers/$', SliverList.as_view(), name='sliver-list'),
109 url(r'^plstackapi/slivers/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliverDetail.as_view(), name='sliver-detail'),
110
111 url(r'^plstackapi/tags/$', TagList.as_view(), name='tag-list'),
112 url(r'^plstackapi/tags/(?P<pk>[a-zA-Z0-9_\-]+)/$', TagDetail.as_view(), name='tag-detail'),
113
114 url(r'^plstackapi/users/$', UserList.as_view(), name='user-list'),
115 url(r'^plstackapi/users/(?P<pk>[a-zA-Z0-9_\-]+)/$', UserDetail.as_view(), name='user-detail'),
116
smbakere36a7de2013-10-29 17:25:25 -0700117 url(r'^legacyapi/$', 'core.views.legacyapi.LegacyXMLRPC', name='xmlrpc'),
118
Scott Bakera60d2742014-05-30 15:10:17 -0700119# url(r'^analytics/(?P<name>\w+)/$', AnalyticsAjaxView.as_view(), name="analytics"),
120
Scott Baker40695e12014-03-13 22:50:45 -0700121 url(r'^files/', redirect_to_apache),
smbakere36a7de2013-10-29 17:25:25 -0700122
Tony Mack7130ac32013-03-22 21:58:00 -0400123 #Adding in rest_framework urls
Tony Mack9a3511e2013-04-09 19:06:01 -0400124 url(r'^plstackapi/', include('rest_framework.urls', namespace='rest_framework')),
Scott Bakerdcc9bee2014-07-13 16:21:38 -0700125
126 # XOSLib rest methods
127 url(r'^xoslib/', include('core.xoslib.methods', namespace='xoslib')),
Tony Mack7130ac32013-03-22 21:58:00 -0400128)