aboutsummaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authormaopengzhang <zhang.maopeng1@zte.com.cn>2019-04-02 19:11:27 +0800
committermaopengzhang <zhang.maopeng1@zte.com.cn>2019-04-02 19:29:46 +0800
commit5c90e87e9e3a9c9dd95a9f08c813974e387fe55c (patch)
treeb1a9fb4b852b72c930e178a61b421a221676ded1 /lcm
parent6719ad8ad6fbc2ff5910589761c58c3b1bb53e51 (diff)
fix NS instantiation serializer error
fix NS instantiation serializer error Change-Id: I01fea83f0f2afb5e3413e3168d7abf2c6ce4dfbb Issue-ID: VFC-1214 Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/ns/serializers/sol/inst_ns_serializers.py116
1 files changed, 70 insertions, 46 deletions
diff --git a/lcm/ns/serializers/sol/inst_ns_serializers.py b/lcm/ns/serializers/sol/inst_ns_serializers.py
index fd64a00b..bb5c600a 100644
--- a/lcm/ns/serializers/sol/inst_ns_serializers.py
+++ b/lcm/ns/serializers/sol/inst_ns_serializers.py
@@ -1,4 +1,5 @@
# Copyright (c) 2018, CMCC Technologies Co., Ltd.
+# Copyright 2019 ZTE Corporation.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,69 +20,92 @@ from lcm.ns.serializers.sol.update_serializers import AddPnfDataSerializer, VnfI
class civicAddressElementSerializer(serializers.Serializer):
- caType = serializers.CharField(help_text="Describe the content type of caValue.", required=True)
- caValue = serializers.CharField(help_text="Content of civic address element corresponding to the"
- "aType.", required=True)
+ caType = serializers.CharField(
+ help_text="Describe the content type of caValue.",
+ required=True)
+ caValue = serializers.CharField(
+ help_text="Content of civic address element corresponding to the caType.",
+ required=True)
class LocationConstraintsSerializer(serializers.Serializer):
- countryCode = serializers.CharField(help_text="The two-letter ISO 3166 [29] country code in capital"
- "letters.", required=True)
- civicAddressElement = civicAddressElementSerializer(help_text="Zero or more elements comprising the civic"
- "address.",
- required=False, allow_null=True, many=True)
+ countryCode = serializers.CharField(
+ help_text="The two-letter ISO 3166 [29] country code in capital letters.",
+ required=True)
+ civicAddressElement = civicAddressElementSerializer(
+ help_text="Zero or more elements comprising the civic address.",
+ required=False,
+ many=True)
class VnfLocationConstraintSerializer(serializers.Serializer):
- vnfProfileId = serializers.CharField(help_text="ID of VNF profile", required=False, allow_null=True)
- locationConstraints = LocationConstraintsSerializer(help_text="Defines the location constraints for the"
- "VNF instance to be created based on the"
- "VNF profile.",
- required=False, allow_null=True)
+ vnfProfileId = serializers.CharField(
+ help_text="Identifier (reference to) of a VnfProfile in the NSD used to manage the lifecycle of the VNF instance.",
+ required=True)
+ locationConstraints = LocationConstraintsSerializer(
+ help_text="Defines the location constraints for the VNF instance to be created based on the VNF profile.",
+ required=True)
class ParamsForVnfSerializer(serializers.Serializer):
- vnfProfileId = serializers.CharField(help_text="Identifier of (reference to) a vnfProfile to which the"
- "additional parameters apply", required=True)
- additionalParams = serializers.DictField(help_text="Content of civic address element corresponding to the"
- "caType",
- child=serializers.CharField(help_text="KeyValue Pairs",
- allow_blank=True),
- required=False, allow_null=True)
+ vnfProfileId = serializers.CharField(
+ help_text="Identifier of (reference to) a vnfProfile to which the additional parameters apply.",
+ required=True)
+ additionalParams = serializers.DictField(
+ help_text="Additional parameters that are applied for the VNF instance to be created.",
+ required=False)
+
+
+class NestedNsInstanceDataSerializer(serializers.Serializer):
+ nestedNsInstanceId = serializers.CharField(
+ help_text="Identifier of the existing nested NS instance to be used in the NS.",
+ required=True)
+ nsProfileId = serializers.CharField(
+ help_text="Identifier of an NsProfile defined in the NSD which the existing nested NS instance shall be matched with.",
+ required=True)
class InstantNsReqSerializer(serializers.Serializer):
- nsFlavourId = serializers.CharField(help_text="Identifier of the NS deployment flavour to be"
- "instantiated.", required=True)
- sapData = SapDataSerializer(help_text="Create data concerning the SAPs of this NS",
- required=False, allow_null=True, many=True)
- addpnfData = AddPnfDataSerializer(help_text="Information on the PNF(s) that are part of this NS.",
- required=False, allow_null=True, many=True)
- vnfInstanceData = VnfInstanceDataSerializer(help_text="Specify an existing VNF instance to be used in "
- "the NS.",
- required=False, allow_null=True, many=True)
- nestedNsInstanceId = serializers.ListField(help_text="Specify an existing NS instance to be used as a "
- "nested NS within the NS",
- required=False, allow_null=True)
- localizationLanguage = VnfLocationConstraintSerializer(help_text="Defines the location constraints for "
- "the VNF to be instantiated as part of"
- " the NS instantiation.",
- required=False, allow_null=True, many=True)
+ nsFlavourId = serializers.CharField(
+ help_text="Identifier of the NS deployment flavour to be instantiated.",
+ required=True)
+ sapData = SapDataSerializer(
+ help_text="Create data concerning the SAPs of this NS",
+ required=False,
+ many=True)
+ addpnfData = AddPnfDataSerializer(
+ help_text="Information on the PNF(s) that are part of this NS.",
+ required=False,
+ many=True)
+ vnfInstanceData = VnfInstanceDataSerializer(
+ help_text="Specify an existing VNF instance to be used in the NS.",
+ required=False,
+ many=True)
+ nestedNsInstanceData = NestedNsInstanceDataSerializer(
+ help_text="Specify an existing NS instance to be used as a nested NS within the NS",
+ required=False,
+ many=True)
+ localizationLanguage = VnfLocationConstraintSerializer(
+ help_text="Defines the location constraints for the VNF to be instantiated as part of the NS instantiation.",
+ required=False,
+ many=True)
additionalParamForNs = serializers.DictField(
help_text="Allows the OSS/BSS to provide additional parameters at the NS level ",
- child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
required=False,
allow_null=True
)
- additionalParamsForVnf = ParamsForVnfSerializer(help_text="Allows the OSS/BSS to provide additional "
- "parameter(s)per VNF instance",
- required=False, allow_null=True, many=True)
- startTime = serializers.DateTimeField(help_text="Timestamp indicating the earliest time to instantiate"
- "the NS.", required=False, allow_null=True)
- nsInstantiationLevelId = serializers.CharField(help_text="Identifies one of the NS instantiation levels"
- "declared in the DF applicable to this NS "
- "instance", required=False, allow_null=True)
+ additionalParamsForVnf = ParamsForVnfSerializer(
+ help_text="Allows the OSS/BSS to provide additional parameter(s)per VNF instance",
+ required=False,
+ many=True)
+ startTime = serializers.DateTimeField(
+ help_text="Timestamp indicating the earliest time to instantiate the NS.",
+ required=False)
+ nsInstantiationLevelId = serializers.CharField(
+ help_text="Identifies one of the NS instantiation levels declared in the DF applicable to this NS instance",
+ required=False)
additionalAffinityOrAntiAffiniityRule = AffinityOrAntiAffinityRuleSerializer(
help_text="Specifies additional affinity or anti-affinity constraint for the VNF instances to be"
" instantiated as part of the NS instantiation.",
- required=False, allow_null=True, many=True)
+ required=False,
+ many=True)