summaryrefslogtreecommitdiffstats
path: root/mgr
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-02-01 09:22:41 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-02-01 09:22:41 +0800
commit61b6d35a774b5b5feeb9cf575e4a5f37ce8161ef (patch)
tree51e5bb1057156aa5942ee5eab184a5c1013adeb5 /mgr
parente9d457c824312457fc45b1c28e4673a56a343801 (diff)
Refactor vfc-vnfmgr schema and code
Change-Id: I78f7eba12a4fa655dff566bab258521baad6c444 Issue-ID: VFC-670 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'mgr')
-rw-r--r--mgr/mgr/vnfreg/serializers.py4
-rw-r--r--mgr/mgr/vnfreg/views.py8
2 files changed, 4 insertions, 8 deletions
diff --git a/mgr/mgr/vnfreg/serializers.py b/mgr/mgr/vnfreg/serializers.py
index 5a962dd..e49f7b4 100644
--- a/mgr/mgr/vnfreg/serializers.py
+++ b/mgr/mgr/vnfreg/serializers.py
@@ -31,10 +31,6 @@ class ResponseSerializer(serializers.Serializer):
help_text="the instance id of vnf", required=True)
-class NoneSerializer(serializers.Serializer):
- pass
-
-
class CpSerializer(serializers.Serializer):
cpId = serializers.CharField(help_text="the cps id of vnf", required=True)
cpdId = serializers.CharField(
diff --git a/mgr/mgr/vnfreg/views.py b/mgr/mgr/vnfreg/views.py
index 38b8bed..9466ebe 100644
--- a/mgr/mgr/vnfreg/views.py
+++ b/mgr/mgr/vnfreg/views.py
@@ -27,7 +27,7 @@ from mgr.pub.database.models import VnfRegModel
from mgr.pub.utils import restcall
from mgr.pub.utils.syscomm import fun_name
from mgr.pub.utils.values import ignore_case_get
-from mgr.vnfreg.serializers import VnfInfoSerializer, ResponseSerializer, NoneSerializer, VnfConfigSerializer
+from mgr.vnfreg.serializers import VnfInfoSerializer, ResponseSerializer, VnfConfigSerializer
logger = logging.getLogger(__name__)
@@ -71,11 +71,11 @@ class vnfmgr_addvnf(APIView):
@swagger_auto_schema(method='put',
request_body=VnfInfoSerializer(),
responses={
- status.HTTP_202_ACCEPTED: NoneSerializer(),
+ status.HTTP_202_ACCEPTED: 'successfully',
status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'})
@swagger_auto_schema(method='delete',
responses={
- status.HTTP_204_NO_CONTENT: NoneSerializer(),
+ status.HTTP_204_NO_CONTENT: 'successfully',
status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'})
@swagger_auto_schema(methods=['get'],
manual_parameters=[
@@ -146,7 +146,7 @@ def access_vnf(request, *args, **kwargs):
@swagger_auto_schema(method='post',
request_body=VnfConfigSerializer(),
responses={
- status.HTTP_202_ACCEPTED: NoneSerializer(),
+ status.HTTP_202_ACCEPTED: 'successfully',
status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'})
@api_view(http_method_names=['POST'])
def vnf_config(request, *args, **kwargs):