Add change vnf flavour api
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / serializers / change_vnf_flavour_request.py
1 # Copyright (C) 2019 ZTE. All Rights Reserved.
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 from .ext_virtual_link_data import ExtVirtualLinkDataSerizlizer
17 from .vim_connection_info import VimConnectionInfoSerializer
18 from .ext_managed_virtual_link_data import ExtManagedVirtualLinkDataSerizlizer
19
20
21 class ChangeVnfFlavourRequestSerializer(serializers.Serializer):
22     newFlavourId = serializers.CharField(
23         help_text="Identifier of the VNF deployment flavour to be instantiated.",
24         required=True,
25         allow_null=False,
26         allow_blank=False
27     )
28     instantiationLevelId = serializers.CharField(
29         help_text="Identifier of the instantiation level of the deployment flavour to be instantiated. " +
30         "If not present, the default instantiation level as declared in the VNFD is instantiated.",
31         required=False,
32         allow_blank=True,
33         allow_null=True
34     )
35     extVirtualLinks = ExtVirtualLinkDataSerizlizer(
36         help_text="Information about external VLs to connect the VNF to.",
37         many=True,
38         required=False,
39         allow_null=True
40     )
41     extManagedVirtualLinks = ExtManagedVirtualLinkDataSerizlizer(
42         help_text="Information about internal VLs that are managed by the NFVO.",
43         many=True,
44         required=False,
45         allow_null=True
46     )
47     vimConnectionInfo = VimConnectionInfoSerializer(
48         help_text="Information about VIM connections to be used for managing " +
49         "the resources for the VNF instance, " +
50         "or refer to external / externally-managed virtual links." +
51         "This attribute shall only be supported and may be present if VNF-related " +
52         "resource management in direct mode is applicable.",
53         many=True,
54         required=False,
55         allow_null=True
56     )
57     additionalParams = serializers.DictField(
58         help_text="Additional input parameters for the flavour change process, " +
59         "specific to the VNF being modified, " +
60         "as declared in the VNFD as part of 'ChangeVnfFlavourOpConfig'.",
61         required=False,
62         allow_null=True
63     )