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.
15 from rest_framework import serializers
17 from scale_info import ScaleInfoSerializer
18 from ext_cp_info import ExtCpInfoSerializer
19 from ext_virtual_link_info import ExtVirtualLinkInfoSerializer
20 from ext_managed_virtual_link_info import ExtManagedVirtualLinkInfoSerializer
21 from vnfc_resource_info import VnfcResourceInfoSerializer
22 from vnf_virtual_link_resource_info import VnfVirtualLinkResourceInfoSerializer
23 from virtual_storage_resource_info import VirtualStorageResourceInfoSerializer
26 class InstantiatedVnfInfoSerializer(serializers.Serializer):
27 flavourId = serializers.CharField(
28 help_text="Identifier of the VNF deployment flavour applied to this VNF instance.",
33 vnfState = serializers.ChoiceField(
34 help_text="State of the VNF instance.",
35 choices=["STARTED", "STOPPED"],
39 scaleStatus = ScaleInfoSerializer(
40 help_text="Scale status of the VNF, one entry per aspect. \
41 Represents for every scaling aspect how big the VNF has been scaled w.r.t. that aspect.",
45 extCpInfo = ExtCpInfoSerializer(
46 help_text="Information about the external CPs exposed by the VNF instance.",
50 extVirtualLinkInfo = ExtVirtualLinkInfoSerializer(
51 help_text="Information about the external VLs the VNF instance is connected to.",
55 extManagedVirtualLinkInfo = ExtManagedVirtualLinkInfoSerializer(
56 help_text="Information about the externally-managed internal VLs of the VNF instance.",
60 monitoringParameters = serializers.ListSerializer(
61 help_text="Active monitoring parameters.",
62 child=serializers.CharField(help_text="monitoring parameter", allow_blank=True),
65 localizationLanguage = serializers.CharField(
66 help_text="Information about localization language of the VNF.",
71 vnfcResourceInfo = VnfcResourceInfoSerializer(
72 help_text="Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.",
76 vnfVirtualLinkResourceInfo = VnfVirtualLinkResourceInfoSerializer(
77 help_text="Information about the virtualised network resources used by the VLs of the VNF instance.",
81 virtualStorageResourceInfo = VirtualStorageResourceInfoSerializer(
82 help_text="Information about the virtualised storage resources used as storage for the VNF instance.",