2 * Copyright (c) 2020 AT&T Intellectual Property.
3 * Copyright (c) 2020 Nokia.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * This source code is part of the near-RT RIC (RAN Intelligent Controller)
18 * platform project (RICP).
32 // Severity for alarms
35 // Possible values for Severity
37 SeverityUnspecified Severity = "UNSPECIFIED"
38 SeverityCritical Severity = "CRITICAL"
39 SeverityMajor Severity = "MAJOR"
40 SeverityMinor Severity = "MINOR"
41 SeverityWarning Severity = "WARNING"
42 SeverityCleared Severity = "CLEARED"
43 SeverityDefault Severity = "DEFAULT"
46 // Alarm object - see README for more information
48 ManagedObjectId string `json:"managedObjectId"`
49 ApplicationId string `json:"applicationId"`
50 SpecificProblem int `json:"specificProblem"`
51 PerceivedSeverity Severity `json:"perceivedSeverity"`
52 IdentifyingInfo string `json:"identifyingInfo"`
53 AdditionalInfo string `json:"additionalInfo"`
57 type AlarmAction string
59 // Possible values for alarm actions
61 AlarmActionRaise AlarmAction = "RAISE"
62 AlarmActionClear AlarmAction = "CLEAR"
63 AlarmActionClearAll AlarmAction = "CLEARALL"
66 type AlarmMessage struct {
72 type AlarmConfigParams struct {
73 MaxActiveAlarms int `json:"maxactivealarms"`
74 MaxAlarmHistory int `json:"maxalarmhistory"`
77 // RICAlarm is an alarm instance
78 type RICAlarm struct {
89 RIC_ALARM_UPDATE = 13111
90 RIC_ALARM_QUERY = 13112
93 // Temp alarm constants & definitions
95 E2_CONNECTION_PROBLEM int = 72004
96 ACTIVE_ALARM_EXCEED_MAX_THRESHOLD int = 72007
97 ALARM_HISTORY_EXCEED_MAX_THRESHOLD int = 72008
100 type AlarmDefinition struct {
101 AlarmId int `json:"alarmId"`
102 AlarmText string `json:"alarmText"`
103 EventType string `json:"eventType"`
104 OperationInstructions string `json:"operationInstructions"`
105 RaiseDelay int `json:"raiseDelay"`
106 ClearDelay int `json:"clearDelay"`
107 TimeToLive int `json:"timeToLive"`
110 var RICAlarmDefinitions map[int]*AlarmDefinition
111 var RICPerfAlarmObjects map[int]*Alarm
114 namespace = os.Getenv("PLT_NAMESPACE")
115 ALARM_MANAGER_HTTP_URL string = fmt.Sprintf("http://service-%s-alarmmanager-http.%s:8080", namespace, namespace)
116 ALARM_MANAGER_RMR_URL string = fmt.Sprintf("service-%s-alarmmanager-rmr.%s:4560", namespace, namespace)