blob: afaf0ac345592c0080f7b75eea4d49061b2d61e3 [file] [log] [blame]
Alexander Hansend3616d12025-08-12 13:25:55 +02001/****************************************************************
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 "update_messages.hpp"
12
13#include "registries.hpp"
14#include "registries/update_message_registry.hpp"
15
16#include <nlohmann/json.hpp>
17
18#include <array>
19#include <cstddef>
Alexander Hansend3616d12025-08-12 13:25:55 +020020#include <span>
Alexander Hansend3616d12025-08-12 13:25:55 +020021#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)
Ed Tanous2ca56192025-09-16 13:19:08 -070026#include <cstdint>
27// NOLINTNEXTLINE(misc-include-cleaner)
28#include <string>
29// NOLINTNEXTLINE(misc-include-cleaner)
Alexander Hansend3616d12025-08-12 13:25:55 +020030#include <utility>
31
32namespace redfish
33{
34
35namespace messages
36{
37
38static nlohmann::json::object_t getLog(redfish::registries::Update::Index name,
39 std::span<const std::string_view> args)
40{
41 size_t index = static_cast<size_t>(name);
42 if (index >= redfish::registries::Update::registry.size())
43 {
44 return {};
45 }
46 return getLogFromRegistry(redfish::registries::Update::header,
47 redfish::registries::Update::registry, index,
48 args);
49}
50
51/**
52 * @internal
53 * @brief Formats TargetDetermined message into JSON
54 *
55 * See header file for more information
56 * @endinternal
57 */
58nlohmann::json::object_t targetDetermined(std::string_view arg1,
59 std::string_view arg2)
60{
61 return getLog(redfish::registries::Update::Index::targetDetermined,
62 std::to_array({arg1, arg2}));
63}
64
65/**
66 * @internal
67 * @brief Formats AllTargetsDetermined message into JSON
68 *
69 * See header file for more information
70 * @endinternal
71 */
72nlohmann::json::object_t allTargetsDetermined()
73{
74 return getLog(redfish::registries::Update::Index::allTargetsDetermined, {});
75}
76
77/**
78 * @internal
79 * @brief Formats NoTargetsDetermined message into JSON
80 *
81 * See header file for more information
82 * @endinternal
83 */
84nlohmann::json::object_t noTargetsDetermined(std::string_view arg1)
85{
86 return getLog(redfish::registries::Update::Index::noTargetsDetermined,
87 std::to_array({arg1}));
88}
89
90/**
91 * @internal
92 * @brief Formats UpdateInProgress message into JSON
93 *
94 * See header file for more information
95 * @endinternal
96 */
97nlohmann::json::object_t updateInProgress()
98{
99 return getLog(redfish::registries::Update::Index::updateInProgress, {});
100}
101
102/**
103 * @internal
104 * @brief Formats TransferringToComponent message into JSON
105 *
106 * See header file for more information
107 * @endinternal
108 */
109nlohmann::json::object_t transferringToComponent(std::string_view arg1,
110 std::string_view arg2)
111{
112 return getLog(redfish::registries::Update::Index::transferringToComponent,
113 std::to_array({arg1, arg2}));
114}
115
116/**
117 * @internal
118 * @brief Formats VerifyingAtComponent message into JSON
119 *
120 * See header file for more information
121 * @endinternal
122 */
123nlohmann::json::object_t verifyingAtComponent(std::string_view arg1,
124 std::string_view arg2)
125{
126 return getLog(redfish::registries::Update::Index::verifyingAtComponent,
127 std::to_array({arg1, arg2}));
128}
129
130/**
131 * @internal
132 * @brief Formats InstallingOnComponent message into JSON
133 *
134 * See header file for more information
135 * @endinternal
136 */
137nlohmann::json::object_t installingOnComponent(std::string_view arg1,
138 std::string_view arg2)
139{
140 return getLog(redfish::registries::Update::Index::installingOnComponent,
141 std::to_array({arg1, arg2}));
142}
143
144/**
145 * @internal
146 * @brief Formats ApplyingOnComponent message into JSON
147 *
148 * See header file for more information
149 * @endinternal
150 */
151nlohmann::json::object_t applyingOnComponent(std::string_view arg1,
152 std::string_view arg2)
153{
154 return getLog(redfish::registries::Update::Index::applyingOnComponent,
155 std::to_array({arg1, arg2}));
156}
157
158/**
159 * @internal
160 * @brief Formats TransferFailed message into JSON
161 *
162 * See header file for more information
163 * @endinternal
164 */
165nlohmann::json::object_t transferFailed(std::string_view arg1,
166 std::string_view arg2)
167{
168 return getLog(redfish::registries::Update::Index::transferFailed,
169 std::to_array({arg1, arg2}));
170}
171
172/**
173 * @internal
174 * @brief Formats VerificationFailed message into JSON
175 *
176 * See header file for more information
177 * @endinternal
178 */
179nlohmann::json::object_t verificationFailed(std::string_view arg1,
180 std::string_view arg2)
181{
182 return getLog(redfish::registries::Update::Index::verificationFailed,
183 std::to_array({arg1, arg2}));
184}
185
186/**
187 * @internal
188 * @brief Formats ApplyFailed message into JSON
189 *
190 * See header file for more information
191 * @endinternal
192 */
193nlohmann::json::object_t applyFailed(std::string_view arg1,
194 std::string_view arg2)
195{
196 return getLog(redfish::registries::Update::Index::applyFailed,
197 std::to_array({arg1, arg2}));
198}
199
200/**
201 * @internal
202 * @brief Formats ActivateFailed message into JSON
203 *
204 * See header file for more information
205 * @endinternal
206 */
207nlohmann::json::object_t activateFailed(std::string_view arg1,
208 std::string_view arg2)
209{
210 return getLog(redfish::registries::Update::Index::activateFailed,
211 std::to_array({arg1, arg2}));
212}
213
214/**
215 * @internal
216 * @brief Formats AwaitToUpdate message into JSON
217 *
218 * See header file for more information
219 * @endinternal
220 */
221nlohmann::json::object_t awaitToUpdate(std::string_view arg1,
222 std::string_view arg2)
223{
224 return getLog(redfish::registries::Update::Index::awaitToUpdate,
225 std::to_array({arg1, arg2}));
226}
227
228/**
229 * @internal
230 * @brief Formats AwaitToActivate message into JSON
231 *
232 * See header file for more information
233 * @endinternal
234 */
235nlohmann::json::object_t awaitToActivate(std::string_view arg1,
236 std::string_view arg2)
237{
238 return getLog(redfish::registries::Update::Index::awaitToActivate,
239 std::to_array({arg1, arg2}));
240}
241
242/**
243 * @internal
244 * @brief Formats UpdateSuccessful message into JSON
245 *
246 * See header file for more information
247 * @endinternal
248 */
249nlohmann::json::object_t updateSuccessful(std::string_view arg1,
250 std::string_view arg2)
251{
252 return getLog(redfish::registries::Update::Index::updateSuccessful,
253 std::to_array({arg1, arg2}));
254}
255
256/**
257 * @internal
258 * @brief Formats OperationTransitionedToJob message into JSON
259 *
260 * See header file for more information
261 * @endinternal
262 */
263nlohmann::json::object_t operationTransitionedToJob(std::string_view arg1)
264{
265 return getLog(
266 redfish::registries::Update::Index::operationTransitionedToJob,
267 std::to_array({arg1}));
268}
269
270/**
271 * @internal
272 * @brief Formats UpdateSkipped message into JSON
273 *
274 * See header file for more information
275 * @endinternal
276 */
277nlohmann::json::object_t updateSkipped(std::string_view arg1,
278 std::string_view arg2)
279{
280 return getLog(redfish::registries::Update::Index::updateSkipped,
281 std::to_array({arg1, arg2}));
282}
283
284/**
285 * @internal
286 * @brief Formats UpdateSkippedSameVersion message into JSON
287 *
288 * See header file for more information
289 * @endinternal
290 */
291nlohmann::json::object_t updateSkippedSameVersion(std::string_view arg1,
292 std::string_view arg2)
293{
294 return getLog(redfish::registries::Update::Index::updateSkippedSameVersion,
295 std::to_array({arg1, arg2}));
296}
297
298/**
299 * @internal
300 * @brief Formats UpdateNotApplicable message into JSON
301 *
302 * See header file for more information
303 * @endinternal
304 */
305nlohmann::json::object_t updateNotApplicable(std::string_view arg1,
306 std::string_view arg2)
307{
308 return getLog(redfish::registries::Update::Index::updateNotApplicable,
309 std::to_array({arg1, arg2}));
310}
311
312} // namespace messages
313} // namespace redfish