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 AdditionalInfo string `json:"additionalInfo"`
53 IdentifyingInfo string `json:"identifyingInfo"`
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 {
88 RIC_ALARM_UPDATE = 13111
89 RIC_ALARM_QUERY = 13112
92 // Temp alarm constants & definitions
94 RIC_RT_DISTRIBUTION_FAILED int = 8004
95 TCP_CONNECTIVITY_LOST_TO_DBAAS int = 8005
96 E2_CONNECTIVITY_LOST_TO_GNODEB int = 8006
97 E2_CONNECTIVITY_LOST_TO_ENODEB int = 8007
98 ACTIVE_ALARM_EXCEED_MAX_THRESHOLD int = 8008
99 ALARM_HISTORY_EXCEED_MAX_THRESHOLD int = 8009
102 type AlarmDefinition struct {
103 AlarmId int `json:"alarmId"`
104 AlarmText string `json:"alarmText"`
105 EventType string `json:"eventType"`
106 OperationInstructions string `json:"operationInstructions"`
107 RaiseDelay int `json:"raiseDelay"`
108 ClearDelay int `json:"clearDelay"`
109 TimeToLive int `json:"timeToLive"`
112 var RICAlarmDefinitions map[int]*AlarmDefinition
113 var RICPerfAlarmObjects map[int]*Alarm
116 namespace = os.Getenv("PLT_NAMESPACE")
117 ALARM_MANAGER_HTTP_URL string = fmt.Sprintf("http://service-%s-alarmmanager-http.%s:8080", namespace, namespace)
118 ALARM_MANAGER_RMR_URL string = fmt.Sprintf("service-%s-alarmmanager-rmr.%s:4560", namespace, namespace)