blob: 17ef0c42aa6e9755763718980b91d7613f4ede19 [file] [log] [blame]
Ed Tanous847deee2024-12-02 15:28:10 -08001/****************************************************************
2 * READ THIS WARNING FIRST
3 * This is an auto-generated header which contains definitions
4 * for Redfish DMTF defined messages.
5 * DO NOT modify this registry outside of running the
6 * parse_registries.py script. The definitions contained within
7 * this file are owned by DMTF. Any modifications to these files
8 * should be first pushed to the relevant registry in the DMTF
9 * github organization.
10 ***************************************************************/
11#include "resource_messages.hpp"
12
13#include "registries.hpp"
14#include "registries/resource_event_message_registry.hpp"
15
16#include <nlohmann/json.hpp>
17
18#include <array>
19#include <cstddef>
20#include <span>
21#include <string_view>
22
23// Clang can't seem to decide whether this header needs to be included or not,
24// and is inconsistent. Include it for now
25// NOLINTNEXTLINE(misc-include-cleaner)
26#include <utility>
27
28namespace redfish
29{
30
31namespace messages
32{
33
Ed Tanous10cf50d2025-05-06 16:10:32 -070034static nlohmann::json::object_t getLog(
35 redfish::registries::ResourceEvent::Index name,
36 std::span<const std::string_view> args)
Ed Tanous847deee2024-12-02 15:28:10 -080037{
38 size_t index = static_cast<size_t>(name);
Patrick Williams4a102cd2025-02-27 14:52:54 -050039 if (index >= redfish::registries::ResourceEvent::registry.size())
Ed Tanous847deee2024-12-02 15:28:10 -080040 {
41 return {};
42 }
Patrick Williams4a102cd2025-02-27 14:52:54 -050043 return getLogFromRegistry(redfish::registries::ResourceEvent::header,
44 redfish::registries::ResourceEvent::registry,
Ed Tanous847deee2024-12-02 15:28:10 -080045 index, args);
46}
47
48/**
49 * @internal
50 * @brief Formats ResourceCreated message into JSON
51 *
52 * See header file for more information
53 * @endinternal
54 */
Ed Tanous10cf50d2025-05-06 16:10:32 -070055nlohmann::json::object_t resourceCreated()
Ed Tanous847deee2024-12-02 15:28:10 -080056{
Patrick Williams4a102cd2025-02-27 14:52:54 -050057 return getLog(redfish::registries::ResourceEvent::Index::resourceCreated,
Ed Tanous847deee2024-12-02 15:28:10 -080058 {});
59}
60
61/**
62 * @internal
63 * @brief Formats ResourceRemoved message into JSON
64 *
65 * See header file for more information
66 * @endinternal
67 */
Ed Tanous10cf50d2025-05-06 16:10:32 -070068nlohmann::json::object_t resourceRemoved()
Ed Tanous847deee2024-12-02 15:28:10 -080069{
Patrick Williams4a102cd2025-02-27 14:52:54 -050070 return getLog(redfish::registries::ResourceEvent::Index::resourceRemoved,
Ed Tanous847deee2024-12-02 15:28:10 -080071 {});
72}
73
74/**
75 * @internal
76 * @brief Formats ResourceErrorsDetected message into JSON
77 *
78 * See header file for more information
79 * @endinternal
80 */
Ed Tanous10cf50d2025-05-06 16:10:32 -070081nlohmann::json::object_t resourceErrorsDetected(std::string_view arg1,
82 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -080083{
84 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -050085 redfish::registries::ResourceEvent::Index::resourceErrorsDetected,
Ed Tanous847deee2024-12-02 15:28:10 -080086 std::to_array({arg1, arg2}));
87}
88
89/**
90 * @internal
91 * @brief Formats ResourceErrorsCorrected message into JSON
92 *
93 * See header file for more information
94 * @endinternal
95 */
Ed Tanous10cf50d2025-05-06 16:10:32 -070096nlohmann::json::object_t resourceErrorsCorrected(std::string_view arg1,
97 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -080098{
99 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500100 redfish::registries::ResourceEvent::Index::resourceErrorsCorrected,
Ed Tanous847deee2024-12-02 15:28:10 -0800101 std::to_array({arg1, arg2}));
102}
103
104/**
105 * @internal
106 * @brief Formats ResourceErrorThresholdExceeded message into JSON
107 *
108 * See header file for more information
109 * @endinternal
110 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700111nlohmann::json::object_t resourceErrorThresholdExceeded(std::string_view arg1,
112 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800113{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500114 return getLog(redfish::registries::ResourceEvent::Index::
Ed Tanous847deee2024-12-02 15:28:10 -0800115 resourceErrorThresholdExceeded,
116 std::to_array({arg1, arg2}));
117}
118
119/**
120 * @internal
121 * @brief Formats ResourceErrorThresholdCleared message into JSON
122 *
123 * See header file for more information
124 * @endinternal
125 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700126nlohmann::json::object_t resourceErrorThresholdCleared(std::string_view arg1,
127 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800128{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500129 return getLog(redfish::registries::ResourceEvent::Index::
Ed Tanous847deee2024-12-02 15:28:10 -0800130 resourceErrorThresholdCleared,
131 std::to_array({arg1, arg2}));
132}
133
134/**
135 * @internal
136 * @brief Formats ResourceWarningThresholdExceeded message into JSON
137 *
138 * See header file for more information
139 * @endinternal
140 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700141nlohmann::json::object_t resourceWarningThresholdExceeded(std::string_view arg1,
142 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800143{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500144 return getLog(redfish::registries::ResourceEvent::Index::
Ed Tanous847deee2024-12-02 15:28:10 -0800145 resourceWarningThresholdExceeded,
146 std::to_array({arg1, arg2}));
147}
148
149/**
150 * @internal
151 * @brief Formats ResourceWarningThresholdCleared message into JSON
152 *
153 * See header file for more information
154 * @endinternal
155 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700156nlohmann::json::object_t resourceWarningThresholdCleared(std::string_view arg1,
157 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800158{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500159 return getLog(redfish::registries::ResourceEvent::Index::
Ed Tanous847deee2024-12-02 15:28:10 -0800160 resourceWarningThresholdCleared,
161 std::to_array({arg1, arg2}));
162}
163
164/**
165 * @internal
166 * @brief Formats ResourceStatusChangedOK message into JSON
167 *
168 * See header file for more information
169 * @endinternal
170 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700171nlohmann::json::object_t resourceStatusChangedOK(std::string_view arg1,
172 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800173{
174 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500175 redfish::registries::ResourceEvent::Index::resourceStatusChangedOK,
Ed Tanous847deee2024-12-02 15:28:10 -0800176 std::to_array({arg1, arg2}));
177}
178
179/**
180 * @internal
181 * @brief Formats ResourceStatusChangedWarning message into JSON
182 *
183 * See header file for more information
184 * @endinternal
185 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700186nlohmann::json::object_t resourceStatusChangedWarning(std::string_view arg1,
187 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800188{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500189 return getLog(
190 redfish::registries::ResourceEvent::Index::resourceStatusChangedWarning,
191 std::to_array({arg1, arg2}));
Ed Tanous847deee2024-12-02 15:28:10 -0800192}
193
194/**
195 * @internal
196 * @brief Formats ResourceStatusChangedCritical message into JSON
197 *
198 * See header file for more information
199 * @endinternal
200 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700201nlohmann::json::object_t resourceStatusChangedCritical(std::string_view arg1,
202 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800203{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500204 return getLog(redfish::registries::ResourceEvent::Index::
Ed Tanous847deee2024-12-02 15:28:10 -0800205 resourceStatusChangedCritical,
206 std::to_array({arg1, arg2}));
207}
208
209/**
210 * @internal
211 * @brief Formats ResourceStateChanged message into JSON
212 *
213 * See header file for more information
214 * @endinternal
215 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700216nlohmann::json::object_t resourceStateChanged(std::string_view arg1,
217 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800218{
219 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500220 redfish::registries::ResourceEvent::Index::resourceStateChanged,
Ed Tanous847deee2024-12-02 15:28:10 -0800221 std::to_array({arg1, arg2}));
222}
223
224/**
225 * @internal
226 * @brief Formats ResourcePoweredOn message into JSON
227 *
228 * See header file for more information
229 * @endinternal
230 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700231nlohmann::json::object_t resourcePoweredOn(std::string_view arg1)
Ed Tanous847deee2024-12-02 15:28:10 -0800232{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500233 return getLog(redfish::registries::ResourceEvent::Index::resourcePoweredOn,
Ed Tanous847deee2024-12-02 15:28:10 -0800234 std::to_array({arg1}));
235}
236
237/**
238 * @internal
239 * @brief Formats ResourcePoweringOn message into JSON
240 *
241 * See header file for more information
242 * @endinternal
243 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700244nlohmann::json::object_t resourcePoweringOn(std::string_view arg1)
Ed Tanous847deee2024-12-02 15:28:10 -0800245{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500246 return getLog(redfish::registries::ResourceEvent::Index::resourcePoweringOn,
247 std::to_array({arg1}));
Ed Tanous847deee2024-12-02 15:28:10 -0800248}
249
250/**
251 * @internal
252 * @brief Formats ResourcePoweredOff message into JSON
253 *
254 * See header file for more information
255 * @endinternal
256 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700257nlohmann::json::object_t resourcePoweredOff(std::string_view arg1)
Ed Tanous847deee2024-12-02 15:28:10 -0800258{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500259 return getLog(redfish::registries::ResourceEvent::Index::resourcePoweredOff,
260 std::to_array({arg1}));
Ed Tanous847deee2024-12-02 15:28:10 -0800261}
262
263/**
264 * @internal
265 * @brief Formats ResourcePoweringOff message into JSON
266 *
267 * See header file for more information
268 * @endinternal
269 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700270nlohmann::json::object_t resourcePoweringOff(std::string_view arg1)
Ed Tanous847deee2024-12-02 15:28:10 -0800271{
272 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500273 redfish::registries::ResourceEvent::Index::resourcePoweringOff,
Ed Tanous847deee2024-12-02 15:28:10 -0800274 std::to_array({arg1}));
275}
276
277/**
278 * @internal
279 * @brief Formats ResourcePaused message into JSON
280 *
281 * See header file for more information
282 * @endinternal
283 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700284nlohmann::json::object_t resourcePaused(std::string_view arg1)
Ed Tanous847deee2024-12-02 15:28:10 -0800285{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500286 return getLog(redfish::registries::ResourceEvent::Index::resourcePaused,
Ed Tanous847deee2024-12-02 15:28:10 -0800287 std::to_array({arg1}));
288}
289
290/**
291 * @internal
292 * @brief Formats URIForResourceChanged message into JSON
293 *
294 * See header file for more information
295 * @endinternal
296 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700297nlohmann::json::object_t uRIForResourceChanged()
Ed Tanous847deee2024-12-02 15:28:10 -0800298{
299 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500300 redfish::registries::ResourceEvent::Index::uRIForResourceChanged, {});
Ed Tanous847deee2024-12-02 15:28:10 -0800301}
302
303/**
304 * @internal
305 * @brief Formats ResourceChanged message into JSON
306 *
307 * See header file for more information
308 * @endinternal
309 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700310nlohmann::json::object_t resourceChanged()
Ed Tanous847deee2024-12-02 15:28:10 -0800311{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500312 return getLog(redfish::registries::ResourceEvent::Index::resourceChanged,
Ed Tanous847deee2024-12-02 15:28:10 -0800313 {});
314}
315
316/**
317 * @internal
318 * @brief Formats ResourceVersionIncompatible message into JSON
319 *
320 * See header file for more information
321 * @endinternal
322 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700323nlohmann::json::object_t resourceVersionIncompatible(std::string_view arg1)
Ed Tanous847deee2024-12-02 15:28:10 -0800324{
325 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500326 redfish::registries::ResourceEvent::Index::resourceVersionIncompatible,
Ed Tanous847deee2024-12-02 15:28:10 -0800327 std::to_array({arg1}));
328}
329
330/**
331 * @internal
332 * @brief Formats ResourceSelfTestFailed message into JSON
333 *
334 * See header file for more information
335 * @endinternal
336 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700337nlohmann::json::object_t resourceSelfTestFailed(std::string_view arg1)
Ed Tanous847deee2024-12-02 15:28:10 -0800338{
339 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500340 redfish::registries::ResourceEvent::Index::resourceSelfTestFailed,
Ed Tanous847deee2024-12-02 15:28:10 -0800341 std::to_array({arg1}));
342}
343
344/**
345 * @internal
346 * @brief Formats ResourceSelfTestCompleted message into JSON
347 *
348 * See header file for more information
349 * @endinternal
350 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700351nlohmann::json::object_t resourceSelfTestCompleted()
Ed Tanous847deee2024-12-02 15:28:10 -0800352{
353 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500354 redfish::registries::ResourceEvent::Index::resourceSelfTestCompleted,
Ed Tanous847deee2024-12-02 15:28:10 -0800355 {});
356}
357
358/**
359 * @internal
360 * @brief Formats TestMessage message into JSON
361 *
362 * See header file for more information
363 * @endinternal
364 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700365nlohmann::json::object_t testMessage()
Ed Tanous847deee2024-12-02 15:28:10 -0800366{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500367 return getLog(redfish::registries::ResourceEvent::Index::testMessage, {});
Ed Tanous847deee2024-12-02 15:28:10 -0800368}
369
370/**
371 * @internal
372 * @brief Formats AggregationSourceDiscovered message into JSON
373 *
374 * See header file for more information
375 * @endinternal
376 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700377nlohmann::json::object_t aggregationSourceDiscovered(std::string_view arg1,
378 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800379{
380 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -0500381 redfish::registries::ResourceEvent::Index::aggregationSourceDiscovered,
Ed Tanous847deee2024-12-02 15:28:10 -0800382 std::to_array({arg1, arg2}));
383}
384
385/**
386 * @internal
387 * @brief Formats LicenseExpired message into JSON
388 *
389 * See header file for more information
390 * @endinternal
391 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700392nlohmann::json::object_t licenseExpired(std::string_view arg1,
393 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800394{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500395 return getLog(redfish::registries::ResourceEvent::Index::licenseExpired,
Ed Tanous847deee2024-12-02 15:28:10 -0800396 std::to_array({arg1, arg2}));
397}
398
399/**
400 * @internal
401 * @brief Formats LicenseChanged message into JSON
402 *
403 * See header file for more information
404 * @endinternal
405 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700406nlohmann::json::object_t licenseChanged(std::string_view arg1,
407 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800408{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500409 return getLog(redfish::registries::ResourceEvent::Index::licenseChanged,
Ed Tanous847deee2024-12-02 15:28:10 -0800410 std::to_array({arg1, arg2}));
411}
412
413/**
414 * @internal
415 * @brief Formats LicenseAdded message into JSON
416 *
417 * See header file for more information
418 * @endinternal
419 */
Ed Tanous10cf50d2025-05-06 16:10:32 -0700420nlohmann::json::object_t licenseAdded(std::string_view arg1,
421 std::string_view arg2)
Ed Tanous847deee2024-12-02 15:28:10 -0800422{
Patrick Williams4a102cd2025-02-27 14:52:54 -0500423 return getLog(redfish::registries::ResourceEvent::Index::licenseAdded,
Ed Tanous847deee2024-12-02 15:28:10 -0800424 std::to_array({arg1, arg2}));
425}
426
427} // namespace messages
428} // namespace redfish