diff options
author | Bin Yang <bin.yang@windriver.com> | 2017-09-23 01:20:11 +0800 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2017-09-23 01:21:52 +0800 |
commit | d48dc5d5af174535d5d96c2bbaee3d03715ed2b9 (patch) | |
tree | c5a1cfc07fc8d5df4cfe52aeb5d0ea4e4896333f /windriver/titanium_cloud | |
parent | 2de8e160c31f3ecf951fb4e85a96aa1e814b0a33 (diff) |
Add backward support for identity v2.0 API
Add NBI v2.0/tokens and convert to SBI v3/auth/tokens
Change-Id: I5734e18f78844f15847b3a0a2d906b70e75fd260
Issue-Id: INT-225
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'windriver/titanium_cloud')
-rw-r--r-- | windriver/titanium_cloud/extensions/views/extensions.py | 18 | ||||
-rw-r--r-- | windriver/titanium_cloud/proxy/urls.py | 4 | ||||
-rw-r--r-- | windriver/titanium_cloud/proxy/views/identityV3.py | 6 |
3 files changed, 21 insertions, 7 deletions
diff --git a/windriver/titanium_cloud/extensions/views/extensions.py b/windriver/titanium_cloud/extensions/views/extensions.py index 2dd61fe9..3b231c02 100644 --- a/windriver/titanium_cloud/extensions/views/extensions.py +++ b/windriver/titanium_cloud/extensions/views/extensions.py @@ -12,9 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging +import traceback + +from keystoneauth1.exceptions import HttpError +from rest_framework import status +from rest_framework.response import Response +from rest_framework.views import APIView from titanium_cloud.pub.config import config +from newton.pub.exceptions import VimDriverNewtonException +from newton.requests.views.util import VimDriverUtils from newton.extensions.views import extensions as newton_extensions +from newton.pub.msapi import extsys logger = logging.getLogger(__name__) @@ -39,17 +48,14 @@ class Extensions(newton_extensions.Extensions): "alias": "epa-caps", "description": "Multiple network support", "name": "EPACapsQuery", - "url": self.proxy_prefix + "/%s/extensions/epa-caps" \ - % (vimid), + "url": self.proxy_prefix + "/%s/extensions/epa-caps" % (vimid), "spec": "" }, { "alias": "guest-monitor", "description": "Multiple network support", - "name": "EPACapsQuery", - "url": self.proxy_prefix +\ - "/%s/extensions/guest-monitor/{server_id}" \ - % (vimid), + "name": "Guest Monitor", + "url": self.proxy_prefix + "/%s/extensions/guest-monitor/{server_id}" % (vimid), "spec": "" } ] diff --git a/windriver/titanium_cloud/proxy/urls.py b/windriver/titanium_cloud/proxy/urls.py index dbad26fa..31a3c8f7 100644 --- a/windriver/titanium_cloud/proxy/urls.py +++ b/windriver/titanium_cloud/proxy/urls.py @@ -23,7 +23,9 @@ urlpatterns = [ # identityV2.Tokens.as_view()), url(r'^identity/v3/auth/tokens/?$', identityV3.Tokens.as_view()), - url(r'^identity/(?:v2.0/|)tenants/?$', + url(r'^identity/v2.0/tokens/?$', + identityV3.TokensV2.as_view()), + url(r'^identity/v2.0/tenants/?$', services.GetTenants.as_view()), url(r'^(?P<servicetype>[0-9a-zA-Z_-]{,18})/(?P<requri>[0-9a-zA-Z./_-]*)$', services.Services.as_view()), diff --git a/windriver/titanium_cloud/proxy/views/identityV3.py b/windriver/titanium_cloud/proxy/views/identityV3.py index a6efa6ac..2938caec 100644 --- a/windriver/titanium_cloud/proxy/views/identityV3.py +++ b/windriver/titanium_cloud/proxy/views/identityV3.py @@ -25,3 +25,9 @@ class Tokens(newton_identityV3.Tokens): def __init__(self): self.proxy_prefix = config.MULTICLOUD_PREFIX self._logger = logger + +class TokensV2(newton_identityV3.TokensV2): + + def __init__(self): + self.proxy_prefix = config.MULTICLOUD_PREFIX + self._logger = logger |