blob: c742762797b197fd150b0ad04832263fbc574cf1 [file] [log] [blame]
William Kurkian6f436d02019-02-06 16:25:01 -05001# Copyright 2018 the original author or authors.
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.
14from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
15from voltha.extensions.alarms.adapter_alarms import AlarmBase
16
17
18class OnuSelfTestFailureAlarm(AlarmBase):
19 """
20 The ONU Self Test Failure Alarm is reported by both the CircuitPack (ME #6)
21 and the ONT-G (ME # 256) to indicate failure a failed autonomous self-test.
22
23 For CircuitPack equipment alarms, the intf_id reported is that of the
24 UNI's logical port number
25
26 For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
27 physical port number
28
29 Note: Some ONUs may use this alarm to report a self-test failure or may
30 may report it with the ONU Equipment Alarm which can also cover a
31 self-test failure.
32 """
33 def __init__(self, alarm_mgr, onu_id, intf_id):
34 super(OnuSelfTestFailureAlarm, self).__init__(alarm_mgr, object_type='onu self-test failure',
35 alarm='ONU_SELF_TEST_FAIL',
36 alarm_category=AlarmEventCategory.ONU,
37 alarm_type=AlarmEventType.EQUIPTMENT,
38 alarm_severity=AlarmEventSeverity.CRITICAL)
39 self._onu_id = onu_id
40 self._intf_id = intf_id
41
42 def get_context_data(self):
43 return {'onu-id': self._onu_id,
44 'onu-intf-id': self._intf_id}