diff options
author | Fu Jinhua <fu.jinhua@zte.com.cn> | 2019-04-02 11:28:08 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-02 11:28:08 +0000 |
commit | 7f19dc2bda0f5aed452a666c1af305bf56c94a30 (patch) | |
tree | 8b463555a5c12ccd6b548e79a08ced5942a556a6 | |
parent | 83b6363bdca5d6fe7f270aa5387a1cdef71b099b (diff) | |
parent | 6719ad8ad6fbc2ff5910589761c58c3b1bb53e51 (diff) |
Merge "fix NS heal serializer error"
-rw-r--r-- | lcm/ns/serializers/sol/heal_serializers.py | 68 |
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) |