VOL-1451 Initial checkin of openonu build
Produced docker container capable of building and running
openonu/brcm_openonci_onu. Copied over current onu code
and resolved all imports by copying into the local source tree.
Change-Id: Ib9785d37afc65b7d32ecf74aee2456352626e2b6
diff --git a/python/extensions/alarms/onu/__init__.py b/python/extensions/alarms/onu/__init__.py
new file mode 100644
index 0000000..b0fb0b2
--- /dev/null
+++ b/python/extensions/alarms/onu/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/python/extensions/alarms/onu/onu_activation_fail_alarm.py b/python/extensions/alarms/onu/onu_activation_fail_alarm.py
new file mode 100644
index 0000000..2bf054e
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_activation_fail_alarm.py
@@ -0,0 +1,30 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuActivationFailAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuActivationFailAlarm, self).__init__(alarm_mgr, object_type='onu ACTIVATION FAIL',
+ alarm='ONU_ACTIVATION_FAIL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_active_alarm.py b/python/extensions/alarms/onu/onu_active_alarm.py
new file mode 100644
index 0000000..a139875
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_active_alarm.py
@@ -0,0 +1,50 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+
+
+class OnuActiveAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, device_id, pon_id, onu_serial_number,
+ reg_id, olt_serial_number, ipv4_address=None):
+ super(OnuActiveAlarm, self).__init__(alarm_mgr, object_type='ONU',
+ alarm='ONU_ACTIVATED',
+ alarm_category=AlarmEventCategory.PON,
+ resource_id=pon_id,
+ alarm_type=AlarmEventType.EQUIPMENT,
+ alarm_severity=AlarmEventSeverity.CRITICAL)
+ self._pon_id = pon_id
+ self._onu_serial_number = onu_serial_number
+ self._device_id = device_id
+ self._olt_serial_number = olt_serial_number
+ self._host = ipv4_address
+ self._reg_id = reg_id
+
+ def get_context_data(self):
+ data = {
+ 'pon-id': self._pon_id,
+ 'serial-number': self._onu_serial_number,
+ 'olt_serial_number': self._olt_serial_number,
+ 'device_id': self._device_id,
+ 'registration_id': self._reg_id
+ }
+ if self._host is not None:
+ data['host'] = self._host
+
+ return data
+
+ def clear_alarm(self):
+ raise NotImplementedError('ONU Active Alarms are auto-clear')
+
diff --git a/python/extensions/alarms/onu/onu_discovery_alarm.py b/python/extensions/alarms/onu/onu_discovery_alarm.py
new file mode 100644
index 0000000..c7da2bc
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_discovery_alarm.py
@@ -0,0 +1,36 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuDiscoveryAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, pon_id, serial_number):
+ super(OnuDiscoveryAlarm, self).__init__(alarm_mgr, object_type='ONU Discovery',
+ alarm='ONU_DISCOVERY',
+ alarm_category=AlarmEventCategory.PON,
+ resource_id=pon_id,
+ alarm_type=AlarmEventType.EQUIPMENT,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._pon_id = pon_id
+ self._serial_number = serial_number
+
+ def get_context_data(self):
+ return {
+ 'pon-id': self._pon_id,
+ 'serial-number': self._serial_number
+ }
+
+ def clear_alarm(self):
+ raise NotImplementedError('ONU Discovery Alarms are auto-clear')
diff --git a/python/extensions/alarms/onu/onu_dying_gasp_alarm.py b/python/extensions/alarms/onu/onu_dying_gasp_alarm.py
new file mode 100644
index 0000000..52b6850
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_dying_gasp_alarm.py
@@ -0,0 +1,33 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuDyingGaspAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuDyingGaspAlarm, self).__init__(alarm_mgr, object_type='onu DYING_GASP',
+ alarm='ONU_DYING_GASP',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {
+ 'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id
+ }
diff --git a/python/extensions/alarms/onu/onu_equipment_alarm.py b/python/extensions/alarms/onu/onu_equipment_alarm.py
new file mode 100644
index 0000000..e7e3a7a
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_equipment_alarm.py
@@ -0,0 +1,45 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuEquipmentAlarm(AlarmBase):
+ """
+ The ONU Equipment Alarm is reported by both the CircuitPack (ME #6) and
+ the ONT-G (ME # 256) to indicate failure on an internal interface or
+ failed self-test.
+
+ For CircuitPack equipment alarms, the intf_id reported is that of the
+ UNI's logical port number
+
+ For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+
+ Note: Some ONUs may use this alarm to report a self-test failure or may
+ may report it with a different alarm number specifically for a
+ self-test failure.
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuEquipmentAlarm, self).__init__(alarm_mgr, object_type='onu equipment',
+ alarm='ONU_EQUIPMENT',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.EQUIPTMENT,
+ alarm_severity=AlarmEventSeverity.CRITICAL)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_high_rx_optical_power_alarm.py b/python/extensions/alarms/onu/onu_high_rx_optical_power_alarm.py
new file mode 100644
index 0000000..7b59d55
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_high_rx_optical_power_alarm.py
@@ -0,0 +1,37 @@
+# Copyright 2018 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuHighRxOpticalAlarm(AlarmBase):
+ """
+ The ONU High Tx Optical Power Alarm is reported by the ANI-G (ME # 263) to
+ indicate that the received downstream optical power above threshold..
+
+ For ANI-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuHighRxOpticalAlarm, self).__init__(alarm_mgr, object_type='onu high rx optical power',
+ alarm='ONU_HIGH_RX_OPTICAL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_high_tx_optical_power_alarm.py b/python/extensions/alarms/onu/onu_high_tx_optical_power_alarm.py
new file mode 100644
index 0000000..64caefe
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_high_tx_optical_power_alarm.py
@@ -0,0 +1,37 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuHighTxOpticalAlarm(AlarmBase):
+ """
+ The ONU High Tx Optical Power Alarm is reported by the ANI-G (ME # 263) to
+ indicate that the received downstream optical power above upper threshold.
+
+ For ANI-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuHighTxOpticalAlarm, self).__init__(alarm_mgr, object_type='onu high tx optical power',
+ alarm='ONU_HIGH_TX_OPTICAL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
\ No newline at end of file
diff --git a/python/extensions/alarms/onu/onu_laser_bias_current_alarm.py b/python/extensions/alarms/onu/onu_laser_bias_current_alarm.py
new file mode 100644
index 0000000..8daf5a6
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_laser_bias_current_alarm.py
@@ -0,0 +1,38 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLaserBiasAlarm(AlarmBase):
+ """
+ The ONU Laser Bias Current Alarm is reported by the ANI-G (ME # 263) to
+ indicate that the laser bias current above threshold determined by
+ vendor and that laser end of life is pending
+
+ For ANI-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLaserBiasAlarm, self).__init__(alarm_mgr, object_type='onu laser bias current',
+ alarm='ONU_LASER_BIAS_CURRENT',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.EQUIPTMENT,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_laser_eol_alarm.py b/python/extensions/alarms/onu/onu_laser_eol_alarm.py
new file mode 100644
index 0000000..fa5039c
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_laser_eol_alarm.py
@@ -0,0 +1,36 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLaserEolAlarm(AlarmBase):
+ """
+ The ONU Laser End-of-Lifer Alarm is reported by both the CircuitPack (ME #6)
+ to indicate that failure of transmit laser imminent
+
+ The intf_id reported is that of the UNI's logical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLaserEolAlarm, self).__init__(alarm_mgr, object_type='onu laser EOL',
+ alarm='ONU_LASER_EOL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.EQUIPTMENT,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_lob_alarm.py b/python/extensions/alarms/onu/onu_lob_alarm.py
new file mode 100644
index 0000000..e595211
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_lob_alarm.py
@@ -0,0 +1,30 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLobAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLobAlarm, self).__init__(alarm_mgr, object_type='onu LOB',
+ alarm='ONU_LOB',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_lopc_mic_error_alarm.py b/python/extensions/alarms/onu/onu_lopc_mic_error_alarm.py
new file mode 100644
index 0000000..cc05cb0
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_lopc_mic_error_alarm.py
@@ -0,0 +1,33 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLopcMicErrorAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLopcMicErrorAlarm, self).__init__(alarm_mgr, object_type='onu LOPC_MIC_ERROR',
+ alarm='ONU_LOPC_MIC_ERROR',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {
+ 'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id
+ }
diff --git a/python/extensions/alarms/onu/onu_lopc_miss_alarm.py b/python/extensions/alarms/onu/onu_lopc_miss_alarm.py
new file mode 100644
index 0000000..af695ca
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_lopc_miss_alarm.py
@@ -0,0 +1,33 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLopcMissAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLopcMissAlarm, self).__init__(alarm_mgr, object_type='onu LOPC_MISS',
+ alarm='ONU_LOPC_MISS',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {
+ 'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id
+ }
diff --git a/python/extensions/alarms/onu/onu_los_alarm.py b/python/extensions/alarms/onu/onu_los_alarm.py
new file mode 100644
index 0000000..d2ebb7f
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_los_alarm.py
@@ -0,0 +1,30 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLosAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLosAlarm, self).__init__(alarm_mgr, object_type='onu LOS',
+ alarm='ONU_LOS',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_low_rx_optical_power_alarm.py b/python/extensions/alarms/onu/onu_low_rx_optical_power_alarm.py
new file mode 100644
index 0000000..ee6f4d2
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_low_rx_optical_power_alarm.py
@@ -0,0 +1,37 @@
+# Copyright 2018 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLowRxOpticalAlarm(AlarmBase):
+ """
+ The ONU Low Rx Optical Power Alarm is reported by the ANI-G (ME # 263) to
+ indicate that the received downstream optical power below threshold.
+
+ For ANI-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLowRxOpticalAlarm, self).__init__(alarm_mgr, object_type='onu low rx optical power',
+ alarm='ONU_LOW_RX_OPTICAL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_low_tx_optical_power_alarm.py b/python/extensions/alarms/onu/onu_low_tx_optical_power_alarm.py
new file mode 100644
index 0000000..e28a556
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_low_tx_optical_power_alarm.py
@@ -0,0 +1,37 @@
+# Copyright 2018 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuLowTxOpticalAlarm(AlarmBase):
+ """
+ The ONU Low Tx Optical Power Alarm is reported by the ANI-G (ME # 263) to
+ indicate that the transmit optical power below lower threshold
+
+ For ANI-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuLowTxOpticalAlarm, self).__init__(alarm_mgr, object_type='onu low tx optical power',
+ alarm='ONU_LOW_TX_OPTICAL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_selftest_failure_alarm.py b/python/extensions/alarms/onu/onu_selftest_failure_alarm.py
new file mode 100644
index 0000000..c742762
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_selftest_failure_alarm.py
@@ -0,0 +1,44 @@
+# Copyright 2018 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuSelfTestFailureAlarm(AlarmBase):
+ """
+ The ONU Self Test Failure Alarm is reported by both the CircuitPack (ME #6)
+ and the ONT-G (ME # 256) to indicate failure a failed autonomous self-test.
+
+ For CircuitPack equipment alarms, the intf_id reported is that of the
+ UNI's logical port number
+
+ For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+
+ Note: Some ONUs may use this alarm to report a self-test failure or may
+ may report it with the ONU Equipment Alarm which can also cover a
+ self-test failure.
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuSelfTestFailureAlarm, self).__init__(alarm_mgr, object_type='onu self-test failure',
+ alarm='ONU_SELF_TEST_FAIL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.EQUIPTMENT,
+ alarm_severity=AlarmEventSeverity.CRITICAL)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_signal_degrade_alarm.py b/python/extensions/alarms/onu/onu_signal_degrade_alarm.py
new file mode 100644
index 0000000..4861f75
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_signal_degrade_alarm.py
@@ -0,0 +1,33 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuSignalDegradeAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id,
+ inverse_bit_error_rate):
+ super(OnuSignalDegradeAlarm, self).__init__(alarm_mgr, object_type='onu SIGNAL DEGRADE',
+ alarm='ONU_SIGNAL_DEGRADE',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+ self._inverse_bit_error_rate=inverse_bit_error_rate
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id,
+ 'inverse-bit-error-rate': self._inverse_bit_error_rate}
diff --git a/python/extensions/alarms/onu/onu_signal_fail_alarm.py b/python/extensions/alarms/onu/onu_signal_fail_alarm.py
new file mode 100644
index 0000000..bcc629a
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_signal_fail_alarm.py
@@ -0,0 +1,39 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+"""
+ OnuSignalsFailureIndication {
+ fixed32 intf_id = 1;
+ fixed32 onu_id = 2;
+ string status = 3;
+ fixed32 inverse_bit_error_rate = 4;
+"""
+
+class OnuSignalFailAlarm(AlarmBase):
+ def __init__(self, alarm_mgr, onu_id, intf_id, inverse_bit_error_rate):
+ super(OnuSignalFailAlarm, self).__init__(alarm_mgr, object_type='onu SIGNAL FAIL',
+ alarm='ONU_SIGNAL_FAIL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+ self._inverse_bit_error_rate = inverse_bit_error_rate
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id,
+ 'inverse-bit-error-rate': self._inverse_bit_error_rate}
diff --git a/python/extensions/alarms/onu/onu_startup_alarm.py b/python/extensions/alarms/onu/onu_startup_alarm.py
new file mode 100644
index 0000000..9960f03
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_startup_alarm.py
@@ -0,0 +1,39 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+"""
+ message OnuStartupFailureIndication {
+ fixed32 intf_id = 1;
+ fixed32 onu_id = 2;
+ string status = 3;
+}
+
+"""
+
+class OnuStartupAlarm(AlarmBase):
+
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuStartupAlarm, self).__init__(alarm_mgr, object_type='onu STARTUP FAIL',
+ alarm='ONU_STARTUP_FAIL',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_temp_red_alarm.py b/python/extensions/alarms/onu/onu_temp_red_alarm.py
new file mode 100644
index 0000000..bfa1623
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_temp_red_alarm.py
@@ -0,0 +1,42 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuTempRedAlarm(AlarmBase):
+ """
+ The ONU Temperature Yellow Alarm is reported by both the CircuitPack
+ (ME #6) and the ONT-G (ME # 256) to indicate no service has been shut
+ down to avoid equipment damage. The operational state of the affected
+ PPTPs indicates the affected services.
+
+ For CircuitPack equipment alarms, the intf_id reported is that of the
+ UNI's logical port number
+
+ For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuTempRedAlarm, self).__init__(alarm_mgr, object_type='onu temperature red',
+ alarm='ONU_TEMP_RED',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.ENVIRONMENT,
+ alarm_severity=AlarmEventSeverity.CRITICAL)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_temp_yellow_alarm.py b/python/extensions/alarms/onu/onu_temp_yellow_alarm.py
new file mode 100644
index 0000000..7a28f81
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_temp_yellow_alarm.py
@@ -0,0 +1,41 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuTempYellowAlarm(AlarmBase):
+ """
+ The ONU Temperature Yellow Alarm is reported by both the CircuitPack
+ (ME #6) and the ONT-G (ME # 256) to indicate no service shutdown at
+ present, but the circuit pack is operating beyond its recommended range.
+
+ For CircuitPack equipment alarms, the intf_id reported is that of the
+ UNI's logical port number
+
+ For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuTempYellowAlarm, self).__init__(alarm_mgr, object_type='onu temperature yellow',
+ alarm='ONU_TEMP_YELLOW',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.ENVIRONMENT,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_voltage_red_alarm.py b/python/extensions/alarms/onu/onu_voltage_red_alarm.py
new file mode 100644
index 0000000..506351c
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_voltage_red_alarm.py
@@ -0,0 +1,39 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuVoltageRedAlarm(AlarmBase):
+ """
+ The ONU Voltage Red Alarm is reported by the ONT-G (ME # 256) to
+ indicate some services have been shut down to avoid power collapse.
+ The operational state of the affected PPTPs indicates the affected
+ services.
+
+ For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuVoltageRedAlarm, self).__init__(alarm_mgr, object_type='onu voltage red',
+ alarm='ONU_VOLTAGE_RED',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.CRITICAL)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_voltage_yellow_alarm.py b/python/extensions/alarms/onu/onu_voltage_yellow_alarm.py
new file mode 100644
index 0000000..1bb3ef6
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_voltage_yellow_alarm.py
@@ -0,0 +1,39 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuVoltageYellowAlarm(AlarmBase):
+ """
+ The ONU Voltage Red Alarm is reported by the ONT-G (ME # 256) to
+ indicate some services have been shut down to avoid power collapse.
+ The operational state of the affected PPTPs indicates the affected
+ services.
+
+ For ONT-G equipment alarms, the intf_id reported is that of the PON/ANI
+ physical port number
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id):
+ super(OnuVoltageYellowAlarm, self).__init__(alarm_mgr, object_type='onu voltage yellow',
+ alarm='ONU_VOLTAGE_YELLOW',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id}
diff --git a/python/extensions/alarms/onu/onu_window_drift_alarm.py b/python/extensions/alarms/onu/onu_window_drift_alarm.py
new file mode 100644
index 0000000..32d677d
--- /dev/null
+++ b/python/extensions/alarms/onu/onu_window_drift_alarm.py
@@ -0,0 +1,43 @@
+# Copyright 2017-present Adtran, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from voltha.protos.events_pb2 import AlarmEventType, AlarmEventSeverity, AlarmEventCategory
+from voltha.extensions.alarms.adapter_alarms import AlarmBase
+
+
+class OnuWindowDriftAlarm(AlarmBase):
+ """
+ OnuDriftOfWindowIndication {
+ fixed32 intf_id = 1;
+ fixed32 onu_id = 2;
+ string status = 3;
+ fixed32 drift = 4;
+ fixed32 new_eqd = 5;
+ }
+ """
+ def __init__(self, alarm_mgr, onu_id, intf_id, drift, new_eqd):
+ super(OnuWindowDriftAlarm, self).__init__(alarm_mgr, object_type='onu WINDOW DRIFT',
+ alarm='ONU_WINDOW_DRIFT',
+ alarm_category=AlarmEventCategory.ONU,
+ alarm_type=AlarmEventType.COMMUNICATION,
+ alarm_severity=AlarmEventSeverity.MAJOR)
+ self._onu_id = onu_id
+ self._intf_id = intf_id
+ self._drift = drift
+ self._new_eqd = new_eqd
+
+ def get_context_data(self):
+ return {'onu-id': self._onu_id,
+ 'onu-intf-id': self._intf_id,
+ 'drift': self._drift,
+ 'new-eqd': self._new_eqd}