aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-02-28 11:30:40 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-02-28 11:30:40 +0800
commitcff071f283900422bcd797a21440705de9d2ff53 (patch)
tree373c602cae3279b6e85e5130aeb30a49a198a710
parent343b3a953f44e03675f7ed55e3f1d4fad240e029 (diff)
Add GrantInfo serializer
Change-Id: I6e01e9761cdb9f6e44d7e205da537524696297ec Issue-ID: VFC-779 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/v2/serializers.py73
1 files changed, 72 insertions, 1 deletions
diff --git a/lcm/v2/serializers.py b/lcm/v2/serializers.py
index e74f7368..8fbf3033 100644
--- a/lcm/v2/serializers.py
+++ b/lcm/v2/serializers.py
@@ -116,6 +116,43 @@ class ZoneGroupInfoSerializer(serializers.Serializer):
)
+class GrantInfoSerializer(serializers.Serializer):
+ resourceDefinitionId = serializers.CharField(
+ help_text="Identifier of the related ResourceDefinition from the related GrantRequest.",
+ required=True
+ )
+ reservationId = serializers.CharField(
+ help_text="The reservation identifier applicable to the VNFC/VirtualLink/VirtualStorage.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+ vimConnectionId = serializers.CharField(
+ help_text="Identifier of the VIM connection to be used to manage this resource.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+ resourceProviderId = serializers.CharField(
+ help_text="Identifies the entity responsible for the management of the virtualised resource.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+ zoneId = serializers.CharField(
+ help_text="Reference to the identifier of the ZoneInfo in the Grant.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+ resourceGroupId = serializers.CharField(
+ help_text="Identifier of the infrastructure resource group.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+
+
class GrantSerializer(serializers.Serializer):
id = serializers.CharField(
help_text="Identifier of the grant.",
@@ -140,6 +177,40 @@ class GrantSerializer(serializers.Serializer):
many=True
)
zoneGroups = ZoneGroupInfoSerializer(
- help_text="Information about groups of resource zones",
+ help_text="Information about groups of resource zones.",
+ many=True
+ )
+ computeReservationId = serializers.CharField(
+ help_text="Information that identifies a reservation applicable to the compute resource requirements.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+ networkReservationId = serializers.CharField(
+ help_text="Information that identifies a reservation applicable to the network resource requirements.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+ storageReservationId = serializers.CharField(
+ help_text="Information that identifies a reservation applicable to the storage resource requirements.",
+ required=False,
+ allow_null=True,
+ allow_blank=True
+ )
+ addResources = GrantInfoSerializer(
+ help_text="List of resources that are approved to be added.",
+ many=True
+ )
+ tempResources = GrantInfoSerializer(
+ help_text="List of resources that are approved to be temporarily instantiated during the runtime of the lifecycle operation.",
+ many=True
+ )
+ removeResources = GrantInfoSerializer(
+ help_text="List of resources that are approved to be removed.",
+ many=True
+ )
+ updateResources = GrantInfoSerializer(
+ help_text="List of resources that are approved to be modified.",
many=True
)