1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3 #pragma once
4 /****************************************************************
5 * READ THIS WARNING FIRST
6 * This is an auto-generated header which contains definitions
7 * for Redfish DMTF defined messages.
8 * DO NOT modify this registry outside of running the
9 * parse_registries.py script. The definitions contained within
10 * this file are owned by DMTF. Any modifications to these files
11 * should be first pushed to the relevant registry in the DMTF
12 * github organization.
13 ***************************************************************/
14 #include "registries.hpp"
15
16 #include <array>
17
18 // clang-format off
19
20 namespace redfish::registries
21 {
22 struct SensorEvent
23 {
24 static constexpr Header header = {
25 "Copyright 2022-2023 DMTF. All rights reserved.",
26 "#MessageRegistry.v1_6_2.MessageRegistry",
27 1,
28 0,
29 1,
30 "Sensor Event Message Registry",
31 "en",
32 "This registry defines messages used for general events related to Sensor resources.",
33 "SensorEvent",
34 "DMTF",
35 };
36
37 static constexpr const char* url =
38 "https://redfish.dmtf.org/registries/SensorEvent.1.0.1.json";
39
40 static constexpr std::array registry =
41 {
42 MessageEntry{
43 "InvalidSensorReading",
44 {
45 "Indicates that the service received an invalid reading from a sensor.",
46 "Invalid reading received from sensor '%1'.",
47 "Warning",
48 1,
49 {
50 "string",
51 },
52 "Check the sensor hardware or connection.",
53 }},
54 MessageEntry{
55 "ReadingAboveLowerCriticalThreshold",
56 {
57 "Indicates that a sensor reading is no longer below the lower critical threshold but is still outside of normal operating range.",
58 "Sensor '%1' reading of %2 (%3) is now above the %4 lower critical threshold but remains outside of normal range.",
59 "Warning",
60 4,
61 {
62 "string",
63 "number",
64 "string",
65 "number",
66 },
67 "Check the condition of the resources listed in RelatedItem.",
68 }},
69 MessageEntry{
70 "ReadingAboveLowerFatalThreshold",
71 {
72 "Indicates that a sensor reading is no longer below the lower fatal threshold but is still outside of normal operating range.",
73 "Sensor '%1' reading of %2 (%3) is now above the %4 lower fatal threshold but remains outside of normal range.",
74 "Critical",
75 4,
76 {
77 "string",
78 "number",
79 "string",
80 "number",
81 },
82 "Check the condition of the resources listed in RelatedItem.",
83 }},
84 MessageEntry{
85 "ReadingAboveUpperCautionThreshold",
86 {
87 "Indicates that a sensor reading is above the upper caution threshold.",
88 "Sensor '%1' reading of %2 (%3) is above the %4 upper caution threshold.",
89 "Warning",
90 4,
91 {
92 "string",
93 "number",
94 "string",
95 "number",
96 },
97 "Check the condition of the resources listed in RelatedItem.",
98 }},
99 MessageEntry{
100 "ReadingAboveUpperCriticalThreshold",
101 {
102 "Indicates that a sensor reading is above the upper critical threshold.",
103 "Sensor '%1' reading of %2 (%3) is above the %4 upper critical threshold.",
104 "Critical",
105 4,
106 {
107 "string",
108 "number",
109 "string",
110 "number",
111 },
112 "Check the condition of the resources listed in RelatedItem.",
113 }},
114 MessageEntry{
115 "ReadingAboveUpperFatalThreshold",
116 {
117 "Indicates that a sensor reading is above the upper fatal threshold.",
118 "Sensor '%1' reading of %2 (%3) is above the %4 upper fatal threshold.",
119 "Critical",
120 4,
121 {
122 "string",
123 "number",
124 "string",
125 "number",
126 },
127 "Check the condition of the resources listed in RelatedItem.",
128 }},
129 MessageEntry{
130 "ReadingBelowLowerCautionThreshold",
131 {
132 "Indicates that a sensor reading is below the lower caution threshold.",
133 "Sensor '%1' reading of %2 (%3) is below the %4 lower caution threshold.",
134 "Warning",
135 4,
136 {
137 "string",
138 "number",
139 "string",
140 "number",
141 },
142 "Check the condition of the resources listed in RelatedItem.",
143 }},
144 MessageEntry{
145 "ReadingBelowLowerCriticalThreshold",
146 {
147 "Indicates that a sensor reading is below the lower critical threshold.",
148 "Sensor '%1' reading of %2 (%3) is below the %4 lower critical threshold.",
149 "Critical",
150 4,
151 {
152 "string",
153 "number",
154 "string",
155 "number",
156 },
157 "Check the condition of the resources listed in RelatedItem.",
158 }},
159 MessageEntry{
160 "ReadingBelowLowerFatalThreshold",
161 {
162 "Indicates that a sensor reading is below the lower fatal threshold.",
163 "Sensor '%1' reading of %2 (%3) is below the %4 lower fatal threshold.",
164 "Critical",
165 4,
166 {
167 "string",
168 "number",
169 "string",
170 "number",
171 },
172 "Check the condition of the resources listed in RelatedItem.",
173 }},
174 MessageEntry{
175 "ReadingBelowUpperCriticalThreshold",
176 {
177 "Indicates that a sensor reading is no longer above the upper critical threshold but is still outside of normal operating range.",
178 "Sensor '%1' reading of %2 (%3) is now below the %4 upper critical threshold but remains outside of normal range.",
179 "Warning",
180 4,
181 {
182 "string",
183 "number",
184 "string",
185 "number",
186 },
187 "Check the condition of the resources listed in RelatedItem.",
188 }},
189 MessageEntry{
190 "ReadingBelowUpperFatalThreshold",
191 {
192 "Indicates that a sensor reading is no longer above the upper fatal threshold but is still outside of normal operating range.",
193 "Sensor '%1' reading of %2 (%3) is now below the %4 upper fatal threshold but remains outside of normal range.",
194 "Critical",
195 4,
196 {
197 "string",
198 "number",
199 "string",
200 "number",
201 },
202 "Check the condition of the resources listed in RelatedItem.",
203 }},
204 MessageEntry{
205 "ReadingCritical",
206 {
207 "Indicates that a sensor reading exceeds an internal critical level.",
208 "Sensor '%1' reading of %2 (%3) exceeds the critical level.",
209 "Critical",
210 3,
211 {
212 "string",
213 "number",
214 "string",
215 },
216 "Check the condition of the resources listed in RelatedItem.",
217 }},
218 MessageEntry{
219 "ReadingNoLongerCritical",
220 {
221 "Indicates that a sensor reading no longer exceeds an internal critical level but still exceeds an internal warning level.",
222 "Sensor '%1' reading of %2 (%3) no longer exceeds the critical level.",
223 "Warning",
224 3,
225 {
226 "string",
227 "number",
228 "string",
229 },
230 "Check the condition of the resources listed in RelatedItem.",
231 }},
232 MessageEntry{
233 "ReadingWarning",
234 {
235 "Indicates that a sensor reading exceeds an internal warning level.",
236 "Sensor '%1' reading of %2 (%3) exceeds the warning level.",
237 "Warning",
238 3,
239 {
240 "string",
241 "number",
242 "string",
243 },
244 "Check the condition of the resources listed in RelatedItem.",
245 }},
246 MessageEntry{
247 "SensorFailure",
248 {
249 "Indicates that the service cannot communicate with a sensor or has detected a failure.",
250 "Sensor '%1' has failed.",
251 "Warning",
252 1,
253 {
254 "string",
255 },
256 "Check the sensor hardware or connection.",
257 }},
258 MessageEntry{
259 "SensorReadingNormalRange",
260 {
261 "Indicates that a sensor reading is now within normal operating range.",
262 "Sensor '%1' reading of %2 (%3) is within normal operating range.",
263 "OK",
264 3,
265 {
266 "string",
267 "number",
268 "string",
269 },
270 "None.",
271 }},
272 MessageEntry{
273 "SensorRestored",
274 {
275 "Indicates that a sensor was repaired or communications were restored. It may also indicate that the service is receiving valid data from a sensor.",
276 "Sensor '%1' was restored.",
277 "OK",
278 1,
279 {
280 "string",
281 },
282 "None.",
283 }},
284
285 };
286
287 enum class Index
288 {
289 invalidSensorReading = 0,
290 readingAboveLowerCriticalThreshold = 1,
291 readingAboveLowerFatalThreshold = 2,
292 readingAboveUpperCautionThreshold = 3,
293 readingAboveUpperCriticalThreshold = 4,
294 readingAboveUpperFatalThreshold = 5,
295 readingBelowLowerCautionThreshold = 6,
296 readingBelowLowerCriticalThreshold = 7,
297 readingBelowLowerFatalThreshold = 8,
298 readingBelowUpperCriticalThreshold = 9,
299 readingBelowUpperFatalThreshold = 10,
300 readingCritical = 11,
301 readingNoLongerCritical = 12,
302 readingWarning = 13,
303 sensorFailure = 14,
304 sensorReadingNormalRange = 15,
305 sensorRestored = 16,
306 };
307 }; // struct sensor_event
308
registerSensorEvent()309 [[gnu::constructor]] inline void registerSensorEvent()
310 { registerRegistry<SensorEvent>(); }
311
312 } // namespace redfish::registries
313