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
20 NOTIFICATION_TYPES = [
21 "VnfLcmOperationOccurrenceNotification",
22 "VnfIdentifierCreationNotification",
23 "VnfIdentifierDeletionNotification"]
25 LCM_OPERATION_TYPES = [
37 LCM_OPERATION_STATE_TYPES = [
48 class LifeCycleChangeNotificationsFilter(serializers.Serializer):
49 notificationTypes = serializers.ListField(
50 child=serializers.ChoiceField(required=True, choices=NOTIFICATION_TYPES),
51 help_text="Match particular notification types",
54 operationTypes = serializers.ListField(
55 child=serializers.ChoiceField(required=True, choices=LCM_OPERATION_TYPES),
56 help_text="Match particular VNF lifecycle operation types for the " +
57 "notification of type VnfLcmOperationOccurrenceNotification.",
60 operationStates = serializers.ListField(
61 child=serializers.ChoiceField(required=True, choices=LCM_OPERATION_STATE_TYPES),
62 help_text="Match particular LCM operation state values as reported " +
63 "in notifications of type VnfLcmOperationOccurrenceNotification.",
66 vnfInstanceSubscriptionFilter = VnfInstanceSubscriptionFilter(
67 help_text="Filter criteria to select VNF instances about which to notify.",