xref: /openbmc/bmcweb/redfish-core/include/registries/resource_event_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 ResourceEvent
23 {
24 static constexpr Header header = {
25     "Copyright 2014-2023 DMTF in cooperation with the Storage Networking Industry Association (SNIA). All rights reserved.",
26     "#MessageRegistry.v1_6_0.MessageRegistry",
27     1,
28     3,
29     0,
30     "Resource Event Message Registry",
31     "en",
32     "This registry defines the messages to use for resource events.",
33     "ResourceEvent",
34     "DMTF",
35 };
36 
37 static constexpr const char* url =
38     "https://redfish.dmtf.org/registries/ResourceEvent.1.3.0.json";
39 
40 static constexpr std::array registry =
41 {
42     MessageEntry{
43         "AggregationSourceDiscovered",
44         {
45             "Indicates that a new aggregation source has been discovered.",
46             "A aggregation source of connection method `%1` located at `%2` has been discovered.",
47             "OK",
48             2,
49             {
50                 "string",
51                 "string",
52             },
53             "The aggregation source is available to the service and can be identified using the identified connection method.",
54         }},
55     MessageEntry{
56         "LicenseAdded",
57         {
58             "Indicates that a license has been added.",
59             "A license for '%1' has been added.  The following message was returned: '%2'.",
60             "OK",
61             2,
62             {
63                 "string",
64                 "string",
65             },
66             "See vendor specific instructions for specific actions.",
67         }},
68     MessageEntry{
69         "LicenseChanged",
70         {
71             "Indicates that a license has changed.",
72             "A license for '%1' has changed.  The following message was returned: '%2'.",
73             "Warning",
74             2,
75             {
76                 "string",
77                 "string",
78             },
79             "See vendor specific instructions for specific actions.",
80         }},
81     MessageEntry{
82         "LicenseExpired",
83         {
84             "Indicates that a license has expired.",
85             "A license for '%1' has expired.  The following message was returned: '%2'.",
86             "Warning",
87             2,
88             {
89                 "string",
90                 "string",
91             },
92             "See vendor specific instructions for specific actions.",
93         }},
94     MessageEntry{
95         "ResourceChanged",
96         {
97             "Indicates that one or more resource properties have changed.  This is not used whenever there is another event message for that specific change, such as only the state has changed.",
98             "One or more resource properties have changed.",
99             "OK",
100             0,
101             {},
102             "None.",
103         }},
104     MessageEntry{
105         "ResourceCreated",
106         {
107             "Indicates that all conditions of a successful creation operation have been met.",
108             "The resource has been created successfully.",
109             "OK",
110             0,
111             {},
112             "None",
113         }},
114     MessageEntry{
115         "ResourceErrorThresholdCleared",
116         {
117             "Indicates that a specified resource property has cleared its error threshold.  Examples would be drive I/O errors, or network link errors.",
118             "The resource property %1 has cleared the error threshold of value %2.",
119             "OK",
120             2,
121             {
122                 "string",
123                 "number",
124             },
125             "None.",
126         }},
127     MessageEntry{
128         "ResourceErrorThresholdExceeded",
129         {
130             "Indicates that a specified resource property has exceeded its error threshold.  Examples would be drive I/O errors, or network link errors.",
131             "The resource property %1 has exceeded error threshold of value %2.",
132             "Critical",
133             2,
134             {
135                 "string",
136                 "number",
137             },
138             "None.",
139         }},
140     MessageEntry{
141         "ResourceErrorsCorrected",
142         {
143             "Indicates that a specified resource property has corrected errors.  Examples would be drive I/O errors, or network link errors.",
144             "The resource property %1 has corrected errors of type '%2'.",
145             "OK",
146             2,
147             {
148                 "string",
149                 "string",
150             },
151             "None.",
152         }},
153     MessageEntry{
154         "ResourceErrorsDetected",
155         {
156             "Indicates that a specified resource property has detected errors.  Examples would be drive I/O errors, or network link errors.",
157             "The resource property %1 has detected errors of type '%2'.",
158             "Warning",
159             2,
160             {
161                 "string",
162                 "string",
163             },
164             "Resolution dependent upon error type.",
165         }},
166     MessageEntry{
167         "ResourcePaused",
168         {
169             "Indicates that the power state of a resource has changed to paused.",
170             "The resource `%1` has been paused.",
171             "OK",
172             1,
173             {
174                 "string",
175             },
176             "None.",
177         }},
178     MessageEntry{
179         "ResourcePoweredOff",
180         {
181             "Indicates that the power state of a resource has changed to powered off.",
182             "The resource `%1` has powered off.",
183             "OK",
184             1,
185             {
186                 "string",
187             },
188             "None.",
189         }},
190     MessageEntry{
191         "ResourcePoweredOn",
192         {
193             "Indicates that the power state of a resource has changed to powered on.",
194             "The resource `%1` has powered on.",
195             "OK",
196             1,
197             {
198                 "string",
199             },
200             "None.",
201         }},
202     MessageEntry{
203         "ResourcePoweringOff",
204         {
205             "Indicates that the power state of a resource has changed to powering off.",
206             "The resource `%1` is powering off.",
207             "OK",
208             1,
209             {
210                 "string",
211             },
212             "None.",
213         }},
214     MessageEntry{
215         "ResourcePoweringOn",
216         {
217             "Indicates that the power state of a resource has changed to powering on.",
218             "The resource `%1` is powering on.",
219             "OK",
220             1,
221             {
222                 "string",
223             },
224             "None.",
225         }},
226     MessageEntry{
227         "ResourceRemoved",
228         {
229             "Indicates that all conditions of a successful remove operation have been met.",
230             "The resource has been removed successfully.",
231             "OK",
232             0,
233             {},
234             "None",
235         }},
236     MessageEntry{
237         "ResourceSelfTestCompleted",
238         {
239             "Indicates that a self-test has completed.",
240             "A self-test has completed.",
241             "OK",
242             0,
243             {},
244             "None.",
245         }},
246     MessageEntry{
247         "ResourceSelfTestFailed",
248         {
249             "Indicates that a self-test has failed.  Suggested resolution may be provided as OEM data.",
250             "A self-test has failed.  The following message was returned: '%1'.",
251             "Critical",
252             1,
253             {
254                 "string",
255             },
256             "See vendor specific instructions for specific actions.",
257         }},
258     MessageEntry{
259         "ResourceStateChanged",
260         {
261             "Indicates that the state of a resource has changed.",
262             "The state of resource `%1` has changed to %2.",
263             "OK",
264             2,
265             {
266                 "string",
267                 "string",
268             },
269             "None.",
270         }},
271     MessageEntry{
272         "ResourceStatusChangedCritical",
273         {
274             "Indicates that the health of a resource has changed to Critical.",
275             "The health of resource `%1` has changed to %2.",
276             "Critical",
277             2,
278             {
279                 "string",
280                 "string",
281             },
282             "None.",
283         }},
284     MessageEntry{
285         "ResourceStatusChangedOK",
286         {
287             "Indicates that the health of a resource has changed to OK.",
288             "The health of resource '%1' has changed to %2.",
289             "OK",
290             2,
291             {
292                 "string",
293                 "string",
294             },
295             "None.",
296         }},
297     MessageEntry{
298         "ResourceStatusChangedWarning",
299         {
300             "Indicates that the health of a resource has changed to Warning.",
301             "The health of resource `%1` has changed to %2.",
302             "Warning",
303             2,
304             {
305                 "string",
306                 "string",
307             },
308             "None.",
309         }},
310     MessageEntry{
311         "ResourceVersionIncompatible",
312         {
313             "Indicates that an incompatible version of software has been detected.  Examples may be after a component or system level software update.",
314             "An incompatible version of software '%1' has been detected.",
315             "Warning",
316             1,
317             {
318                 "string",
319             },
320             "Compare the version of the resource with the compatible version of the software.",
321         }},
322     MessageEntry{
323         "ResourceWarningThresholdCleared",
324         {
325             "Indicates that a specified resource property has cleared its warning threshold.  Examples would be drive I/O errors, or network link errors.  Suggested resolution may be provided as OEM data.",
326             "The resource property %1 has cleared the warning threshold of value %2.",
327             "OK",
328             2,
329             {
330                 "string",
331                 "number",
332             },
333             "None.",
334         }},
335     MessageEntry{
336         "ResourceWarningThresholdExceeded",
337         {
338             "Indicates that a specified resource property has exceeded its warning threshold.  Examples would be drive I/O errors, or network link errors.  Suggested resolution may be provided as OEM data.",
339             "The resource property %1 has exceeded its warning threshold of value %2.",
340             "Warning",
341             2,
342             {
343                 "string",
344                 "number",
345             },
346             "None.",
347         }},
348     MessageEntry{
349         "TestMessage",
350         {
351             "A test message used to validate event delivery mechanisms.",
352             "Test message.",
353             "OK",
354             0,
355             {},
356             "None.",
357         }},
358     MessageEntry{
359         "URIForResourceChanged",
360         {
361             "Indicates that the URI for a resource has changed.  Examples for this would be physical component replacement or redistribution.",
362             "The URI for the resource has changed.",
363             "OK",
364             0,
365             {},
366             "None.",
367         }},
368 
369 };
370 
371 enum class Index
372 {
373     aggregationSourceDiscovered = 0,
374     licenseAdded = 1,
375     licenseChanged = 2,
376     licenseExpired = 3,
377     resourceChanged = 4,
378     resourceCreated = 5,
379     resourceErrorThresholdCleared = 6,
380     resourceErrorThresholdExceeded = 7,
381     resourceErrorsCorrected = 8,
382     resourceErrorsDetected = 9,
383     resourcePaused = 10,
384     resourcePoweredOff = 11,
385     resourcePoweredOn = 12,
386     resourcePoweringOff = 13,
387     resourcePoweringOn = 14,
388     resourceRemoved = 15,
389     resourceSelfTestCompleted = 16,
390     resourceSelfTestFailed = 17,
391     resourceStateChanged = 18,
392     resourceStatusChangedCritical = 19,
393     resourceStatusChangedOK = 20,
394     resourceStatusChangedWarning = 21,
395     resourceVersionIncompatible = 22,
396     resourceWarningThresholdCleared = 23,
397     resourceWarningThresholdExceeded = 24,
398     testMessage = 25,
399     uRIForResourceChanged = 26,
400 };
401 }; // struct resource_event
402 
registerResourceEvent()403 [[gnu::constructor]] inline void registerResourceEvent()
404 { registerRegistry<ResourceEvent>(); }
405 
406 } // namespace redfish::registries
407