cd6c93ec4b545a896cec8b85ac4d74e8267694f6
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / serializers / instantiated_vnf_info.py
1 # Copyright 2018 ZTE Corporation.
2 #
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
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
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
15 from rest_framework import serializers
16
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
24
25
26 class InstantiatedVnfInfoSerializer(serializers.Serializer):
27     flavourId = serializers.CharField(
28         help_text="Identifier of the VNF deployment flavour applied to this VNF instance.",
29         max_length=255,
30         required=True,
31         allow_null=True,
32         allow_blank=False)
33     vnfState = serializers.ChoiceField(
34         help_text="State of the VNF instance.",
35         choices=["STARTED", "STOPPED"],
36         required=True,
37         allow_null=True,
38         allow_blank=False)
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.",
42         many=True,
43         required=False,
44         allow_null=True)
45     extCpInfo = ExtCpInfoSerializer(
46         help_text="Information about the external CPs exposed by the VNF instance.",
47         many=True,
48         required=True,
49         allow_null=False)
50     extVirtualLinkInfo = ExtVirtualLinkInfoSerializer(
51         help_text="Information about the external VLs the VNF instance is connected to.",
52         many=True,
53         required=False,
54         allow_null=True)
55     extManagedVirtualLinkInfo = ExtManagedVirtualLinkInfoSerializer(
56         help_text="Information about the externally-managed internal VLs of the VNF instance.",
57         many=True,
58         required=False,
59         allow_null=True)
60     monitoringParameters = serializers.ListSerializer(
61         help_text="Active monitoring parameters.",
62         child=serializers.CharField(help_text="monitoring parameter", allow_blank=True),
63         required=False,
64         allow_null=True)
65     localizationLanguage = serializers.CharField(
66         help_text="Information about localization language of the VNF.",
67         max_length=255,
68         required=False,
69         allow_null=True,
70         allow_blank=True)
71     vnfcResourceInfo = VnfcResourceInfoSerializer(
72         help_text="Information about the virtualised compute and storage resources used by the VNFCs of the VNF instance.",
73         many=True,
74         required=False,
75         allow_null=True)
76     vnfVirtualLinkResourceInfo = VnfVirtualLinkResourceInfoSerializer(
77         help_text="Information about the virtualised network resources used by the VLs of the VNF instance.",
78         many=True,
79         required=False,
80         allow_null=True)
81     virtualStorageResourceInfo = VirtualStorageResourceInfoSerializer(
82         help_text="Information about the virtualised storage resources used as storage for the VNF instance.",
83         many=True,
84         required=False,
85         allow_null=True)