blob: c8666a3de77f8d90bce257bcdb3856d7900c4b10 [file] [log] [blame]
William Kurkian6f436d02019-02-06 16:25:01 -05001# 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 OltLosAlarm(AlarmBase):
20 def __init__(self, alarm_mgr, intf_id, port_type_name):
21 super(OltLosAlarm, self).__init__(alarm_mgr, object_type='olt LOS',
22 alarm='OLT_LOS',
23 alarm_category=AlarmEventCategory.OLT,
24 alarm_type=AlarmEventType.COMMUNICATION,
25 alarm_severity=AlarmEventSeverity.MAJOR)
26 # Added port type to indicate if alarm was on NNI or PON
27 self._intf_id = intf_id
28 self._port_type_name = port_type_name
29
30 def get_context_data(self):
31 return {'olt-intf-id:': self._intf_id,
32 'olt-port-type-name': self._port_type_name}