aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-03-05 15:50:46 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-03-05 15:50:46 +0800
commitdd6460c0671e16dce4ce15a7e424918ca758c79b (patch)
tree5b4c9dd6bffe957d6c45379e5331c3fcb93ed72e
parent8604bff377a5532d718e608f440cc0bd4ef7551e (diff)
Add Resource Serializer of Grant Req
Change-Id: I5427a57595b6008985c20519f41ab30155826b56 Issue-ID: VFC-779 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/v2/serializers.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/lcm/v2/serializers.py b/lcm/v2/serializers.py
index 6140f183..d8efb3e1 100644
--- a/lcm/v2/serializers.py
+++ b/lcm/v2/serializers.py
@@ -15,6 +15,30 @@
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):