diff options
author | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-12-12 11:41:20 +0800 |
---|---|---|
committer | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-12-12 11:44:07 +0800 |
commit | 5f632e314dcb48bcf30596ef2a2c0af60e836c3c (patch) | |
tree | 975461411f26c483bd1b3e01223dc947d018e67c /catalog/packages/views/vnf_package_subscription_views.py | |
parent | 5fa8b56008a3fbbd8cecea19e68c47cb95473f78 (diff) |
Modify notification endpoint interface definition in swagger
Change-Id: I8b5bae05d5983dee0bb0ae01f7438094768b3def
Issue-ID: MODELING-288
Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
Diffstat (limited to 'catalog/packages/views/vnf_package_subscription_views.py')
-rw-r--r-- | catalog/packages/views/vnf_package_subscription_views.py | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/catalog/packages/views/vnf_package_subscription_views.py b/catalog/packages/views/vnf_package_subscription_views.py index 94977c3..6698429 100644 --- a/catalog/packages/views/vnf_package_subscription_views.py +++ b/catalog/packages/views/vnf_package_subscription_views.py @@ -13,7 +13,7 @@ # limitations under the License. import logging - +from drf_yasg import openapi from drf_yasg.utils import swagger_auto_schema from rest_framework import status from rest_framework.response import Response @@ -27,7 +27,8 @@ from catalog.packages.serializers.response import ProblemDetailsSerializer from catalog.packages.serializers.vnf_pkg_subscription import PkgmSubscriptionRequestSerializer from catalog.packages.serializers.vnf_pkg_subscription import PkgmSubscriptionSerializer from catalog.packages.serializers.vnf_pkg_subscription import PkgmSubscriptionsSerializer -from catalog.packages.serializers.vnf_pkg_notifications import PkgNotificationSerializer +from catalog.packages.serializers.vnf_pkg_notifications import PkgOnboardingNotificationSerializer +from catalog.packages.serializers.vnf_pkg_notifications import PkgChangeNotificationSerializer from catalog.packages.views.common import validate_data, validate_req_data from catalog.pub.exceptions import BadRequestException from catalog.pub.exceptions import VnfPkgSubscriptionException @@ -126,13 +127,45 @@ class QueryTerminateSubscriptionView(APIView): return Response(status=status.HTTP_204_NO_CONTENT) -class PkgnotifyView(APIView): +class PkgOnboardingNotificationView(APIView): @swagger_auto_schema( tags=[TAG_VNF_PACKAGE_API], - request_body=PkgNotificationSerializer, + request_body=PkgOnboardingNotificationSerializer, responses={ status.HTTP_204_NO_CONTENT: "" } ) def post(self): pass + + @swagger_auto_schema( + tags=[TAG_VNF_PACKAGE_API], + responses={ + status.HTTP_204_NO_CONTENT: "", + status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response('error message', + openapi.Schema(type=openapi.TYPE_STRING))} + ) + def get(self): + pass + + +class PkgChangeNotificationView(APIView): + @swagger_auto_schema( + tags=[TAG_VNF_PACKAGE_API], + request_body=PkgChangeNotificationSerializer, + responses={ + status.HTTP_204_NO_CONTENT: "" + } + ) + def post(self): + pass + + @swagger_auto_schema( + tags=[TAG_VNF_PACKAGE_API], + responses={ + status.HTTP_204_NO_CONTENT: "", + status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response('error message', + openapi.Schema(type=openapi.TYPE_STRING))} + ) + def get(self): + pass |