Implement Alarm on subscription fail
Raise an alarm if subscription request fails.
Change-Id: Ibfb97bca48d75deccb889317cc26a984779eab37
Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
diff --git a/hwApp.go b/hwApp.go
index b368db9..260b7c1 100755
--- a/hwApp.go
+++ b/hwApp.go
@@ -23,6 +23,7 @@
import (
"encoding/json"
+ "gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
)
@@ -160,6 +161,13 @@
if err != nil {
xapp.Logger.Error("subscription failed (%s) with error: %s", meid, err)
+
+ // subscription failed, raise alarm
+ err := xapp.Alarm.Raise(8086, alarm.SeverityCritical, meid, "subscriptionFailed")
+ if err != nil {
+ xapp.Logger.Error("Raising alarm failed with error %v", err)
+ }
+
return
}
xapp.Logger.Info("Successfully subcription done (%s), subscription id : %s", meid, *resp.SubscriptionID)