LN0739_FM_FR12: support for options to dynamically create the AlarmDefinitions
[ric-plt/alarm-go.git] / alarm / types.go
old mode 100644 (file)
new mode 100755 (executable)
index ffe5d39..ea6651f
@@ -67,13 +67,19 @@ type AlarmMessage struct {
        AlarmTime int64
 }
 
+type AlarmConfigParams struct {
+        MaxActiveAlarms int `json:"maxactivealarms"`
+        MaxAlarmHistory int `json:"maxalarmhistory"`
+}
+
 // RICAlarm is an alarm instance
 type RICAlarm struct {
-       moId     string
-       appId    string
-       rmrCtx   unsafe.Pointer
-       rmrReady bool
-       mutex    sync.Mutex
+       moId       string
+       appId      string
+       managerUrl string
+       rmrCtx     unsafe.Pointer
+       rmrReady   bool
+       mutex      sync.Mutex
 }
 
 const (
@@ -87,38 +93,20 @@ const (
        TCP_CONNECTIVITY_LOST_TO_DBAAS int = 8005
        E2_CONNECTIVITY_LOST_TO_GNODEB int = 8006
        E2_CONNECTIVITY_LOST_TO_ENODEB int = 8007
+       ACTIVE_ALARM_EXCEED_MAX_THRESHOLD int = 8008
+       ALARM_HISTORY_EXCEED_MAX_THRESHOLD int = 8009
 )
 
 type AlarmDefinition struct {
-       AlarmId               int
-       AlarmText             string
-       EventType             string
-       OperationInstructions string
+       AlarmId               int  `json:"alarmid"`
+       AlarmText             string  `json:"alarmtext"`
+       EventType             string  `json:"eventtype"`
+       OperationInstructions string  `json:"operationinstructions"`
 }
 
-var RICAlarmDefinitions = map[int]AlarmDefinition{
-       RIC_RT_DISTRIBUTION_FAILED: AlarmDefinition{
-               AlarmId:               RIC_RT_DISTRIBUTION_FAILED,
-               AlarmText:             "RIC ROUTING TABLE DISTRIBUTION FAILED",
-               EventType:             "Processing error",
-               OperationInstructions: "Not defined",
-       },
-       TCP_CONNECTIVITY_LOST_TO_DBAAS: AlarmDefinition{
-               AlarmId:               TCP_CONNECTIVITY_LOST_TO_DBAAS,
-               AlarmText:             "TCP CONNECTIVITY LOST TO DBAAS",
-               EventType:             "Communication error",
-               OperationInstructions: "Not defined",
-       },
-       E2_CONNECTIVITY_LOST_TO_GNODEB: AlarmDefinition{
-               AlarmId:               E2_CONNECTIVITY_LOST_TO_GNODEB,
-               AlarmText:             "E2 CONNECTIVITY LOST TO G-NODEB",
-               EventType:             "Communication error",
-               OperationInstructions: "Not defined",
-       },
-       E2_CONNECTIVITY_LOST_TO_ENODEB: AlarmDefinition{
-               AlarmId:               E2_CONNECTIVITY_LOST_TO_ENODEB,
-               AlarmText:             "E2 CONNECTIVITY LOST TO E-NODEB",
-               EventType:             "Communication error",
-               OperationInstructions: "Not defined",
-       },
-}
+var RICAlarmDefinitions map[int]*AlarmDefinition
+
+const (
+       ALARM_MANAGER_HTTP_URL string = "http://service-ricplt-alarmmanager-http.ricplt:8080"
+       ALARM_MANAGER_RMR_URL  string = "service-ricplt-alarmmanager-rmr.ricplt:4560"
+)