diff options
-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): |