X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=catalog%2Fpackages%2Fviews%2Fvnf_package_subscription_views.py;h=6698429ebc93bcb66da3f307d8cf4fe2c2594cd3;hb=5f632e314dcb48bcf30596ef2a2c0af60e836c3c;hp=94977c3bedff4582e3f88d77c0c06d2c52fbdf0b;hpb=5fa8b56008a3fbbd8cecea19e68c47cb95473f78;p=modeling%2Fetsicatalog.git 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