diff options
author | 2017-09-13 00:34:21 +0000 | |
---|---|---|
committer | 2017-09-13 00:34:21 +0000 | |
commit | 86c1525ffa85f05060be0b2492126b78f00a4fbc (patch) | |
tree | 018b4f2173f1aeccb67e269922e873c6c077ab79 | |
parent | d4123e672586bc38820d6a00d7f0103b4e10b103 (diff) | |
parent | 7bb0e9134203a954dd9d1c8f2573294a5ae2b59a (diff) |
Merge "Add vim_types API to MultiCloud Framework"
-rw-r--r-- | multivimbroker/multivimbroker/forwarder/urls.py | 3 | ||||
-rw-r--r-- | multivimbroker/multivimbroker/forwarder/views.py | 36 |
2 files changed, 39 insertions, 0 deletions
diff --git a/multivimbroker/multivimbroker/forwarder/urls.py b/multivimbroker/multivimbroker/forwarder/urls.py index ee4098b..5b3fc41 100644 --- a/multivimbroker/multivimbroker/forwarder/urls.py +++ b/multivimbroker/multivimbroker/forwarder/urls.py @@ -19,9 +19,12 @@ from multivimbroker.forwarder.views import Extension from multivimbroker.forwarder.views import Forward from multivimbroker.forwarder.views import Identity from multivimbroker.forwarder.views import Registry +from multivimbroker.forwarder.views import VIMTypes urlpatterns = [ + url(r'^api/multicloud/v0/vim_types$', + VIMTypes.as_view()), 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' diff --git a/multivimbroker/multivimbroker/forwarder/views.py b/multivimbroker/multivimbroker/forwarder/views.py index edb9be1..623aaa8 100644 --- a/multivimbroker/multivimbroker/forwarder/views.py +++ b/multivimbroker/multivimbroker/forwarder/views.py @@ -13,6 +13,8 @@ # limitations under the License. from rest_framework.views import APIView +from rest_framework.views import Response +from rest_framework.views import status from multivimbroker.forwarder.base import BaseHandler # @@ -70,6 +72,40 @@ class Extension(BaseServer): return self.send(vimid, request.get_full_path(), request.body, "GET") +class VIMTypes(BaseServer): + + def get(self, request): + # Fix here unless we have plugin registry + data = { + "vim_types": [ + { + "vim_type": "openstack", + "versions": [ + { + "version": "mitaka", + "extra_info_hint": "" + }, + { + "version": "ocata", + "extra_info_hint": "" + } + ] + }, + { + "vim_type": "vmware", + "versions": [ + { + "version": "4.0", + "extra_info_hint": "" + } + ] + } + ] + } + + return Response(data=data, status=status.HTTP_200_OK) + + # forward handler class Forward(BaseServer): |