diff options
author | Ethan Lynn <ethanlynnl@vmware.com> | 2017-08-24 11:46:12 +0800 |
---|---|---|
committer | Ethan Lynn <ethanlynnl@vmware.com> | 2017-09-01 17:55:58 +0800 |
commit | a9562c1a7a41f0da36779193811f79fba2974e9b (patch) | |
tree | 7d1017745d6971f7e6dafc5aa7440276ba1add49 | |
parent | 67430600410e312c2db5a6a7709da8e45a5245fa (diff) |
Add registry API to MultiCloud framework
issue-id: MULTICLOUD-59
Change-Id: I0e5323c49cc93c940ce1a8878a8c14e5d76b2e4c
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r-- | multivimbroker/multivimbroker/forwarder/urls.py | 9 | ||||
-rw-r--r-- | multivimbroker/multivimbroker/forwarder/views.py | 14 |
2 files changed, 20 insertions, 3 deletions
diff --git a/multivimbroker/multivimbroker/forwarder/urls.py b/multivimbroker/multivimbroker/forwarder/urls.py index 2caa219..b391aa1 100644 --- a/multivimbroker/multivimbroker/forwarder/urls.py +++ b/multivimbroker/multivimbroker/forwarder/urls.py @@ -17,13 +17,18 @@ from rest_framework.urlpatterns import format_suffix_patterns from multivimbroker.forwarder.views import Forward from multivimbroker.forwarder.views import Identity +from multivimbroker.forwarder.views import Registry urlpatterns = [ url(r'^api/multicloud/v0/(?P<vimid>[0-9a-zA-Z_-]+)/identity/v3$', Identity.as_view()), - url(r'^api/multicloud/v0/(?P<vimid>[0-9a-zA-Z_-]+)/\ - identity/v3/auth/tokens$', Identity.as_view()), + url(r'^api/multicloud/v0/(?P<vimid>[0-9a-zA-Z_-]+)/identity/v3' + r'/auth/tokens$', Identity.as_view()), + url(r'^api/multicloud/v0/(?P<vimid>[0-9a-zA-Z_-]+)/registry$', + Registry.as_view()), + url(r'^api/multicloud/v0/(?P<vimid>[0-9a-zA-Z_-]+)$', + Registry.as_view()), url(r'^api/multicloud/v0/(?P<vimid>[0-9a-zA-Z_-]+)', Forward.as_view()), ] diff --git a/multivimbroker/multivimbroker/forwarder/views.py b/multivimbroker/multivimbroker/forwarder/views.py index ed67977..9eba2ec 100644 --- a/multivimbroker/multivimbroker/forwarder/views.py +++ b/multivimbroker/multivimbroker/forwarder/views.py @@ -39,7 +39,7 @@ class BaseServer(BaseHandler, APIView): raise NotImplementedError() -# vio proxy handler +# proxy handler class Identity(BaseServer): def get(self, request, vimid): @@ -51,6 +51,18 @@ class Identity(BaseServer): return self.send(vimid, request.get_full_path(), request.body, "POST") +class Registry(BaseServer): + + def post(self, request, vimid): + + return self.send(vimid, request.get_full_path(), request.body, "POST") + + def delete(self, request, vimid): + + return self.send(vimid, request.get_full_path(), request.body, + "DELETE") + + # forward handler class Forward(BaseServer): |