vfclcm upgrade from python2 to python3
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / serializers / lccn_filter_data.py
1 # Copyright (C) 2018 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 .vnf_instance_subscription_filter import VnfInstanceSubscriptionFilter
18 from lcm.nf.const import NOTIFICATION_TYPES, LCM_OPERATION_TYPES, LCM_OPERATION_STATE_TYPES
19
20
21 class LifeCycleChangeNotificationsFilter(serializers.Serializer):
22     notificationTypes = serializers.ListField(
23         child=serializers.ChoiceField(required=True, choices=NOTIFICATION_TYPES),
24         help_text="Match particular notification types",
25         allow_null=False,
26         required=False)
27     operationTypes = serializers.ListField(
28         child=serializers.ChoiceField(required=True, choices=LCM_OPERATION_TYPES),
29         help_text="Match particular VNF lifecycle operation types for the " +
30         "notification of type VnfLcmOperationOccurrenceNotification.",
31         allow_null=False,
32         required=False)
33     operationStates = serializers.ListField(
34         child=serializers.ChoiceField(required=True, choices=LCM_OPERATION_STATE_TYPES),
35         help_text="Match particular LCM operation state values as reported " +
36         "in notifications of type VnfLcmOperationOccurrenceNotification.",
37         allow_null=False,
38         required=False)
39     vnfInstanceSubscriptionFilter = VnfInstanceSubscriptionFilter(
40         help_text="Filter criteria to select VNF instances about which to notify.",
41         required=False,
42         allow_null=False)