ab498500179634e7ea8928fb178fbf1de97824a3
[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 VnfInstanceSerializer(serializers.Serializer):
18     id = serializers.CharField(
19         help_text="Identifier of the VNF instance",
20         required=True)
21     vnfInstanceName = serializers.CharField(
22         help_text="Name of the VNF instance.",
23         required=False,
24         allow_null=True,
25         allow_blank=True)
26     vnfInstanceDescription = serializers.CharField(
27         help_text="Human-readable description of the VNF instance.",
28         required=False,
29         allow_null=True,
30         allow_blank=True)
31     vnfdId = serializers.CharField(
32         help_text="Identifier of the VNFD on which the VNF instance is based.",
33         required=False,
34         allow_null=True,
35         allow_blank=True)
36     vnfProvider = serializers.CharField(
37         help_text="Provider of the VNF and the VNFD. The value is copied from the VNFD.",
38         required=False,
39         allow_null=True,
40         allow_blank=True)
41     vnfProductName = serializers.CharField(
42         help_text="Name to identify the VNF Product. The value is copied from the VNFD.",
43         required=False,
44         allow_null=True,
45         allow_blank=True)
46     vnfSoftwareVersion = serializers.CharField(
47         help_text="Software version of the VNF. The value is copied from the VNFD.",
48         required=False,
49         allow_null=True,
50         allow_blank=True)
51     vnfdVersion = serializers.CharField(
52         help_text="Identifies the version of the VNFD. The value is copied from the VNFD.",
53         required=False,
54         allow_null=True,
55         allow_blank=True)
56     vnfPkgId = serializers.CharField(
57         help_text="Identifier of information held by the NFVO about the specific VNF package on which the VNF is based.",
58         required=False,
59         allow_null=True,
60         allow_blank=True)
61     vnfConfigurableProperties = serializers.DictField(
62         help_text="Current values of the configurable properties of the VNF instance.",
63         child=serializers.CharField(help_text="Vnf Configurable Properties", allow_blank=True),
64         required=False,
65         allow_null=True)