1 # Copyright (c) 2019, CMCC Technologies Co., Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 from rest_framework import serializers
17 from modify_vnf_info_data import ModifyVnfInfoDataSerializer
18 from ext_virtual_link_info import ExtVirtualLinkInfoSerializer
20 from lcm.ns.const import CHANGE_TYPES, CHANGE_RESULT
26 CHANGE_TYPES.INSTANTIATE,
27 CHANGE_TYPES.TERMINATE,
29 CHANGE_TYPES.CHANGE_FLAVOUR,
32 CHANGE_TYPES.MODIFY_INFORMATION,
33 CHANGE_TYPES.CHANGE_EXTERNAL_VNF_CONNECTIVITY
37 class ChangedInfoSerializer(serializers.Serializer):
38 changedVnfInfo = ModifyVnfInfoDataSerializer(
39 help_text="Information about the changed VNF instance information, including configurable properties",
41 changedExtConnectivity = ExtVirtualLinkInfoSerializer(
42 help_text="Link to the task resource that represents the 'fail' Information about changed external "
43 "connectivity, if applicable.",
47 class AffectedVnfsSerializer(serializers.Serializer):
48 vnfInstanceId = serializers.UUIDField(
49 help_text="Identifier of the VNF instance.",
52 vnfdId = serializers.UUIDField(
53 help_text="Identifier of the VNFD of the VNF Instance..",
56 vnfProfileId = serializers.UUIDField(
57 help_text="Identifier of the VNF profile of the NSD.",
60 vnfName = serializers.CharField(
61 help_text="Name of the VNF Instance.",
63 changeType = serializers.ChoiceField(
64 help_text="Signals the type of change",
68 changeResult = serializers.ChoiceField(
69 help_text="Signals the type of change",
73 changedInfo = ChangedInfoSerializer(
74 help_text="Links to resources related to this resource.",