X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=multivimbroker%2Fmultivimbroker%2Fswagger%2Fviews.py;h=168259eccab3186d77c063d8c890590f98fb0038;hb=67430600410e312c2db5a6a7709da8e45a5245fa;hp=8e8a2bf75b3c50c436c3067efc35f51d3bee491c;hpb=b1b0386b5ed988fbbf25e326c3d0ce951eff07cd;p=multicloud%2Fframework.git diff --git a/multivimbroker/multivimbroker/swagger/views.py b/multivimbroker/multivimbroker/swagger/views.py index 8e8a2bf..168259e 100644 --- a/multivimbroker/multivimbroker/swagger/views.py +++ b/multivimbroker/multivimbroker/swagger/views.py @@ -12,76 +12,93 @@ import json import logging import os -import traceback +# import traceback -from rest_framework import status +# from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView -from multivimbroker.pub.exceptions import VimBrokerException +# from multivimbroker.pub.exceptions import VimBrokerException logger = logging.getLogger(__name__) class SwaggerJsonView(APIView): def get(self, request): - json_file = os.path.join(os.path.dirname(__file__), 'multivim.flavor.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.flavor.swagger.json') f = open(json_file) json_data = json.JSONDecoder().decode(f.read()) f.close() - json_file = os.path.join(os.path.dirname(__file__), 'multivim.image.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.image.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.network.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.network.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.subnet.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.subnet.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.server.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.server.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.volume.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.volume.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.vport.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.vport.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.tenant.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.tenant.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.host.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.host.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_file = os.path.join(os.path.dirname(__file__), 'multivim.limit.swagger.json') + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.limit.swagger.json') + f = open(json_file) + json_data_temp = json.JSONDecoder().decode(f.read()) + f.close() + json_data["paths"].update(json_data_temp["paths"]) + json_data["definitions"].update(json_data_temp["definitions"]) + # + json_file = os.path.join(os.path.dirname(__file__), + 'multivim.identity.swagger.json') f = open(json_file) json_data_temp = json.JSONDecoder().decode(f.read()) f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) return Response(json_data) -