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 |
Sapan Bhatia | dea3943 | 2014-06-13 03:10:36 -0400 | [diff] [blame] | 5 | |
| 6 | # This is the generated API |
| 7 | from genapi import * |
| 8 | |
smbaker | 7225f72 | 2013-10-29 18:33:51 -0700 | [diff] [blame] | 9 | from core.views.legacyapi import LegacyXMLRPC |
Scott Baker | a60d274 | 2014-05-30 15:10:17 -0700 | [diff] [blame] | 10 | #from core.views.analytics import AnalyticsAjaxView |
Siobhan Tully | 5d7dc8d | 2013-07-02 13:17:33 -0400 | [diff] [blame] | 11 | from core.models import * |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 12 | from rest_framework import generics |
Scott Baker | a60d274 | 2014-05-30 15:10:17 -0700 | [diff] [blame] | 13 | from core.dashboard.sites import SitePlus |
Scott Baker | 40695e1 | 2014-03-13 22:50:45 -0700 | [diff] [blame] | 14 | from django.http import HttpResponseRedirect |
Scott Baker | dcc9bee | 2014-07-13 16:21:38 -0700 | [diff] [blame] | 15 | #from core.xoslib import XOSLibDataView |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 16 | |
Siobhan Tully | cf04fb6 | 2014-01-11 11:25:57 -0500 | [diff] [blame] | 17 | admin.site = SitePlus() |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 18 | admin.autodiscover() |
| 19 | |
Scott Baker | 40695e1 | 2014-03-13 22:50:45 -0700 | [diff] [blame] | 20 | def 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 Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 25 | urlpatterns = 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 Tully | cf04fb6 | 2014-01-11 11:25:57 -0500 | [diff] [blame] | 31 | url(r'^admin/doc/', include('django.contrib.admindocs.urls')), |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 32 | |
| 33 | # Uncomment the next line to enable the admin: |
| 34 | url(r'^admin/', include(admin.site.urls)), |
Siobhan Tully | cf04fb6 | 2014-01-11 11:25:57 -0500 | [diff] [blame] | 35 | url(r'^', include(admin.site.urls)), |
| 36 | #url(r'^profile/home', 'core.views.home'), |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 37 | |
Scott Baker | dcc9bee | 2014-07-13 16:21:38 -0700 | [diff] [blame] | 38 | # url(r'^admin/xoslib/(?P<name>\w+)/$', XOSLibDataView.as_view(), name="xoslib"), |
| 39 | |
Tony Mack | 7d97f06 | 2013-04-09 20:25:08 -0400 | [diff] [blame] | 40 | url(r'^plstackapi/$', api_root), |
Scott Baker | a60d274 | 2014-05-30 15:10:17 -0700 | [diff] [blame] | 41 | |
Sapan Bhatia | 7b5c552 | 2014-06-20 02:22:37 -0400 | [diff] [blame] | 42 | 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 Baker | 0bd9076 | 2014-10-27 16:49:10 -0700 | [diff] [blame] | 54 | 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 Tully | 5d7dc8d | 2013-07-02 13:17:33 -0400 | [diff] [blame] | 57 | 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 Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 59 | |
Siobhan Tully | 5d7dc8d | 2013-07-02 13:17:33 -0400 | [diff] [blame] | 60 | 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 Mack | 29c287f | 2013-04-11 21:07:16 -0400 | [diff] [blame] | 62 | |
Sapan Bhatia | 7b5c552 | 2014-06-20 02:22:37 -0400 | [diff] [blame] | 63 | 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 Tully | bfd11dc | 2013-09-03 12:59:24 -0400 | [diff] [blame] | 66 | 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 Baker | 7f4a9a0 | 2014-10-07 12:07:09 -0700 | [diff] [blame] | 86 | |
Scott Baker | 5ee4894 | 2014-10-07 12:11:34 -0700 | [diff] [blame] | 87 | 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 Tully | bfd11dc | 2013-09-03 12:59:24 -0400 | [diff] [blame] | 89 | |
| 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 Bhatia | 7b5c552 | 2014-06-20 02:22:37 -0400 | [diff] [blame] | 93 | 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 Baker | cc8477d | 2014-08-12 18:29:52 -0700 | [diff] [blame] | 96 | 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 Bhatia | 7b5c552 | 2014-06-20 02:22:37 -0400 | [diff] [blame] | 98 | |
| 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 Baker | 53567da | 2014-08-12 12:05:41 -0700 | [diff] [blame] | 102 | 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 Baker | 296a36e | 2014-10-31 16:43:32 -0700 | [diff] [blame] | 105 | 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 Bhatia | 7b5c552 | 2014-06-20 02:22:37 -0400 | [diff] [blame] | 108 | 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 Baker | db43ba6 | 2014-10-27 22:45:43 -0700 | [diff] [blame] | 111 | 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 Tully | bfd11dc | 2013-09-03 12:59:24 -0400 | [diff] [blame] | 113 | |
Sapan Bhatia | dea3943 | 2014-06-13 03:10:36 -0400 | [diff] [blame] | 114 | url(r'^plstackapi/slices/$', SliceList.as_view(), name='slice-list'), |
Siobhan Tully | bfd11dc | 2013-09-03 12:59:24 -0400 | [diff] [blame] | 115 | url(r'^plstackapi/slices/(?P<pk>[a-zA-Z0-9_\-]+)/$', SliceDetail.as_view(), name='slice-detail'), |
| 116 | |
Scott Baker | 5ee4894 | 2014-10-07 12:11:34 -0700 | [diff] [blame] | 117 | 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 Tully | bfd11dc | 2013-09-03 12:59:24 -0400 | [diff] [blame] | 120 | 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 Baker | 0fb5963 | 2014-10-29 10:06:16 -0700 | [diff] [blame] | 122 | |
| 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 Baker | f88bbcb | 2014-10-30 00:06:37 -0700 | [diff] [blame] | 125 | |
| 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 Tully | bfd11dc | 2013-09-03 12:59:24 -0400 | [diff] [blame] | 128 | |
| 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 Baker | 296a36e | 2014-10-31 16:43:32 -0700 | [diff] [blame] | 138 | 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 Baker | f93c26b | 2014-08-01 14:56:49 -0700 | [diff] [blame] | 141 | url(r'^xmlrpc/legacyapi/$', 'core.views.legacyapi.LegacyXMLRPC', name='xmlrpc'), |
smbaker | e36a7de | 2013-10-29 17:25:25 -0700 | [diff] [blame] | 142 | |
Scott Baker | a60d274 | 2014-05-30 15:10:17 -0700 | [diff] [blame] | 143 | # url(r'^analytics/(?P<name>\w+)/$', AnalyticsAjaxView.as_view(), name="analytics"), |
| 144 | |
Scott Baker | 40695e1 | 2014-03-13 22:50:45 -0700 | [diff] [blame] | 145 | url(r'^files/', redirect_to_apache), |
smbaker | e36a7de | 2013-10-29 17:25:25 -0700 | [diff] [blame] | 146 | |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 147 | #Adding in rest_framework urls |
Tony Mack | 9a3511e | 2013-04-09 19:06:01 -0400 | [diff] [blame] | 148 | url(r'^plstackapi/', include('rest_framework.urls', namespace='rest_framework')), |
Scott Baker | dcc9bee | 2014-07-13 16:21:38 -0700 | [diff] [blame] | 149 | |
| 150 | # XOSLib rest methods |
| 151 | url(r'^xoslib/', include('core.xoslib.methods', namespace='xoslib')), |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 152 | ) |