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
17 from vnf_instance_subscription_filter import VnfInstanceSubscriptionFilter
18 from lcm.nf.const import NOTIFICATION_TYPES, LCM_OPERATION_TYPES, LCM_OPERATION_STATE_TYPES
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",
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.",
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.",
39 vnfInstanceSubscriptionFilter = VnfInstanceSubscriptionFilter(
40 help_text="Filter criteria to select VNF instances about which to notify.",