Add vfc-vnflcm vimInfo schema
[vfc/gvnfm/vnflcm.git] / lcm / lcm / v2 / serializers.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 from rest_framework import serializers
15
16
17 class AccessInfoSerializer(serializers.Serializer):
18     pass
19
20
21 class InterfaceInfoSerializer(serializers.Serializer):
22     pass
23
24
25 class VimInfoSerializer(serializers.Serializer):
26     id = serializers.CharField(
27         help_text="The identifier of the VIM Connection. This identifier is managed by the NFVO.",
28         required=False,
29         max_length=255,
30         allow_null=True)
31     vimId = serializers.CharField(
32         help_text="The identifier of the VIM instance. This identifier is managed by the NFVO.",
33         required=False,
34         max_length=255,
35         allow_null=True)
36     vimType = serializers.CharField(
37         help_text="Discriminator for the different types of the VIM information.",
38         required=False,
39         max_length=255,
40         allow_null=True)
41     interfaceInfo = InterfaceInfoSerializer(
42         help_text="vimInfoId",
43         required=False,
44         allow_null=True)
45     accessInfo = AccessInfoSerializer(
46         help_text="accessInfo",
47         required=False,
48         allow_null=True)
49
50
51 class VnfInstanceSerializer(serializers.Serializer):
52     id = serializers.CharField(
53         help_text="Identifier of the VNF instance",
54         required=True)
55     vnfInstanceName = serializers.CharField(
56         help_text="Name of the VNF instance.",
57         required=False,
58         allow_null=True,
59         allow_blank=True)
60     vnfInstanceDescription = serializers.CharField(
61         help_text="Human-readable description of the VNF instance.",
62         required=False,
63         allow_null=True,
64         allow_blank=True)
65     vnfdId = serializers.CharField(
66         help_text="Identifier of the VNFD on which the VNF instance is based.",
67         required=False,
68         allow_null=True,
69         allow_blank=True)
70     vnfProvider = serializers.CharField(
71         help_text="Provider of the VNF and the VNFD. The value is copied from the VNFD.",
72         required=False,
73         allow_null=True,
74         allow_blank=True)
75     vnfProductName = serializers.CharField(
76         help_text="Name to identify the VNF Product. The value is copied from the VNFD.",
77         required=False,
78         allow_null=True,
79         allow_blank=True)
80     vnfSoftwareVersion = serializers.CharField(
81         help_text="Software version of the VNF. The value is copied from the VNFD.",
82         required=False,
83         allow_null=True,
84         allow_blank=True)
85     vnfdVersion = serializers.CharField(
86         help_text="Identifies the version of the VNFD. The value is copied from the VNFD.",
87         required=False,
88         allow_null=True,
89         allow_blank=True)
90     vnfPkgId = serializers.CharField(
91         help_text="Identifier of information held by the NFVO about the specific VNF package on which the VNF is based.",
92         required=False,
93         allow_null=True,
94         allow_blank=True)
95     vnfConfigurableProperties = serializers.DictField(
96         help_text="Current values of the configurable properties of the VNF instance.",
97         child=serializers.CharField(help_text="Vnf Configurable Properties", allow_blank=True),
98         required=False,
99         allow_null=True)
100     vimConnectionInfo = VimInfoSerializer(
101         help_text="vim",
102         required=False,
103         allow_null=True)