blob: 2193b7a5ed1ca25dc85b34f966af346adf62b237 [file] [log] [blame]
Chip Boling67b674a2019-02-08 11:42:18 -06001# 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
Zack Williams84a71e92019-11-15 09:00:19 -070015from __future__ import absolute_import
William Kurkianede82e92019-03-05 13:02:57 -050016from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
Chip Boling67b674a2019-02-08 11:42:18 -060017from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
18
19
20class OltLosAlarm(AlarmBase):
21 def __init__(self, alarm_mgr, intf_id, port_type_name):
22 super(OltLosAlarm, self).__init__(alarm_mgr, object_type='olt LOS',
23 alarm='OLT_LOS',
24 alarm_category=AlarmEventCategory.OLT,
25 alarm_type=AlarmEventType.COMMUNICATION,
26 alarm_severity=AlarmEventSeverity.MAJOR)
27 # Added port type to indicate if alarm was on NNI or PON
28 self._intf_id = intf_id
29 self._port_type_name = port_type_name
30
31 def get_context_data(self):
32 return {'olt-intf-id:': self._intf_id,
33 'olt-port-type-name': self._port_type_name}