1 # Copyright (C) 2018 Verizon. All Rights Reserved
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
18 class VersionsSerializer(serializers.Serializer):
19 vnfSoftwareVersion = serializers.CharField(
21 help_text="Software version to match.",
23 vnfdVersions = serializers.ListField(
24 child=serializers.CharField(max_length=255, required=True),
26 help_text="match VNF instances that belong to VNF products " +
27 "with certain VNFD versions")
30 class VnfProductsSerializer(serializers.Serializer):
31 vnfProductName = serializers.CharField(
33 help_text="Name of the VNF product to match.",
35 versions = VersionsSerializer(
36 help_text="match VNF instances that belong to VNF products " +
37 "with certain versions and a certain product name, from one " +
38 "particular provider",
43 class VnfProductsProvidersSerializer(serializers.Serializer):
44 vnfProvider = serializers.CharField(
46 help_text="Name of the VNF provider to match.",
48 vnfProducts = VnfProductsSerializer(
49 help_text="match VNF instances that belong to VNF products " +
50 "with certain product names, from one particular provider",
55 class VnfInstanceSubscriptionFilter(serializers.Serializer):
56 vnfdIds = serializers.ListField(
57 child=serializers.UUIDField(),
58 help_text="VNF instances that were created based on a " +
59 "VNFD identified by one of the vnfdId values",
62 vnfInstanceIds = serializers.ListField(
63 child=serializers.UUIDField(),
64 help_text="VNF instance IDs that has to be matched",
67 vnfInstanceNames = serializers.ListField(
68 child=serializers.CharField(max_length=255, required=True),
69 help_text="VNF Instance names that has to be matched",
72 vnfProductsFromProviders = VnfProductsProvidersSerializer(
73 help_text="match VNF instances that belong to VNF products " +
74 "from certain providers.",