X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=lcm%2Flcm%2Fnf%2Fvnfs%2Fviews.py;h=495e782a54f9a4fa3353a0444b7cf26fbc269daa;hb=f18464b1f38ff751a7c12447fb8cf8d8c7b0c473;hp=1062d3a1e3b0bce422eb8ac6d23b040afc4ecb44;hpb=e4f53709988ef82a4afbb53bc34200755eb4a33b;p=vfc%2Fgvnfm%2Fvnflcm.git diff --git a/lcm/lcm/nf/vnfs/views.py b/lcm/lcm/nf/vnfs/views.py index 1062d3a1..495e782a 100644 --- a/lcm/lcm/nf/vnfs/views.py +++ b/lcm/lcm/nf/vnfs/views.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json import logging -import os import traceback from rest_framework import status @@ -34,7 +32,7 @@ logger = logging.getLogger(__name__) class CreateVnfAndQueryVnfs(APIView): def get(self, request): - logger.debug("QuerySingleVnf--get::> %s" % request.data) + logger.debug("QueryMultiVnf--get::> %s" % request.data) try: resp_data = QueryVnf(request.data).query_multi_vnf() except NFLCMException as e: @@ -56,7 +54,9 @@ class CreateVnfAndQueryVnfs(APIView): except Exception: logger.error(traceback.format_exc()) return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) - rsp = {"vnfInstanceId": nf_inst_id} + rsp = { + "vnfInstanceId": nf_inst_id + } return Response(data=rsp, status=status.HTTP_201_CREATED) @@ -73,7 +73,9 @@ class InstantiateVnf(APIView): except Exception: logger.error(traceback.format_exc()) return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) - rsp = {"jobId": job_id} + rsp = { + "jobId": job_id + } return Response(data=rsp, status=status.HTTP_202_ACCEPTED) @@ -117,14 +119,7 @@ class TerminateVnf(APIView): except Exception: logger.error(traceback.format_exc()) return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) - rsp = {"jobId": job_id} + rsp = { + "jobId": job_id + } return Response(data=rsp, status=status.HTTP_202_ACCEPTED) - - -class SwaggerJsonView(APIView): - def get(self, request): - json_file = os.path.join(os.path.dirname(__file__), 'swagger.json') - f = open(json_file) - json_data = json.JSONDecoder().decode(f.read()) - f.close() - return Response(json_data)