summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaopengzhang <zhang.maopeng1@zte.com.cn>2019-04-02 18:37:47 +0800
committermaopengzhang <zhang.maopeng1@zte.com.cn>2019-04-02 18:37:47 +0800
commit6719ad8ad6fbc2ff5910589761c58c3b1bb53e51 (patch)
treef904eb120e765fcf4db8cc34aa56708ff0db4ddf
parenta6e8a5f86ff0f48613b36ebdf50a4bc98863757b (diff)
fix NS heal serializer error
fix NS heal serializer error Change-Id: Ie23c10663b265a9416c8a39a15e25eed205d58db Issue-ID: VFC-1185 Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
-rw-r--r--lcm/ns/serializers/sol/heal_serializers.py68
1 files changed, 45 insertions, 23 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)