Change-Id: I8d1d641fa8e259b74b5cf109b67c61985525b0cc
Issue-ID: VFC-456
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
import logging
import traceback
import logging
import traceback
-from rest_framework.views import APIView
-from rest_framework.response import Response
from rest_framework import status
from rest_framework import status
-from lcm.pub.database import models
-
+from rest_framework.response import Response
+from rest_framework.views import APIView
logger = logging.getLogger(__name__)
logger = logging.getLogger(__name__)
logger.debug("get")
return Response({"status": "active"})
logger.debug("get")
return Response({"status": "active"})
class TablesList(APIView):
def delete(self, request, modelName):
logger.debug("Start delete model %s", modelName)
class TablesList(APIView):
def delete(self, request, modelName):
logger.debug("Start delete model %s", modelName)
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data={}, status=status.HTTP_204_NO_CONTENT)
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data={}, status=status.HTTP_204_NO_CONTENT)
def get(self, request, modelName):
logger.debug("Get model %s", modelName)
count = 0
def get(self, request, modelName):
logger.debug("Get model %s", modelName)
count = 0
return Response(data={"error": "failed"},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data={"count": count}, status=status.HTTP_200_OK)
return Response(data={"error": "failed"},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data={"count": count}, status=status.HTTP_200_OK)
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import unittest
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import unittest
from django.test import Client
from rest_framework import status
from django.test import Client
from rest_framework import status
import json
import logging
import os
import json
import logging
import os
-from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.views import APIView
logger = logging.getLogger(__name__)
class SwaggerJsonView(APIView):
def get(self, request):
logger = logging.getLogger(__name__)
class SwaggerJsonView(APIView):
def get(self, request):
json_file = os.path.join(os.path.dirname(__file__), 'vfc.nslcm.swagger.json')
f = open(json_file)
json_data = json.JSONDecoder().decode(f.read())
json_file = os.path.join(os.path.dirname(__file__), 'vfc.nslcm.swagger.json')
f = open(json_file)
json_data = json.JSONDecoder().decode(f.read())
json_data["paths"].update(json_data_temp["paths"])
json_data["definitions"].update(json_data_temp["definitions"])
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__), 'vfc.sfclcm.swagger.json')
f = open(json_file)
json_data_temp = json.JSONDecoder().decode(f.read())
json_file = os.path.join(os.path.dirname(__file__), 'vfc.sfclcm.swagger.json')
f = open(json_file)
json_data_temp = json.JSONDecoder().decode(f.read())
json_data["paths"].update(json_data_temp["paths"])
json_data["definitions"].update(json_data_temp["definitions"])
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__), 'vfc.others.swagger.json')
f = open(json_file)
json_data_temp = json.JSONDecoder().decode(f.read())
f.close()
json_file = os.path.join(os.path.dirname(__file__), 'vfc.others.swagger.json')
f = open(json_file)
json_data_temp = json.JSONDecoder().decode(f.read())
f.close()
- json_data_jobtemp=json_data["paths"]["/jobs/{jobId}"]
+ json_data_jobtemp = json_data["paths"]["/jobs/{jobId}"]
json_data["paths"].update(json_data_temp["paths"])
json_data["paths"]["/jobs/{jobId}"].update(json_data_jobtemp)
json_data["definitions"].update(json_data_temp["definitions"])
json_data["paths"].update(json_data_temp["paths"])
json_data["paths"]["/jobs/{jobId}"].update(json_data_jobtemp)
json_data["definitions"].update(json_data_temp["definitions"])
return Response(json_data)
return Response(json_data)