diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2018-01-31 10:56:48 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2018-01-31 10:56:48 +0800 |
commit | df303570d4fcd8016cdb787a8586bc5a28faf908 (patch) | |
tree | b277ba1cec30e7b1304609cdd6e0b667c1e1a979 /lcm | |
parent | 607b3528fc1fae6517c875b3de9ef70250e31275 (diff) |
Add vfc-vnflcm deleteVnf auto-swagger
Change-Id: Ie1f5a61973479b105313e2bd556dd2902c9e0454
Issue-ID: VFC-682
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r-- | lcm/lcm/nf/vnfs/views.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lcm/lcm/nf/vnfs/views.py b/lcm/lcm/nf/vnfs/views.py index b114ee58..9f385a0f 100644 --- a/lcm/lcm/nf/vnfs/views.py +++ b/lcm/lcm/nf/vnfs/views.py @@ -152,10 +152,18 @@ class DeleteVnfAndQueryVnf(APIView): return Response(data={'error': 'Failed to get Vnf(%s)' % instanceid}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + @swagger_auto_schema( + responses={ + status.HTTP_204_NO_CONTENT: "Successfully", + status.HTTP_500_INTERNAL_SERVER_ERROR: "Internal error" + } + ) def delete(self, request, instanceid): logger.debug("DeleteVnfIdentifier--delete::> %s" % request.data) try: DeleteVnf(request.data, instanceid).do_biz() + + return Response(data=None, status=status.HTTP_204_NO_CONTENT) except NFLCMException as e: logger.error(e.message) return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) @@ -163,7 +171,6 @@ class DeleteVnfAndQueryVnf(APIView): logger.error(e.message) logger.error(traceback.format_exc()) return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) - return Response(data=None, status=status.HTTP_204_NO_CONTENT) class TerminateVnf(APIView): |