1 # Copyright 2019 ZTE Corporation.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 from rest_framework import serializers
16 from lcm.ns.serializers.sol.resource_handle import ResourceHandleSerializer
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.",
26 resourceHandle = ResourceHandleSerializer(
27 help_text="Reference to the virtualised network resource realizing this link port.",
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 \
38 cpInstanceType = serializers.ChoiceField(
40 choices=['VNFC_CP', 'EXT_CP'],
41 help_text="Type of the CP instance that is identified by cpInstanceId.")
44 class ExtManagedVirtualLinkInfo(serializers.Serializer):
45 id = serializers.CharField(
46 help_text="Identifier of the externally-managed inner VL and the related externally-managed VL information instance.",
49 vnfVirtualLinkDescId = serializers.CharField(
50 help_text="Identifier of the VNF Virtual Link Descriptor (VLD) in the VNFD.",
53 networkResource = ResourceHandleSerializer(
54 help_text="ResourceHandle,reference to the VirtualNetwork resource.",
57 vnfLinkPorts = VnfLinkPortInfo(
58 help_text="VnfLinkPortInfo, Link ports of this VL.",