diff options
author | 2018-03-14 15:55:47 +0800 | |
---|---|---|
committer | 2018-03-14 15:55:47 +0800 | |
commit | 6bbdc4bb10886da27edb2d727ce5ff53bfa97083 (patch) | |
tree | 3953140bb9bcfbe16b2283b685ba8a4457c6704f | |
parent | 3281e5b754835c3cdb94057405723f11e7dfd28a (diff) |
Add swagger generate logic of vnf notify
Change-Id: Ia2f1bb5932f9d40af794d8709530401e2aad7215
Issue-ID: VFC-779
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r-- | lcm/v2/views.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lcm/v2/views.py b/lcm/v2/views.py index 9f7fe030..24902a18 100644 --- a/lcm/v2/views.py +++ b/lcm/v2/views.py @@ -21,6 +21,7 @@ from drf_yasg.utils import swagger_auto_schema from lcm.v2.serializers import GrantRequestSerializer from lcm.v2.serializers import GrantSerializer +from lcm.v2.serializers import VnfLcmOperationOccurrenceNotificationSerializer from lcm.v2.grant_vnf import GrantVnf logger = logging.getLogger(__name__) @@ -57,11 +58,27 @@ class VnfGrantView(APIView): class VnfNotifyView(APIView): + @swagger_auto_schema( + request_body=VnfLcmOperationOccurrenceNotificationSerializer( + help_text="A notification about lifecycle changes triggered by a VNF LCM operation occurrence." + ), + responses={ + status.HTTP_204_NO_CONTENT: "The notification was delivered successfully.", + status.HTTP_500_INTERNAL_SERVER_ERROR: "Inner error" + } + ) def post(self, request, vnfmId, vnfInstanceId): logger.debug("VnfNotifyView post: %s" % request.data) logger.debug("vnfmId: %s vnfInstanceId: %s", vnfmId, vnfInstanceId) return Response(data={}, status=status.HTTP_204_NO_CONTENT) + @swagger_auto_schema( + request_body=None, + responses={ + status.HTTP_204_NO_CONTENT: "The notification endpoint was tested successfully.", + status.HTTP_500_INTERNAL_SERVER_ERROR: "Inner error" + } + ) def get(self, request): logger.debug("VnfNotifyView get") return Response(data={}, status=status.HTTP_204_NO_CONTENT) |