seperate sol and deprecated serializers
[vfc/nfvo/lcm.git] / lcm / ns / serializers / sol / ext_managed_virtual_link_info.py
1 # Copyright 2019 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 from lcm.ns.serializers.sol.resource_handle import ResourceHandleSerializer
17
18
19 class VnfLinkPortInfo(serializers.Serializer):
20     id = serializers.CharField(
21         help_text="Identifier of this link port as provided by the entity that has created the link port.",
22         max_length=255,
23         required=True,
24         allow_null=False,
25         allow_blank=False)
26     resourceHandle = ResourceHandleSerializer(
27         help_text="Reference to the virtualised network resource realizing this link port.",
28         required=True,
29         allow_null=False)
30     cpInstanceId = serializers.CharField(
31         help_text="When the link port is used for external connectivity by the VNF, \
32         this attribute represents the identifier of the external CP of the VNF to be connected to this link port.",
33         max_length=255,
34         required=False,
35         allow_null=True,
36         allow_blank=True)
37     cpInstanceType = serializers.ChoiceField(required=False, choices=['VNFC_CP', 'EXT_CP'], help_text="Type of the CP instance that is identified by cpInstanceId."),
38
39
40 class ExtManagedVirtualLinkInfo(serializers.Serializer):
41     id = serializers.CharField(
42         help_text="Identifier of the externally-managed inner VL and the related externally-managed VL information instance.",
43         max_length=255,
44         required=True)
45     vnfVirtualLinkDescId = serializers.CharField(
46         help_text="Identifier of the VNF Virtual Link Descriptor (VLD) in the VNFD.",
47         max_length=255,
48         required=True)
49     networkResource = ResourceHandleSerializer(
50         help_text="ResourceHandle,reference to the VirtualNetwork resource.",
51         required=True,
52         allow_null=False)
53     vnfLinkPorts = VnfLinkPortInfo(
54         help_text="VnfLinkPortInfo, Link ports of this VL.",
55         many=True,
56         required=False)