1 # Copyright 2018 ZTE Corporation.
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
18 from vim_connection_info import VimConnectionInfoSerializer
19 from instantiated_vnf_info import InstantiatedVnfInfoSerializer
20 from _links import _LinksSerializer
23 class VnfInstanceSerializer(serializers.Serializer):
24 id = serializers.CharField(
25 help_text="Identifier of the VNF instance.",
30 vnfInstanceName = serializers.CharField(
31 help_text="Name of the VNF instance. \
32 This attribute can be modified with the PATCH method.",
37 vnfInstanceDescription = serializers.CharField(
38 help_text="Human-readable description of the VNF instance. \
39 This attribute can be modified with the PATCH method.",
43 vnfdId = serializers.CharField(
44 help_text="Identifier of the VNFD on which the VNF instance is based.",
49 vnfProvider = serializers.CharField(
50 help_text="Provider of the VNF and the VNFD. \
51 The value is copied from the VNFD. ",
56 vnfProductName = serializers.CharField(
57 help_text="Name to identify the VNF Product. \
58 The value is copied from the VNFD.",
63 vnfSoftwareVersion = serializers.CharField(
64 help_text="Software version of the VNF. \
65 The value is copied from the VNFD.",
70 vnfdVersion = serializers.CharField(
71 help_text="Identifies the version of the VNFD. \
72 The value is copied from the VNFD.",
77 vnfPkgId = serializers.CharField(
78 help_text="Identifier of information held by the NFVO about the specific VNF package on which the VNF is based. \
79 This attribute can be modified with the PATCH method.",
84 vnfConfigurableProperties = serializers.DictField(
85 help_text="Current values of the configurable properties of the VNF instance. \
86 Configurable properties referred in this attribute are declared in the VNFD",
87 child=serializers.CharField(allow_blank=True),
90 vimConnectionInfo = VimConnectionInfoSerializer(
91 help_text="Information about VIM connections to be used for managing the resources for the VNF instance. \
92 This attribute can be modified with the PATCH method.",
95 instantiationState = serializers.ChoiceField(
96 help_text="The instantiation state of the VNF.",
97 choices=["NOT_INSTANTIATED", "INSTANTIATED"],
101 instantiatedVnfInfo = InstantiatedVnfInfoSerializer(
102 help_text="Information specific to an instantiated VNF instance. \
103 This attribute shall be present if the instantiateState attribute value is INSTANTIATED",
106 metadata = serializers.DictField(
107 help_text="Additional VNF-specific metadata describing the VNF instance.\
108 This attribute can be modified with the PATCH method.",
109 child=serializers.CharField(allow_blank=True),
112 extensions = serializers.DictField(
113 help_text="VNF-specific attributes that affect the lifecycle management of this VNF instance by the VNFM, or the lifecycle management scripts. \
114 This attribute can be modified with the PATCH method.",
115 child=serializers.CharField(allow_blank=True),
118 _links = _LinksSerializer(
119 help_text="Links to resources related to this resource.",