X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=multivimbroker%2Fmultivimbroker%2Fforwarder%2Fviews.py;h=c2ea50587697e12855dfc3b0e0f9fb58d6b17041;hb=refs%2Fchanges%2F31%2F28131%2F1;hp=59c566beb85a2ffa51d54db8c83003642d670e98;hpb=9e76f8d1b1417fc06eb510cf668aa313ab94eb3d;p=multicloud%2Fframework.git diff --git a/multivimbroker/multivimbroker/forwarder/views.py b/multivimbroker/multivimbroker/forwarder/views.py index 59c566b..c2ea505 100644 --- a/multivimbroker/multivimbroker/forwarder/views.py +++ b/multivimbroker/multivimbroker/forwarder/views.py @@ -1,4 +1,5 @@ # Copyright 2017 Wind River Systems, Inc. +# Copyright (c) 2017-2018 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os +import json + from rest_framework.views import APIView from rest_framework.views import Response from rest_framework.views import status @@ -79,33 +83,11 @@ class VIMTypes(BaseServer): def get(self, request): # Fix here unless we have plugin registry - data = { - "vim_types": [ - { - "vim_type": "openstack", - "versions": [ - { - "version": "titanium_cloud", - "extra_info_hint": "" - }, - { - "version": "ocata", - "extra_info_hint": "" - } - ] - }, - { - "vim_type": "vmware", - "versions": [ - { - "version": "4.0", - "extra_info_hint": "" - } - ] - } - ] - } - + json_file = os.path.join(os.path.dirname(__file__), + '../pub/config/provider-plugin.json') + with open(json_file, "r") as f: + plugins = json.load(f) + data = {"vim_types": plugins} return Response(data=data, status=status.HTTP_200_OK)