1 # Copyright (C) 2021 Wind River Systems, Inc.
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 flask_restx import fields
17 from o2ims.views.api_ns import api_ims_monitoring as api_monitoring_v1
22 alarm_event_record_get = api_monitoring_v1.model(
25 'alarmEventRecordId': fields.String(
27 description='Alarm Event Record ID'),
28 'resourceTypeId': fields.String,
29 'resourceTypeID': fields.String(attribute='resourceTypeId'),
30 'resourceId': fields.String,
31 'resourceID': fields.String(attribute='resourceId'),
33 fields.String(attribute='alarmEventRecordId'),
34 'alarmDefinitionId': fields.String,
35 'alarmDefinitionID': fields.String(attribute='alarmDefinitionId'),
36 'probableCauseId': fields.String,
37 'probableCauseID': fields.String(attribute='probableCauseId'),
38 'alarmRaisedTime': fields.String,
39 'perceivedSeverity': fields.String,
40 'alarmChangedTime': fields.String,
41 'alarmAcknowledgeTime': fields.String,
42 'alarmAcknowledged': fields.Boolean,
43 'extensions': fields.Raw(attribute='extensions'),
48 class SubscriptionDTO:
50 subscription_get = api_monitoring_v1.model(
51 "AlarmSubscriptionGetDto",
53 'alarmSubscriptionId': fields.String(
55 description='Alarm Subscription ID'),
56 'callback': fields.String,
57 'consumerSubscriptionId': fields.String,
58 'filter': fields.String,
60 mask='{alarmSubscriptionId,callback}'
63 subscription_create = api_monitoring_v1.model(
64 "AlarmSubscriptionCreateDto",
66 'callback': fields.String(
68 description='Alarm Subscription callback address'),
69 'consumerSubscriptionId': fields.String,
70 'filter': fields.String,