blob: 2ac4f786d2c791495b542135cdfbf2734cafd93f [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.
Zack Williams84a71e92019-11-15 09:00:19 -070014from __future__ import absolute_import
William Kurkianede82e92019-03-05 13:02:57 -050015from voltha_protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
Chip Boling67b674a2019-02-08 11:42:18 -060016from pyvoltha.adapters.extensions.alarms.adapter_alarms import AlarmBase
17
18
19class OnuTempRedAlarm(AlarmBase):
20 """
21 The ONU Temperature Yellow Alarm is reported by both the CircuitPack
22 (ME #6) and the ONT-G (ME # 256) to indicate no service has been shut
23 down to avoid equipment damage. The operational state of the affected
24 PPTPs indicates the affected services.
25
26 For CircuitPack equipment alarms, the intf_id reported is that of the
27 UNI's logical port number
28
29 For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
30 physical port number
31 """
Yongjie Zhang6d6dc3a2019-08-06 14:00:29 -040032 def __init__(self, alarm_mgr, onu_id, intf_id, serial_number):
Chip Boling67b674a2019-02-08 11:42:18 -060033 super(OnuTempRedAlarm, self).__init__(alarm_mgr, object_type='onu temperature red',
34 alarm='ONU_TEMP_RED',
35 alarm_category=AlarmEventCategory.ONU,
36 alarm_type=AlarmEventType.ENVIRONMENT,
37 alarm_severity=AlarmEventSeverity.CRITICAL)
38 self._onu_id = onu_id
39 self._intf_id = intf_id
Yongjie Zhang6d6dc3a2019-08-06 14:00:29 -040040 self._serial_number = serial_number
Chip Boling67b674a2019-02-08 11:42:18 -060041
42 def get_context_data(self):
43 return {'onu-id': self._onu_id,
Yongjie Zhang6d6dc3a2019-08-06 14:00:29 -040044 'onu-intf-id': self._intf_id,
45 'onu-serial-number': self._serial_number}