Add Vim Constraint serializer 15/34215/1
authorfujinhua <fu.jinhua@zte.com.cn>
Tue, 6 Mar 2018 05:53:37 +0000 (13:53 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Tue, 6 Mar 2018 05:53:37 +0000 (13:53 +0800)
Change-Id: Ifcaed1e2e2924ea783a77cd2a3eb54872694528a
Issue-ID: VFC-779
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/v2/serializers.py

index 69721cd..2f7ae33 100644 (file)
@@ -110,6 +110,18 @@ class PlacementConstraintSerializer(serializers.Serializer):
     )
 
 
+class VimConstraintSerializer(serializers.Serializer):
+    sameResourceGroup = serializers.BooleanField(
+        help_text="Set to true when the constraint applies not only to the same VIM connection, but also to the same infrastructure resource group.",
+        required=False,
+        allow_null=True
+    )
+    resource = ConstraintResourceRefSerializer(
+        help_text="References to resources in the constraint rule.",
+        many=True
+    )
+
+
 class GrantRequestSerializer(serializers.Serializer):
     vnfInstanceId = serializers.CharField(
         help_text="Identifier of the VNF instance which this grant request is related to.",
@@ -168,6 +180,10 @@ class GrantRequestSerializer(serializers.Serializer):
         help_text="Placement constraints that the VNFM may send to the NFVO in order to influence the resource placement decision.",
         many=True
     )
+    vimConstraints = VimConstraintSerializer(
+        help_text="Used by the VNFM to require that multiple resources are managed through the same VIM connection.",
+        many=True
+    )
 
 
 class VimConnectionInfoSerializer(serializers.Serializer):