From 9dfd43101054c096e258dec68fa546ed0b54b986 Mon Sep 17 00:00:00 2001 From: Haibin Huang Date: Mon, 18 Feb 2019 20:47:29 +0800 Subject: Fix URL definitions interfere with each other Change-Id: I2f0bc1ca7e6d4e6337cc504c51e9ead06bd5be4e Issue-ID: MULTICLOUD-477 Signed-off-by: Haibin Huang --- ocata/ocata/urls.py | 8 ++++++-- pike/pike/urls.py | 8 ++++++-- starlingx/starlingx/urls.py | 10 ++++++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ocata/ocata/urls.py b/ocata/ocata/urls.py index 5fb1e97e..ddabfb84 100644 --- a/ocata/ocata/urls.py +++ b/ocata/ocata/urls.py @@ -30,6 +30,10 @@ urlpatterns = [ registration.Registry.as_view()), url(r'^api/multicloud-ocata/v0/(?P[0-9a-zA-Z_-]+)/exten', include('ocata.extensions.urls')), + url(r'^api/multicloud-ocata/v0/(?P[0-9a-zA-Z_-]+)/infra_workload/?$', + infra_workload.InfraWorkload.as_view()), + url(r'^api/multicloud-ocata/v0/(?P[0-9a-zA-Z_-]+)/infra_workload/(?P[0-9a-zA-Z_-]*)/?$', + infra_workload.InfraWorkload.as_view()), url(r'^api/multicloud-ocata/v0/(?P[0-9a-zA-Z_-]+)/', include('ocata.proxy.urls')), url(r'^api/multicloud-ocata/v0/(?P[0-9a-zA-Z_-]+)/tenants$', @@ -52,8 +56,6 @@ urlpatterns = [ registration.RegistryV1.as_view()), url(r'^api/multicloud-ocata/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/exten', include('ocata.extensions.urlsV1')), - url(r'^api/multicloud-ocata/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/', - include('ocata.proxy.urlsV1')), url(r'^api/multicloud-ocata/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/tenants/?$', tenants.APIv1Tenants.as_view()), url(r'^api/multicloud-ocata/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/' @@ -66,4 +68,6 @@ urlpatterns = [ infra_workload.APIv1InfraWorkload.as_view()), url(r'^api/multicloud-ocata/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/infra_workload/(?P[0-9a-zA-Z_-]*)/?$', infra_workload.APIv1InfraWorkload.as_view()), + url(r'^api/multicloud-ocata/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/', + include('ocata.proxy.urlsV1')), ] diff --git a/pike/pike/urls.py b/pike/pike/urls.py index f347da1a..dc0d43a4 100644 --- a/pike/pike/urls.py +++ b/pike/pike/urls.py @@ -26,6 +26,10 @@ urlpatterns = [ registration.Registry.as_view()), url(r'^api/multicloud-pike/v0/(?P[0-9a-zA-Z_-]+)/exten', include('pike.extensions.urls')), + url(r'^api/multicloud-pike/v0/(?P[0-9a-zA-Z_-]+)/infra_workload/?$', + infra_workload.InfraWorkload.as_view()), + url(r'^api/multicloud-pike/v0/(?P[0-9a-zA-Z_-]+)/infra_workload/(?P[0-9a-zA-Z_-]*)/?$', + infra_workload.InfraWorkload.as_view()), url(r'^api/multicloud-pike/v0/(?P[0-9a-zA-Z_-]+)/', include('pike.proxy.urls')), url(r'^api/multicloud-pike/v0/(?P[0-9a-zA-Z_-]+)/tenants$', @@ -45,8 +49,6 @@ urlpatterns = [ registration.RegistryV1.as_view()), url(r'^api/multicloud-pike/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/exten', include('pike.extensions.urlsV1')), - url(r'^api/multicloud-pike/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/', - include('pike.proxy.urlsV1')), url(r'^api/multicloud-pike/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/tenants/?$', tenants.APIv1Tenants.as_view()), url(r'^api/multicloud-pike/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/' @@ -57,4 +59,6 @@ urlpatterns = [ infra_workload.APIv1InfraWorkload.as_view()), url(r'^api/multicloud-pike/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/infra_workload/(?P[0-9a-zA-Z_-]*)/?$', infra_workload.APIv1InfraWorkload.as_view()), + url(r'^api/multicloud-pike/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/', + include('pike.proxy.urlsV1')), ] diff --git a/starlingx/starlingx/urls.py b/starlingx/starlingx/urls.py index 5d597e46..b64946ce 100644 --- a/starlingx/starlingx/urls.py +++ b/starlingx/starlingx/urls.py @@ -27,14 +27,18 @@ urlpatterns = [ registration.Registry.as_view()), url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/?$', registration.Registry.as_view()), - url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/', - include('starlingx.proxy.urls')), url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/tenants/?$', tenants.Tenants.as_view()), url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/' '(?P[0-9a-zA-Z_-]{20,})/', include('starlingx.requests.urls')), url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/capacity_check/?$', capacity.CapacityCheck.as_view()), + url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/infra_workload/?$', + infra_workload.InfraWorkload.as_view()), + url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/infra_workload/(?P[0-9a-zA-Z_-]*)/?$', + infra_workload.InfraWorkload.as_view()), + url(r'^api/multicloud-starlingx/v0/(?P[0-9a-zA-Z_-]+)/', + include('starlingx.proxy.urls')), # API v1, depreciated due to MULTICLOUD-335 url(r'^api/multicloud-starlingx/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/registry/?$', @@ -51,4 +55,6 @@ urlpatterns = [ capacity.APIv1CapacityCheck.as_view()), url(r'^api/multicloud-starlingx/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/infra_workload/?$', infra_workload.APIv1InfraWorkload.as_view()), + url(r'^api/multicloud-starlingx/v1/(?P[0-9a-zA-Z_-]+)/(?P[0-9a-zA-Z_-]+)/', + include('starlingx.proxy.urlsV1')), ] -- cgit 1.2.3-korg