X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=catalog%2Fpackages%2Fserializers%2Fvnf_pkg_notifications.py;h=2a73aa3ab03ca554c2660401619959a0f91ceb51;hb=0409420992ea31df6cbaa28e5cbd0ff6ecd03b36;hp=ee2b99c9fd78bf56244a48d8b35eb9d2976afc3d;hpb=5fa8b56008a3fbbd8cecea19e68c47cb95473f78;p=modeling%2Fetsicatalog.git diff --git a/catalog/packages/serializers/vnf_pkg_notifications.py b/catalog/packages/serializers/vnf_pkg_notifications.py index ee2b99c..2a73aa3 100644 --- a/catalog/packages/serializers/vnf_pkg_notifications.py +++ b/catalog/packages/serializers/vnf_pkg_notifications.py @@ -77,7 +77,8 @@ class PkgmNotificationsFilter(serializers.Serializer): allow_null=False, required=False ) - vnfProductsFromProviders = vnfProductsProvidersSerializer( + vnfProductsFromProviders = serializers.ListField( + child=vnfProductsProvidersSerializer(), help_text="Match VNF packages that contain " "VNF products from certain providers.", allow_null=False, @@ -142,20 +143,17 @@ class PkgmLinksSerializer(serializers.Serializer): ) -class PkgNotificationSerializer(serializers.Serializer): +class PkgChangeNotificationSerializer(serializers.Serializer): id = serializers.CharField( help_text="Identifier of this notification.", required=True, allow_null=False ) - notificationTypes = serializers.ListField( - child=serializers.ChoiceField( - required=True, - choices=NOTIFICATION_TYPES - ), + notificationTypes = serializers.ChoiceField( help_text="Discriminator for the different notification types.", - allow_null=True, - required=False + choices=["VnfPackageChangeNotification"], + required=True, + allow_null=False ) subscriptionId = serializers.CharField( help_text="Identifier of the subscription that this notification relates to.", @@ -176,7 +174,7 @@ class PkgNotificationSerializer(serializers.Serializer): changeType = serializers.ChoiceField( help_text="The type of change of the VNF package.", choices=PackageChangeType, - required=False, + required=True, allow_null=False ) operationalState = serializers.ChoiceField( @@ -196,3 +194,38 @@ class PkgNotificationSerializer(serializers.Serializer): required=True, allow_null=False ) + + +class PkgOnboardingNotificationSerializer(serializers.Serializer): + id = serializers.CharField( + help_text="Identifier of this notification.", + required=True, + allow_null=False + ) + notificationTypes = serializers.ChoiceField( + help_text="Discriminator for the different notification types.", + choices=["VnfPackageOnboardingNotification"], + required=True, + allow_null=False + ) + subscriptionId = serializers.CharField( + help_text="Identifier of the subscription that this notification relates to.", + required=True, + allow_null=False + ) + vnfPkgId = serializers.UUIDField( + help_text="Identifier of the VNF package.", + required=True, + allow_null=False + ) + vnfdId = serializers.UUIDField( + help_text="This identifier, which is managed by the VNF provider, " + "identifies the VNF package and the VNFD in a globally unique way.", + required=True, + allow_null=False + ) + _links = PkgmLinksSerializer( + help_text="Links to resources related to this resource.", + required=True, + allow_null=False + )