summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2018-01-23 17:36:56 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2018-01-23 17:36:56 +0800
commit74b380a68330962c078eb3c5fecfd5e4430ca556 (patch)
treecbbabad725821e232193f0f34d7a1c3cab0a7b32
parentda0e046eb6dcd214bd19a867543ecbaf0db8f076 (diff)
Modify vfc-vnfmgr response status
Change-Id: Iea9417e290d4c198c15db155e5cfd6b94a063d7e Issue-ID: VFC-670 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--mgr/mgr/vnfreg/views.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/mgr/mgr/vnfreg/views.py b/mgr/mgr/vnfreg/views.py
index 7524dcf..45c3034 100644
--- a/mgr/mgr/vnfreg/views.py
+++ b/mgr/mgr/vnfreg/views.py
@@ -44,8 +44,8 @@ def handler_exception(e):
class vnfmgr_addvnf(APIView):
@swagger_auto_schema(request_body=VnfInfoSerializer(),
responses={
- 201: ResponseSerializer(),
- 500: ErrorSerializer()})
+ status.HTTP_201_CREATED: ResponseSerializer(),
+ status.HTTP_500_INTERNAL_SERVER_ERROR: ErrorSerializer()})
def post(self, request):
logger.info("Enter %s, data is %s", fun_name(), request.data)
requestSerializer = VnfInfoSerializer(data=request.data)
@@ -79,12 +79,12 @@ class vnfmgr_addvnf(APIView):
@swagger_auto_schema(method='put',
request_body=VnfInfoSerializer(),
responses={
- 202: NoneSerializer(),
- 500: ErrorSerializer()})
+ status.HTTP_202_ACCEPTED: NoneSerializer(),
+ status.HTTP_500_INTERNAL_SERVER_ERROR: ErrorSerializer()})
@swagger_auto_schema(method='delete',
responses={
- 204: NoneSerializer(),
- 500: ErrorSerializer()})
+ status.HTTP_204_NO_CONTENT: NoneSerializer(),
+ status.HTTP_500_INTERNAL_SERVER_ERROR: ErrorSerializer()})
@swagger_auto_schema(methods=['get'],
manual_parameters=[
openapi.Parameter('test',
@@ -93,8 +93,8 @@ class vnfmgr_addvnf(APIView):
type=openapi.TYPE_BOOLEAN
), ],
responses={
- 200: openapi.Response('response description', VnfInfoSerializer()),
- 500: ErrorSerializer()})
+ status.HTTP_200_OK: openapi.Response('response description', VnfInfoSerializer()),
+ status.HTTP_500_INTERNAL_SERVER_ERROR: ErrorSerializer()})
@api_view(http_method_names=['GET', 'PUT', 'DELETE'])
def access_vnf(request, *args, **kwargs):
requestSerializer = VnfInfoSerializer(data=request.data)
@@ -153,8 +153,8 @@ def access_vnf(request, *args, **kwargs):
@swagger_auto_schema(method='post',
request_body=VnfConfigSerializer(),
responses={
- 202: NoneSerializer(),
- 500: ErrorSerializer()})
+ status.HTTP_202_ACCEPTED: NoneSerializer(),
+ status.HTTP_500_INTERNAL_SERVER_ERROR: ErrorSerializer()})
@api_view(http_method_names=['POST'])
def vnf_config(request, *args, **kwargs):
logger.info("Enter %s, data is %s", fun_name(), request.data)