aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lcm/ns/serializers/sol/heal_serializers.py68
-rw-r--r--lcm/ns/serializers/sol/inst_ns_serializers.py116
2 files changed, 115 insertions, 69 deletions
diff --git a/lcm/ns/serializers/sol/heal_serializers.py b/lcm/ns/serializers/sol/heal_serializers.py
index a935fded..a699056f 100644
--- a/lcm/ns/serializers/sol/heal_serializers.py
+++ b/lcm/ns/serializers/sol/heal_serializers.py
@@ -1,4 +1,5 @@
# Copyright (c) 2019, 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.
@@ -15,39 +16,60 @@
from rest_framework import serializers
-class ActionVmSerializer(serializers.Serializer):
- vmid = serializers.CharField(help_text="ID of VM", required=False, allow_null=True, allow_blank=True)
- vduid = serializers.CharField(help_text="ID of vdu", required=False, allow_null=True, allow_blank=True)
- vmname = serializers.CharField(help_text="Name of VM", required=False, allow_null=True, allow_blank=True)
+# class ActionVmSerializer(serializers.Serializer):
+# vmid = serializers.CharField(help_text="ID of VM", required=False, allow_null=True, allow_blank=True)
+# vduid = serializers.CharField(help_text="ID of vdu", required=False, allow_null=True, allow_blank=True)
+# vmname = serializers.CharField(help_text="Name of VM", required=False, allow_null=True, allow_blank=True)
-class HealNsAdditionalParamsSerializer(serializers.Serializer):
- action = serializers.CharField(help_text="Action of NS heal", required=False, allow_null=True, allow_blank=True)
- actionvminfo = ActionVmSerializer(help_text="VM info of action", required=False, allow_null=True)
+# class HealNsAdditionalParamsSerializer(serializers.Serializer):
+# action = serializers.CharField(help_text="Action of NS heal", required=False, allow_null=True, allow_blank=True)
+# actionvminfo = ActionVmSerializer(help_text="VM info of action", required=False, allow_null=True)
class HealVnfDataSerializer(serializers.Serializer):
- vnfInstanceId = serializers.CharField(help_text="Identifies the VNF instance,", required=True)
- cause = serializers.CharField(help_text="Indicates the reason why a healing procedure is required",
- required=False, allow_null=True, allow_blank=True)
- additionalParams = serializers.DictField(help_text="Additional parameters passed by the NFVO as input to "
- "the healing process",
- child=HealNsAdditionalParamsSerializer(
- help_text="KeyValue Pairs"), required=False, allow_null=True)
+ vnfInstanceId = serializers.CharField(
+ help_text="Identifies the VNF instance, part of the NS, requiring a healing action.",
+ required=True)
+ cause = serializers.CharField(
+ help_text="Indicates the reason why a healing procedure is required.",
+ required=False,
+ allow_null=True,
+ allow_blank=True)
+ additionalParams = serializers.DictField(
+ help_text="Additional parameters passed by the NFVO as input to the healing process, specific to the VNF being healed.",
+ required=False,
+ allow_null=True)
class HealNsDataSerializer(serializers.Serializer):
- degreeHealing = serializers.ChoiceField(help_text="degree of healing", choices=["HEAL_RESTORE", "HEAL_QOS", "HEAL_RESET", "PARTIAL_HEALING"], required=True)
+ degreeHealing = serializers.ChoiceField(
+ help_text="Indicates the degree of healing.",
+ choices=["HEAL_RESTORE", "HEAL_QOS", "HEAL_RESET", "PARTIAL_HEALING"],
+ required=True)
actionsHealing = serializers.ListField(
- help_text="A list of actions",
- child=serializers.CharField(help_text="One action", required=True),
+ help_text="Used to specify dedicated healing actions in a particular order",
+ child=serializers.CharField(
+ help_text="one dedicated healing action",
+ required=True),
+ required=False)
+ healScript = serializers.CharField(
+ help_text="Reference to a script from the NSD that shall be used to execute dedicated healing actions in a particular order.",
+ required=False,
+ allow_null=True,
+ allow_blank=True)
+ additionalParamsforNs = serializers.DictField(
+ help_text="Allows the OSS/BSS to provide additional parameter(s) to the healing process at the NS level.",
required=False)
- healScript = serializers.CharField(help_text="script of NS heal", required=False, allow_null=True, allow_blank=True)
- additionalParamsforNs = serializers.CharField(help_text="Addition params of NS heal", required=False, allow_null=True, allow_blank=True)
class HealNsReqSerializer(serializers.Serializer):
- healVnfData = HealVnfDataSerializer(help_text="Data of heal VNF", required=False, allow_null=True,
- many=True)
- healNsData = HealNsDataSerializer(help_text="Provides the information needed to heal an NS",
- required=False, allow_null=True)
+ healVnfData = HealVnfDataSerializer(
+ help_text="Provides the information needed to heal a VNF.",
+ required=False,
+ allow_null=True,
+ many=True)
+ healNsData = HealNsDataSerializer(
+ help_text="Provides the information needed to heal an NS.",
+ required=False,
+ allow_null=True)
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)