Add AffectedVirtrualLinksSerializer of notify req 71/35371/2
authorfujinhua <fu.jinhua@zte.com.cn>
Tue, 13 Mar 2018 06:01:17 +0000 (14:01 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Tue, 13 Mar 2018 06:10:54 +0000 (14:10 +0800)
Change-Id: If0287516d884385c15420dd235f243d6f993a2a3
Issue-ID: VFC-779
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/v2/serializers.py
lcm/v2/views.py

index ba465f2..83cb645 100644 (file)
@@ -714,6 +714,33 @@ class AffectedVnfcSerializer(serializers.Serializer):
     )
 
 
+class AffectedVirtualLinkSerializer(serializers.Serializer):
+    id = serializers.CharField(
+        help_text="Identifier of the virtual link instance.",
+        required=True
+    )
+    virtualLinkDescId = serializers.CharField(
+        help_text="Identifier of the related VLD in the VNFD.",
+        required=True
+    )
+    changeType = serializers.ChoiceField(
+        help_text="Signals the type of change.",
+        choices=["ADDED", "REMOVED", "MODIFIED", "TEMPORARY", "LINK_PORT_ADDED", "LINK_PORT_REMOVED"],
+        required=True
+    )
+    networkResource = ResourceHandleSerializer(
+        help_text="Reference to the VirtualNetwork resource.",
+        required=False,
+        allow_null=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
+    )
+
+
 class VnfLcmOperationOccurrenceNotificationSerializer(serializers.Serializer):
     id = serializers.CharField(
         help_text="Identifier of this notification.",
@@ -758,3 +785,13 @@ class VnfLcmOperationOccurrenceNotificationSerializer(serializers.Serializer):
         help_text="The identifier of the VNF lifecycle management operation occurrence associated to the notification.",
         required=True
     )
+    affectedVnfcs = AffectedVnfcSerializer(
+        help_text="Information about VNFC instances that were affected during the lifecycle operation.",
+        many=True,
+        required=False
+    )
+    affectedVirtualLinks = AffectedVirtualLinkSerializer(
+        help_text="Information about VL instances that were affected during the lifecycle operation.",
+        many=True,
+        required=False
+    )
index c35ab01..9f7fe03 100644 (file)
@@ -57,8 +57,9 @@ class VnfGrantView(APIView):
 
 
 class VnfNotifyView(APIView):
-    def post(self, request):
+    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)
 
     def get(self, request):