commit | bd09e69f279ab1566cd92a8d6d7b5ab58418b18f | [log] [tgz] |
---|---|---|
author | manoj1 <manoj.1.manoj@nokia.com> | Wed Oct 27 09:34:43 2021 -0400 |
committer | Manoj Manoj <manoj.1.manoj@nokia.com> | Thu Oct 28 10:20:42 2021 +0000 |
tree | 4fb57daec2dffac660871328008ccfb2cd8f8fc5 | |
parent | 63f8a1814b3c88e7ca024f4a70c2d5b1d296e321 [diff] |
Increasing UT for Alarm-go Change-Id: I05ce4d36e4b4f21e7ac1a842a73cf5a60db4fae4 Signed-off-by: manoj1 <manoj.1.manoj@nokia.com>
This repository containts Golang implementation of Alarm Manager and related application library interface.
The Alarm Library provides a simple interface for RIC applications (both platform application and xApps) to raise, clear and re-raise. The Alarm Library interacts with the Alarm Manager via RMR interface.
The Alarm Manager is responsible for managing alarm situations in RIC cluster and interfacing with Northboubd applications such as Prometheus AlertManager to post the alarms as alerts. AlertManager takes care of deduplicating, silencing and inhibition (suppressing) of alerts, and routing them to the VESAgent, which, in turn, takes care of converting alerts to fault and send to ONAP as VES events.
A new alarm instance is created with InitAlarm function. MO and application identities are given as a parameter.
The Alarm object contains following parameters:
ManagedObjectId (mo), SpecificProblem (sp), ApplicationId (ap) and IdentifyingInfo (IdentifyingInfo) make up the identity of the alarm. All parameters must be according to the alarm definition, i.e. all mandatory parameters should be present, and parameters should have correct value type or be from some predefined range. Addressing the same alarm instance in a clear() or reraise() call is done by making sure that all four values are the same is in the original raise / reraise call.
package main import ( alarm "gerrit.o-ran-sc.org/r/ric-plt/alarm-go/alarm" ) func main() { // Initialize the alarm component alarmer, err := alarm.InitAlarm("my-pod", "my-app") // Create a new Alarm object alarm := alarmer.NewAlarm(1234, alarm.SeverityMajor, "Some App data", "eth 0 1") // Raise an alarm (SP=1234, etc) err := alarmer.Raise(alarm) // Clear an alarm (SP=1234) err := alarmer.Clear(alarm) // Re-raise an alarm (SP=1234) err := alarmer.Reraise(alarm) // Clear all alarms raised by the application err := alarmer.ClearAll() }
CI
The Dockerfile in the ci
directory only runs, when build, the library unit tests for the repository.
Copyright (c) 2020 AT&T Intellectual Property. Copyright (c) 2020 Nokia.
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.
This source code is part of the near-RT RIC (RAN Intelligent Controller) platform project (RICP).