xref: /openbmc/bmcweb/redfish-core/include/registries/storage_device_message_registry.hpp (revision 4a102cd48c588d32c0a4d6610b4a9ed616f255f3)
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 StorageDevice
23 {
24 static constexpr Header header = {
25     "Copyright 2020-2023 DMTF. All rights reserved.",
26     "#MessageRegistry.v1_6_2.MessageRegistry",
27     1,
28     2,
29     1,
30     "Storage Device Message Registry",
31     "en",
32     "This registry defines the messages for storage devices.",
33     "StorageDevice",
34     "DMTF",
35 };
36 
37 static constexpr const char* url =
38     "https://redfish.dmtf.org/registries/StorageDevice.1.2.1.json";
39 
40 static constexpr std::array registry =
41 {
42     MessageEntry{
43         "BatteryCharging",
44         {
45             "A battery charging condition was detected.",
46             "A charging condition for the battery located in '%1' was detected.",
47             "Warning",
48             1,
49             {
50                 "string",
51             },
52             "None.  There may be reduced performance and features while the battery is charging.",
53         }},
54     MessageEntry{
55         "BatteryFailure",
56         {
57             "A battery failure condition was detected.",
58             "A failure condition for the battery located in '%1' was detected.",
59             "Critical",
60             1,
61             {
62                 "string",
63             },
64             "Ensure all cables are properly and securely connected.  Replace the failed battery.",
65         }},
66     MessageEntry{
67         "BatteryMissing",
68         {
69             "A battery missing condition was detected.",
70             "The battery located in '%1' is missing.",
71             "Critical",
72             1,
73             {
74                 "string",
75             },
76             "Attach the battery.  Ensure all cables are properly and securely connected.",
77         }},
78     MessageEntry{
79         "BatteryOK",
80         {
81             "The health of a battery has changed to OK.",
82             "The health of the battery located in '%1' has changed to OK.",
83             "OK",
84             1,
85             {
86                 "string",
87             },
88             "None.",
89         }},
90     MessageEntry{
91         "ControllerDegraded",
92         {
93             "A storage controller degraded condition was detected.",
94             "A degraded condition for the storage controller located in '%1' was detected due to reason '%2'.",
95             "Warning",
96             2,
97             {
98                 "string",
99                 "string",
100             },
101             "Reseat the storage controller in the PCI slot.  Update the controller to the latest firmware version.  If the issue persists, replace the controller.",
102         }},
103     MessageEntry{
104         "ControllerFailure",
105         {
106             "A storage controller failure was detected.",
107             "A failure condition for the storage controller located in '%1' was detected.",
108             "Critical",
109             1,
110             {
111                 "string",
112             },
113             "Reseat the storage controller in the PCI slot.  Update the controller to the latest firmware version.  If the issue persists, replace the controller.",
114         }},
115     MessageEntry{
116         "ControllerOK",
117         {
118             "The storage controller health has changed to OK.",
119             "The health of the storage controller located in '%1' has changed to OK.",
120             "OK",
121             1,
122             {
123                 "string",
124             },
125             "None.",
126         }},
127     MessageEntry{
128         "ControllerPasswordAccepted",
129         {
130             "The storage controller password was entered.",
131             "A password was entered for the storage controller located in '%1'.",
132             "OK",
133             1,
134             {
135                 "string",
136             },
137             "None.",
138         }},
139     MessageEntry{
140         "ControllerPasswordRequired",
141         {
142             "The storage controller requires a password.",
143             "The storage controller located in '%1' requires a password.",
144             "Critical",
145             1,
146             {
147                 "string",
148             },
149             "Enter the controller password.",
150         }},
151     MessageEntry{
152         "ControllerPortDegraded",
153         {
154             "A controller port degraded condition was detected.",
155             "A degraded condition for the controller port located in '%1' was detected due to reason '%2'.",
156             "Warning",
157             2,
158             {
159                 "string",
160                 "string",
161             },
162             "Ensure all cables are properly and securely connected.  Replace faulty cables.",
163         }},
164     MessageEntry{
165         "ControllerPortFailure",
166         {
167             "A controller port failure condition was detected.",
168             "A failure condition for the controller port located in '%1' was detected.",
169             "Critical",
170             1,
171             {
172                 "string",
173             },
174             "Ensure all cables are properly and securely connected.  Replace faulty cables.",
175         }},
176     MessageEntry{
177         "ControllerPortOK",
178         {
179             "The health of a controller port has changed to OK.",
180             "The health of the controller port located in '%1' has changed to OK.",
181             "OK",
182             1,
183             {
184                 "string",
185             },
186             "None.",
187         }},
188     MessageEntry{
189         "ControllerPreviousError",
190         {
191             "A storage controller error was detected prior to reboot.",
192             "A previous error condition for the storage controller located in '%1' was detected due to '%2'.",
193             "Warning",
194             2,
195             {
196                 "string",
197                 "string",
198             },
199             "Update the controller to the latest firmware version.  If the issue persists, replace the controller.",
200         }},
201     MessageEntry{
202         "DriveFailure",
203         {
204             "A drive failure condition was detected.",
205             "A failure condition for the drive located in '%1' was detected.",
206             "Critical",
207             1,
208             {
209                 "string",
210             },
211             "Ensure all cables are properly and securely connected.  Ensure all drives are fully seated.  Replace the defective cables, drive, or both.",
212         }},
213     MessageEntry{
214         "DriveFailureCleared",
215         {
216             "A previously detected failure condition on a drive was cleared.",
217             "A failure condition for the drive located in '%1' was cleared.",
218             "OK",
219             1,
220             {
221                 "string",
222             },
223             "None.",
224         }},
225     MessageEntry{
226         "DriveInserted",
227         {
228             "A drive was inserted.",
229             "The drive located in '%1' was inserted.",
230             "OK",
231             1,
232             {
233                 "string",
234             },
235             "If the drive is not properly displayed, attempt to refresh the cached data.",
236         }},
237     MessageEntry{
238         "DriveMissing",
239         {
240             "A drive missing condition was detected.",
241             "A missing condition for the drive located in '%1' was detected.",
242             "Critical",
243             1,
244             {
245                 "string",
246             },
247             "Ensure all cables are properly and securely connected.  Ensure all drives are fully seated.  Replace the defective cables, drive, or both.  Delete the volume if it is no longer needed.",
248         }},
249     MessageEntry{
250         "DriveMissingCleared",
251         {
252             "A previous drive missing condition was cleared.",
253             "A missing condition for the drive located in '%1' was cleared.",
254             "OK",
255             1,
256             {
257                 "string",
258             },
259             "None.",
260         }},
261     MessageEntry{
262         "DriveOK",
263         {
264             "The health of a drive has changed to OK.",
265             "The health of the drive located in '%1' has changed to OK.",
266             "OK",
267             1,
268             {
269                 "string",
270             },
271             "None.",
272         }},
273     MessageEntry{
274         "DriveOffline",
275         {
276             "A drive offline condition was detected.",
277             "An offline condition for the drive located in '%1' was detected.",
278             "Critical",
279             1,
280             {
281                 "string",
282             },
283             "If the drive is unconfigured or needs an import, configure the drive.  If the drive operation is in progress, wait for the operation to complete.  If the drive is not supported, replace it.",
284         }},
285     MessageEntry{
286         "DriveOfflineCleared",
287         {
288             "A drive offline condition was cleared.",
289             "An offline condition for the drive located in '%1' was cleared.",
290             "OK",
291             1,
292             {
293                 "string",
294             },
295             "None.",
296         }},
297     MessageEntry{
298         "DrivePredictiveFailure",
299         {
300             "A predictive drive failure condition was detected.",
301             "A predictive failure condition for the drive located in '%1' was detected.",
302             "Warning",
303             1,
304             {
305                 "string",
306             },
307             "If this drive is not part of a fault-tolerant volume, first back up all data, then replace the drive and restore all data afterward.  If this drive is part of a fault-tolerant volume, replace this drive as soon as possible as long as the volume health is OK.",
308         }},
309     MessageEntry{
310         "DrivePredictiveFailureCleared",
311         {
312             "A previously detected predictive failure condition on a drive was cleared.",
313             "A predictive failure condition for the drive located in '%1' was cleared.",
314             "OK",
315             1,
316             {
317                 "string",
318             },
319             "None.",
320         }},
321     MessageEntry{
322         "DriveRemoved",
323         {
324             "A drive was removed.",
325             "The drive located in '%1' was removed.",
326             "Critical",
327             1,
328             {
329                 "string",
330             },
331             "If the drive is still displayed, attempt to refresh the cached data.",
332         }},
333     MessageEntry{
334         "VolumeDegraded",
335         {
336             "The storage controller has detected a degraded volume condition.",
337             "The volume '%1' attached to the storage controller located in '%2' is degraded.",
338             "Warning",
339             2,
340             {
341                 "string",
342                 "string",
343             },
344             "Ensure all cables are properly and securely connected.  Replace failed drives.",
345         }},
346     MessageEntry{
347         "VolumeFailure",
348         {
349             "The storage controller has detected a failed volume condition.",
350             "The volume '%1' attached to the storage controller located in '%2' has failed.",
351             "Critical",
352             2,
353             {
354                 "string",
355                 "string",
356             },
357             "Ensure all cables are properly and securely connected.  Ensure all drives are fully seated and operational.",
358         }},
359     MessageEntry{
360         "VolumeOK",
361         {
362             "A volume health has changed to OK.",
363             "The health of volume '%1' that is attached to the storage controller located in '%2' has changed to OK.",
364             "OK",
365             2,
366             {
367                 "string",
368                 "string",
369             },
370             "None.",
371         }},
372     MessageEntry{
373         "VolumeOffine",
374         {
375             "The storage controller has detected an offline volume condition.",
376             "The volume '%1' attached to the storage controller located in '%2' is offline.",
377             "Critical",
378             2,
379             {
380                 "string",
381                 "string",
382             },
383             "Use storage software to enable, repair, or import the volume.  You may also delete or move volume back to the original controller.",
384         }},
385     MessageEntry{
386         "VolumeOffline",
387         {
388             "The storage controller has detected an offline volume condition.",
389             "The volume '%1' attached to the storage controller located in '%2' is offline.",
390             "Critical",
391             2,
392             {
393                 "string",
394                 "string",
395             },
396             "Use storage software to enable, repair, or import the volume.  You may also delete or move volume back to the original controller.",
397         }},
398     MessageEntry{
399         "VolumeOfflineCleared",
400         {
401             "The storage controller has detected an online volume condition.",
402             "The volume '%1' attached to the storage controller located in '%2' is online.",
403             "OK",
404             2,
405             {
406                 "string",
407                 "string",
408             },
409             "None.",
410         }},
411     MessageEntry{
412         "WriteCacheDataLoss",
413         {
414             "The write cache is reporting loss of data in posted-writes memory.",
415             "The write cache on the storage controller located in '%1' has data loss.",
416             "Critical",
417             1,
418             {
419                 "string",
420             },
421             "Check the controller resource properties to determine the cause of the write cache data loss.",
422         }},
423     MessageEntry{
424         "WriteCacheDegraded",
425         {
426             "The write cache state is degraded.",
427             "The write cache state on the storage controller located in '%1' is degraded.",
428             "Critical",
429             1,
430             {
431                 "string",
432             },
433             "Check the controller to determine the cause of write cache degraded state, such as a missing battery or hardware failure.",
434         }},
435     MessageEntry{
436         "WriteCacheProtected",
437         {
438             "A storage controller write cache state is in protected mode.",
439             "The write cache state on the storage controller located in '%1' is in protected mode.",
440             "OK",
441             1,
442             {
443                 "string",
444             },
445             "None.",
446         }},
447     MessageEntry{
448         "WriteCacheTemporarilyDegraded",
449         {
450             "The write cache state is temporarily degraded.",
451             "The write cache state on the storage controller located in '%1' is temporarily degraded.",
452             "Warning",
453             1,
454             {
455                 "string",
456             },
457             "Check the controller to determine the cause of write cache temporarily degraded state, such as a battery is charging or a data recovery rebuild operation is pending.",
458         }},
459 
460 };
461 
462 enum class Index
463 {
464     batteryCharging = 0,
465     batteryFailure = 1,
466     batteryMissing = 2,
467     batteryOK = 3,
468     controllerDegraded = 4,
469     controllerFailure = 5,
470     controllerOK = 6,
471     controllerPasswordAccepted = 7,
472     controllerPasswordRequired = 8,
473     controllerPortDegraded = 9,
474     controllerPortFailure = 10,
475     controllerPortOK = 11,
476     controllerPreviousError = 12,
477     driveFailure = 13,
478     driveFailureCleared = 14,
479     driveInserted = 15,
480     driveMissing = 16,
481     driveMissingCleared = 17,
482     driveOK = 18,
483     driveOffline = 19,
484     driveOfflineCleared = 20,
485     drivePredictiveFailure = 21,
486     drivePredictiveFailureCleared = 22,
487     driveRemoved = 23,
488     volumeDegraded = 24,
489     volumeFailure = 25,
490     volumeOK = 26,
491     volumeOffine = 27,
492     volumeOffline = 28,
493     volumeOfflineCleared = 29,
494     writeCacheDataLoss = 30,
495     writeCacheDegraded = 31,
496     writeCacheProtected = 32,
497     writeCacheTemporarilyDegraded = 33,
498 };
499 }; // struct storage_device
500 
registerStorageDevice()501 [[gnu::constructor]] inline void registerStorageDevice()
502 { registerRegistry<StorageDevice>(); }
503 
504 } // namespace redfish::registries
505