diff options
author | Bin Yang <bin.yang@windriver.com> | 2018-08-14 08:50:33 +0000 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2018-08-14 08:50:33 +0000 |
commit | 39d394d0a5c02fbe122f0b78f4a5a47bf5ec4bae (patch) | |
tree | 19dd713f9fc861125efc5fe6bc4f504ac08523fb | |
parent | 375fa747adf4096042c9f606d2bb21e0e8165570 (diff) |
API upgrading for dnsaas
Change-Id: I328f8838b96013d5738354f751f5668f2136b1dc
Issue-ID: MULTICLOUD-297
Signed-off-by: Bin Yang <bin.yang@windriver.com>
-rw-r--r-- | share/newton_base/proxy/dnsaasdelegate.py | 46 | ||||
-rw-r--r-- | windriver/titanium_cloud/proxy/urlsV1.py | 8 |
2 files changed, 49 insertions, 5 deletions
diff --git a/share/newton_base/proxy/dnsaasdelegate.py b/share/newton_base/proxy/dnsaasdelegate.py index dd61c167..4ffe29f8 100644 --- a/share/newton_base/proxy/dnsaasdelegate.py +++ b/share/newton_base/proxy/dnsaasdelegate.py @@ -226,3 +226,49 @@ class DnsaasDelegate(Services): self._logger.debug("META,data> %s , %s" % (request.META, request.data)) return self._do_action("delete", request, vimid, "dns", requri) + + + +class APIv1DnsaasDelegate(Services): + ''' + DNSaaS delegate service API V1 + ''' + + def __init__(self): + self._logger = logger + + def get(self, request, cloud_owner="", cloud_region_id="", servicetype="dns-delegate", requri=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1DnsaasDelegate,self).get(request, vimid, servicetype, requri) + + def head(self, request, cloud_owner="", cloud_region_id="", servicetype="dns-delegate", requri=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1DnsaasDelegate,self).head(request, vimid, servicetype, requri) + + def post(self, request, cloud_owner="", cloud_region_id="", servicetype="dns-delegate", requri=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1DnsaasDelegate,self).post(request, vimid, servicetype, requri) + + def put(self, request, cloud_owner="", cloud_region_id="", servicetype="dns-delegate", requri=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1DnsaasDelegate,self).put(request, vimid, servicetype, requri) + + def patch(self, request, cloud_owner="", cloud_region_id="", servicetype="dns-delegate", requri=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1DnsaasDelegate,self).patch(request, vimid, servicetype, requri) + + def delete(self, request, cloud_owner="", cloud_region_id="", servicetype="dns-delegate", requri=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1DnsaasDelegate,self).delete(request, vimid, servicetype, requri) diff --git a/windriver/titanium_cloud/proxy/urlsV1.py b/windriver/titanium_cloud/proxy/urlsV1.py index 4b23fa7a..757ddf7e 100644 --- a/windriver/titanium_cloud/proxy/urlsV1.py +++ b/windriver/titanium_cloud/proxy/urlsV1.py @@ -17,11 +17,9 @@ from rest_framework.urlpatterns import format_suffix_patterns from titanium_cloud.proxy.views import identityV3 from titanium_cloud.proxy.views import services -#from newton_base.proxy import dnsaasdelegate +from newton_base.proxy import dnsaasdelegate urlpatterns = [ - # url(r'^identity/v2)$', - # identityV2.Tokens.as_view()), url(r'^identity/v3/auth/tokens/?$', identityV3.APIv1Tokens.as_view()), url(r'^identity/v3/?$', @@ -32,8 +30,8 @@ urlpatterns = [ identityV3.APIv1TokensV2.as_view()), url(r'^identity/v2.0/tenants/?$', services.APIv1GetTenants.as_view()), -# url(r'dns-delegate/(?P<requri>[0-9a-zA-Z./_-]*)$', -# dnsaasdelegate.APIv1DnsaasDelegate.as_view()), + url(r'dns-delegate/(?P<requri>[0-9a-zA-Z./_-]*)$', + dnsaasdelegate.APIv1DnsaasDelegate.as_view()), url(r'^(?P<servicetype>[0-9a-zA-Z_-]{,18})/(?P<requri>[0-9a-zA-Z./_-]*)$', services.APIv1Services.as_view()), ] |