genericparser seed code
[modeling/etsicatalog.git] / genericparser / packages / serializers / nsdm_filter_data.py
1 # Copyright (C) 2019 Verizon. 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
17 from genericparser.packages.const import NSDM_NOTIFICATION_TYPES
18
19
20 class NsdmNotificationsFilter(serializers.Serializer):
21     notificationTypes = serializers.ListField(
22         child=serializers.ChoiceField(
23             required=True,
24             choices=NSDM_NOTIFICATION_TYPES
25         ),
26         help_text="Match particular notification types",
27         allow_null=False,
28         required=False
29     )
30     nsdInfoId = serializers.ListField(
31         child=serializers.UUIDField(),
32         help_text="Match NS packages with particular nsdInfoIds",
33         allow_null=False,
34         required=False
35     )
36     nsdId = serializers.ListField(
37         child=serializers.UUIDField(),
38         help_text="Match NS Packages with particular nsdIds",
39         allow_null=False,
40         required=False
41     )
42     nsdName = serializers.ListField(
43         child=serializers.CharField(
44             max_length=255,
45             required=True
46         ),
47         help_text="Match NS Packages with particular nsdNames",
48         allow_null=False,
49         required=False
50     )
51     nsdVersion = serializers.ListField(
52         child=serializers.CharField(
53             max_length=255,
54             required=True
55         ),
56         help_text="match NS packages that belong to certain nsdversion",
57         required=False,
58         allow_null=False
59     )
60     nsdInvariantId = serializers.ListField(
61         child=serializers.UUIDField(),
62         help_text="Match NS Packages with particular nsdInvariantIds",
63         allow_null=False,
64         required=False
65     )
66     vnfPkgIds = serializers.ListField(
67         child=serializers.UUIDField(),
68         help_text="Match NS Packages that has VNF PackageIds",
69         allow_null=False,
70         required=False
71     )
72     nestedNsdInfoIds = serializers.ListField(
73         child=serializers.UUIDField(),
74         help_text="Match NS Packages with particular nsdInvariantIds",
75         allow_null=False,
76         required=False
77     )
78     nsdOnboardingState = serializers.ListField(
79         child=serializers.ChoiceField(
80             required=True,
81             choices=[
82                 'CREATED',
83                 'UPLOADING',
84                 'PROCESSING',
85                 'ONBOARDED'
86             ]
87         ),
88         help_text="Match NS Packages with particular NS Onboarding State",
89         allow_null=False,
90         required=False
91     )
92     nsdOperationalState = serializers.ListField(
93         child=serializers.ChoiceField(
94             required=True,
95             choices=['ENABLED', 'DISABLED']
96         ),
97         help_text="Match NS Packages with particular NS Operational State",
98         allow_null=False,
99         required=False
100     )
101     nsdUsageState = serializers.ListField(
102         child=serializers.ChoiceField(
103             required=True,
104             choices=['IN_USE', 'NOT_IN_USE']
105         ),
106         help_text="Match NS Packages with particular NS Usage State",
107         allow_null=False,
108         required=False
109     )
110     pnfdInfoIds = serializers.ListField(
111         child=serializers.UUIDField(),
112         help_text="Match PF packages with particular pnfdInfoIds",
113         allow_null=False,
114         required=False
115     )
116     pnfdId = serializers.ListField(
117         child=serializers.UUIDField(),
118         help_text="Match PF packages with particular pnfdInfoIds",
119         allow_null=False,
120         required=False
121     )
122     pnfdName = serializers.ListField(
123         child=serializers.CharField(
124             max_length=255,
125             required=True
126         ),
127         help_text="Match PF Packages with particular pnfdNames",
128         allow_null=False,
129         required=False
130     )
131     pnfdVersion = serializers.ListField(
132         child=serializers.CharField(
133             max_length=255,
134             required=True
135         ),
136         help_text="match PF packages that belong to certain pnfd version",
137         required=False,
138         allow_null=False
139     )
140     pnfdProvider = serializers.ListField(
141         child=serializers.CharField(
142             max_length=255,
143             required=True
144         ),
145         help_text="Match PF Packages with particular pnfdProvider",
146         allow_null=False,
147         required=False
148     )
149     pnfdInvariantId = serializers.ListField(
150         child=serializers.UUIDField(),
151         help_text="Match PF Packages with particular pnfdInvariantIds",
152         allow_null=False,
153         required=False
154     )
155     pnfdOnboardingState = serializers.ListField(
156         child=serializers.ChoiceField(
157             required=True,
158             choices=[
159                 'CREATED',
160                 'UPLOADING',
161                 'PROCESSING',
162                 'ONBOARDED'
163             ]
164         ),
165         help_text="Match PF Packages with particular PNF Onboarding State ",
166         allow_null=False,
167         required=False
168     )
169     pnfdUsageState = serializers.ListField(
170         child=serializers.ChoiceField(
171             required=True,
172             choices=['IN_USE', 'NOT_IN_USE']
173         ),
174         help_text="Match PF Packages with particular PNF usage State",
175         allow_null=False,
176         required=False
177     )