Add Resource Serializer of Grant Req 95/33995/1
authorfujinhua <fu.jinhua@zte.com.cn>
Mon, 5 Mar 2018 07:50:46 +0000 (15:50 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Mon, 5 Mar 2018 07:50:46 +0000 (15:50 +0800)
Change-Id: I5427a57595b6008985c20519f41ab30155826b56
Issue-ID: VFC-779
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/v2/serializers.py

index 6140f18..d8efb3e 100644 (file)
 from rest_framework import serializers
 
 
+class ResourceDefinitionSerializer(serializers.Serializer):
+    id = serializers.CharField(
+        help_text="Identifier of this ResourceDefinition, unique at least within the scope of the GrantRequest.",
+        required=True
+    )
+    type = serializers.ChoiceField(
+        help_text="Type of the resource definition referenced.",
+        choices=["COMPUTE", "VL", "STORAGE", "LINKPORT"],
+        required=True
+    )
+    vduId = serializers.CharField(
+        help_text="Reference to the related VDU in the VNFD applicable to this resource.",
+        required=False,
+        allow_null=True,
+        allow_blank=True
+    )
+    resourceTemplateId = serializers.CharField(
+        help_text="Reference to a resource template(such as VnfVirtualLinkDesc) in the VNFD.",
+        required=False,
+        allow_null=True,
+        allow_blank=True
+    )
+
+
 class GrantRequestSerializer(serializers.Serializer):
     vnfInstanceId = serializers.CharField(
         help_text="Identifier of the VNF instance which this grant request is related to.",
@@ -43,6 +67,16 @@ class GrantRequestSerializer(serializers.Serializer):
         choices=["INSTANTIATE", "SCALE", "SCALE_TO_LEVEL", "CHANGE_FLAVOUR", "TERMINATE", "HEAL", "OPERATE", "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, set to false otherwise.",
+        required=True
+    )
+    instantiationLevelId = serializers.CharField(
+        help_text="If operation=INSTANTIATE, the identifier of the instantiation level may be provided as an alternative way to define the resources to be added.",
+        required=False,
+        allow_null=True,
+        allow_blank=True
+    )
 
 
 class VimConnectionInfoSerializer(serializers.Serializer):