Add AffectedVnfcSerializer of notify req 03/34703/1
authorfujinhua <fu.jinhua@zte.com.cn>
Thu, 8 Mar 2018 08:32:30 +0000 (16:32 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Thu, 8 Mar 2018 08:32:30 +0000 (16:32 +0800)
Change-Id: Ib94fd669b42d44369adc4a423d92d4d37414b747
Issue-ID: VFC-779
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/v2/serializers.py

index 1565b4f..ba465f2 100644 (file)
@@ -670,6 +670,50 @@ class GrantSerializer(serializers.Serializer):
     )
 
 
+class AffectedVnfcSerializer(serializers.Serializer):
+    id = serializers.CharField(
+        help_text="Identifier of the Vnfc instance.",
+        required=True
+    )
+    vduId = serializers.CharField(
+        help_text="Identifier of the related VDU in the VNFD.",
+        required=True
+    )
+    changeType = serializers.ChoiceField(
+        help_text="Signals the type of change.",
+        choices=["ADDED", "REMOVED", "MODIFIED", "TEMPORARY"],
+        required=True
+    )
+    computeResource = ResourceHandleSerializer(
+        help_text="Reference to the VirtualCompute resource.",
+        required=True
+    )
+    metadata = serializers.DictField(
+        help_text="Metadata about this resource.",
+        child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
+        required=False,
+        allow_null=True
+    )
+    affectedVnfcCpIds = serializers.ListSerializer(
+        help_text="Identifiers of CP(s) of the VNFC instance that were affected by the change.",
+        child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
+        required=False,
+        allow_null=True
+    )
+    addedStorageResourceIds = serializers.ListSerializer(
+        help_text="References to VirtualStorage resources that have been added.",
+        child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
+        required=False,
+        allow_null=True
+    )
+    removedStorageResourceIds = serializers.ListSerializer(
+        help_text="References to VirtualStorage resources that have been removed.",
+        child=serializers.CharField(help_text="Identifier In Vnf", allow_blank=True),
+        required=False,
+        allow_null=True
+    )
+
+
 class VnfLcmOperationOccurrenceNotificationSerializer(serializers.Serializer):
     id = serializers.CharField(
         help_text="Identifier of this notification.",
@@ -706,3 +750,11 @@ class VnfLcmOperationOccurrenceNotificationSerializer(serializers.Serializer):
         choices=["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "CHANGE_EXT_CONN", "MODIFY_INFO"],
         required=True
     )
+    isAutomaticInvocation = serializers.BooleanField(
+        help_text="Set to true if this VNF LCM operation occurrence has been triggered by an automated procedure inside the VNFM.",
+        required=True
+    )
+    vnfLcmOpOccId = serializers.CharField(
+        help_text="The identifier of the VNF lifecycle management operation occurrence associated to the notification.",
+        required=True
+    )