diff options
Diffstat (limited to 'pike')
-rw-r--r-- | pike/pike/registration/views/registration.py | 19 | ||||
-rw-r--r-- | pike/pike/urls.py | 7 |
2 files changed, 26 insertions, 0 deletions
diff --git a/pike/pike/registration/views/registration.py b/pike/pike/registration/views/registration.py index dfb1d91f..121a39d0 100644 --- a/pike/pike/registration/views/registration.py +++ b/pike/pike/registration/views/registration.py @@ -34,3 +34,22 @@ class Registry(newton_registration.Registry): self.proxy_prefix = settings.MULTICLOUD_PREFIX self.aai_base_url = settings.AAI_BASE_URL self._logger = logger + +class RegistryV1(Registry): + def __init__(self): + self.proxy_prefix = settings.MULTICLOUD_API_V1_PREFIX + self.aai_base_url = settings.AAI_BASE_URL + self._logger = logger + + def post(self, request, cloud_owner="", cloud_region_id=""): + self._logger.info("registration with : %s, %s" % (cloud_owner, cloud_region_id)) + self._logger.debug("with data: %s" % request.data) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(RegistryV1, self).post(request, vimid) + + def delete(self, request, cloud_owner="", cloud_region_id=""): + self._logger.debug("unregister cloud region: %s, %s" % (cloud_owner, cloud_region_id)) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(RegistryV1, self).delete(request, vimid) diff --git a/pike/pike/urls.py b/pike/pike/urls.py index 03593565..8e1ad9f6 100644 --- a/pike/pike/urls.py +++ b/pike/pike/urls.py @@ -34,6 +34,13 @@ urlpatterns = [ '(?P<tenantid>[0-9a-zA-Z_-]{20,})/', include('pike.requests.urls')), url(r'^api/multicloud-pike/v0/(?P<vimid>[0-9a-zA-Z_-]+)/capacity_check/?$', capacity.CapacityCheck.as_view()), + + # API upgrading + url(r'^api/multicloud-pike/v1/(?P<vimid>[0-9a-zA-Z_-]+)/registry$', + registration.RegistryV1.as_view()), + url(r'^api/multicloud-pike/v1/(?P<vimid>[0-9a-zA-Z_-]+)$', + registration.RegistryV1.as_view()), + url(r'^api/multicloud-pike/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/infra_workload/?$', infra_workload.APIv1InfraWorkload.as_view()), url(r'^api/multicloud-pike/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/infra_workload/(?P<requri>[0-9a-zA-Z_-]*)/?$', |