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.
14 from rest_framework import serializers
17 class VimInfoSerializer(serializers.Serializer):
18 id = serializers.CharField(
19 help_text="The identifier of the VIM Connection. This identifier is managed by the NFVO.",
23 vimId = serializers.CharField(
24 help_text="The identifier of the VIM instance. This identifier is managed by the NFVO.",
28 vimType = serializers.CharField(
29 help_text="Discriminator for the different types of the VIM information.",
33 interfaceInfo = serializers.DictField(
34 help_text="Information about the interface or interfaces to the VIM",
35 child=serializers.CharField(allow_blank=True),
38 accessInfo = serializers.DictField(
39 help_text="Authentication credentials for accessing the VIM, and other access-related information",
40 child=serializers.CharField(allow_blank=True),
43 extra = serializers.DictField(
44 help_text="VIM type specific additional information.",
45 child=serializers.CharField(allow_blank=True),
50 class ScaleInfoSerializer(serializers.Serializer):
51 aspectId = serializers.CharField(
52 help_text="Identifier of the scaling aspect.",
56 scaleLevel = serializers.IntegerField(
57 help_text="Indicates the scale level.",
61 class instantiatedVnfInfoSerializer(serializers.Serializer):
62 flavourId = serializers.CharField(
63 help_text="Identifier of the VNF deployment flavour applied to this VNF instance.",
67 vnfState = serializers.ChoiceField(
68 help_text="State of the VNF instance.",
69 choices=["STARTED", "STOPPED"],
72 scaleStatus = ScaleInfoSerializer(
73 help_text="Scale status of the VNF, one entry per aspect.",
78 class VnfInstanceSerializer(serializers.Serializer):
79 id = serializers.CharField(
80 help_text="Identifier of the VNF instance",
82 vnfInstanceName = serializers.CharField(
83 help_text="Name of the VNF instance.",
87 vnfInstanceDescription = serializers.CharField(
88 help_text="Human-readable description of the VNF instance.",
92 vnfdId = serializers.CharField(
93 help_text="Identifier of the VNFD on which the VNF instance is based.",
97 vnfProvider = serializers.CharField(
98 help_text="Provider of the VNF and the VNFD. The value is copied from the VNFD.",
102 vnfProductName = serializers.CharField(
103 help_text="Name to identify the VNF Product. The value is copied from the VNFD.",
107 vnfSoftwareVersion = serializers.CharField(
108 help_text="Software version of the VNF. The value is copied from the VNFD.",
112 vnfdVersion = serializers.CharField(
113 help_text="Identifies the version of the VNFD. The value is copied from the VNFD.",
117 vnfPkgId = serializers.CharField(
118 help_text="Identifier of information held by the NFVO about the specific VNF package on which the VNF is based.",
122 vnfConfigurableProperties = serializers.DictField(
123 help_text="Current values of the configurable properties of the VNF instance.",
124 child=serializers.CharField(allow_blank=True),
127 vimConnectionInfo = VimInfoSerializer(
128 help_text="Information about VIM connections to be used for managing the resources for the VNF instance.",
131 instantiationState = serializers.ChoiceField(
132 help_text="The instantiation state of the VNF.",
133 choices=["NOT_INSTANTIATED", "INSTANTIATED"],
136 instantiatedVnfInfo = instantiatedVnfInfoSerializer(
137 help_text="Information specific to an instantiated VNF instance.",