diff options
Diffstat (limited to 'windriver/titanium_cloud/proxy/views')
-rw-r--r-- | windriver/titanium_cloud/proxy/views/identityV3.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/windriver/titanium_cloud/proxy/views/identityV3.py b/windriver/titanium_cloud/proxy/views/identityV3.py index eaeeca47..cae0e834 100644 --- a/windriver/titanium_cloud/proxy/views/identityV3.py +++ b/windriver/titanium_cloud/proxy/views/identityV3.py @@ -16,6 +16,7 @@ import logging from django.conf import settings from newton_base.proxy import identityV3 as newton_identityV3 +from common.msapi import extsys logger = logging.getLogger(__name__) @@ -32,3 +33,51 @@ class TokensV2(newton_identityV3.TokensV2): def __init__(self): self.proxy_prefix = settings.MULTICLOUD_PREFIX self._logger = logger + + +class APIv1Tokens(Tokens): + def __init__(self): + self.proxy_prefix = settings.MULTICLOUD_PREFIX + self._logger = logger + + + def get(self, request, cloud_owner="", cloud_region_id=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + #self._logger.debug("META> %s" % request.META) + #self._logger.debug("data> %s" % request.data) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1Tokens,self).get(request, vimid) + + + def post(self, request, cloud_owner="", cloud_region_id=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + #self._logger.debug("META> %s" % request.META) + #self._logger.debug("data> %s" % request.data) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1Tokens,self).post(request, vimid) + + +class APIv1TokensV2(TokensV2): + def __init__(self): + self.proxy_prefix = settings.MULTICLOUD_PREFIX + self._logger = logger + + + def get(self, request, cloud_owner="", cloud_region_id=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + #self._logger.debug("META> %s" % request.META) + #self._logger.debug("data> %s" % request.data) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1TokensV2,self).get(request, vimid) + + + def post(self, request, cloud_owner="", cloud_region_id=""): + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + #self._logger.debug("META> %s" % request.META) + #self._logger.debug("data> %s" % request.data) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1TokensV2,self).post(request, vimid) |