diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/res/resources/serializers.py | 26 | ||||
-rw-r--r-- | res/res/resources/views.py | 22 |
2 files changed, 11 insertions, 37 deletions
diff --git a/res/res/resources/serializers.py b/res/res/resources/serializers.py index 774d62c..aaf7598 100644 --- a/res/res/resources/serializers.py +++ b/res/res/resources/serializers.py @@ -15,21 +15,6 @@ from rest_framework import serializers -class NoneSerializer(serializers.Serializer): - pass - - -# { -# "resp_data": [{ -# "cpinstanceid": "cp0", -# "cpdid": "cpd0", -# "cpinstancename": "cpinstname0", -# "vlinstanceid": "vlinst0", -# "ownertype": 0, -# "ownerid": "01", -# "relatedtype": 0 -# }] -# } class CpsResponseSerializer(serializers.Serializer): cpinstanceid = serializers.CharField(help_text="the cp instance id", required=True) cpdid = serializers.CharField(help_text="the cpd id", required=True) @@ -44,17 +29,6 @@ class CpsInfoSerializer(serializers.Serializer): resp_data = CpsResponseSerializer(help_text="the response data", many=True) -# { -# "resp_data": [{ -# "storageid": "st0", -# "vimid": "vim0", -# "resouceid": "res0", -# "insttype": 0, -# "instid": "01", -# "storagetype": "stype0", -# "size": "0" -# }] -# } class VolumeResponseSerializer(serializers.Serializer): storageid = serializers.CharField(help_text="the storage id", required=True) vimid = serializers.CharField(help_text="the vim id", required=True) diff --git a/res/res/resources/views.py b/res/res/resources/views.py index 70c38b3..dfecd87 100644 --- a/res/res/resources/views.py +++ b/res/res/resources/views.py @@ -26,7 +26,7 @@ from res.pub.database.models import NfInstModel, StorageInstModel, NetworkInstMo from res.pub.exceptions import VNFRESException from res.pub.utils.syscomm import fun_name from res.pub.utils.values import ignore_case_get -from res.resources.serializers import VolumeInfoSerializer, NoneSerializer, CpsInfoSerializer +from res.resources.serializers import VolumeInfoSerializer, CpsInfoSerializer logger = logging.getLogger(__name__) @@ -309,11 +309,11 @@ def fill_subnets_data(subnet): class getCps(APIView): - @swagger_auto_schema(request_body=NoneSerializer(), - responses={ - status.HTTP_200_OK: CpsInfoSerializer(), - status.HTTP_404_NOT_FOUND: 'Cps does not exist', - status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'}) + @swagger_auto_schema( + responses={ + status.HTTP_200_OK: CpsInfoSerializer(), + status.HTTP_404_NOT_FOUND: 'Cps does not exist', + status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'}) def get(self, request, vnfInstanceId): logger.debug("Query all the cps by vnfInstanceId[%s]", fun_name()) try: @@ -349,11 +349,11 @@ def fill_cps_data(cp): class getVolumes(APIView): - @swagger_auto_schema(request_body=NoneSerializer(), - responses={ - status.HTTP_200_OK: VolumeInfoSerializer(), - status.HTTP_404_NOT_FOUND: 'Volumes does not exist', - status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'}) + @swagger_auto_schema( + responses={ + status.HTTP_200_OK: VolumeInfoSerializer(), + status.HTTP_404_NOT_FOUND: 'Volumes does not exist', + status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'}) def get(self, request, vnfInstanceId): logger.debug("Query all the volumes by vnfInstanceId[%s]", fun_name()) try: |