blob: af695ca6284346d834d1f5c69310589531799128 [file] [log] [blame]
mzadige4ad1d22018-07-27 15:27:22 -04001# Copyright 2017-present Adtran, Inc.
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
15from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
16from voltha.extensions.alarms.adapter_alarms import AlarmBase
17
18
19class OnuLopcMissAlarm(AlarmBase):
20 def __init__(self, alarm_mgr, onu_id, intf_id):
21 super(OnuLopcMissAlarm, self).__init__(alarm_mgr, object_type='onu LOPC_MISS',
mzadig428dd622018-09-12 15:09:33 -040022 alarm='ONU_LOPC_MISS',
mzadige4ad1d22018-07-27 15:27:22 -040023 alarm_category=AlarmEventCategory.ONU,
24 alarm_type=AlarmEventType.COMMUNICATION,
25 alarm_severity=AlarmEventSeverity.MAJOR)
26 self._onu_id = onu_id
27 self._intf_id = intf_id
28
29 def get_context_data(self):
30 return {
31 'onu-id': self._onu_id,
32 'onu-intf-id': self._intf_id
33 }