blob: 1d7a0335d32249b3688efaafecac64e1f03bb5c8 [file] [log] [blame]
Ed Tanousa8a5bc12024-12-02 15:43:16 -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 "heartbeat_messages.hpp"
12
13#include "registries.hpp"
14#include "registries/heartbeat_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)
Ed Tanous2ca56192025-09-16 13:19:08 -070026#include <cstdint>
27// NOLINTNEXTLINE(misc-include-cleaner)
28#include <string>
29// NOLINTNEXTLINE(misc-include-cleaner)
Ed Tanousa8a5bc12024-12-02 15:43:16 -080030#include <utility>
31
32namespace redfish
33{
34
35namespace messages
36{
37
Ed Tanous10cf50d2025-05-06 16:10:32 -070038static nlohmann::json::object_t getLog(
39 redfish::registries::HeartbeatEvent::Index name,
40 std::span<const std::string_view> args)
Ed Tanousa8a5bc12024-12-02 15:43:16 -080041{
42 size_t index = static_cast<size_t>(name);
Patrick Williams4a102cd2025-02-27 14:52:54 -050043 if (index >= redfish::registries::HeartbeatEvent::registry.size())
Ed Tanousa8a5bc12024-12-02 15:43:16 -080044 {
45 return {};
46 }
Patrick Williams4a102cd2025-02-27 14:52:54 -050047 return getLogFromRegistry(redfish::registries::HeartbeatEvent::header,
48 redfish::registries::HeartbeatEvent::registry,
Ed Tanousa8a5bc12024-12-02 15:43:16 -080049 index, args);
50}
51
52/**
53 * @internal
54 * @brief Formats RedfishServiceFunctional message into JSON
55 *
56 * See header file for more information
57 * @endinternal
58 */
Ed Tanous10cf50d2025-05-06 16:10:32 -070059nlohmann::json::object_t redfishServiceFunctional()
Ed Tanousa8a5bc12024-12-02 15:43:16 -080060{
61 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -050062 redfish::registries::HeartbeatEvent::Index::redfishServiceFunctional,
Ed Tanousa8a5bc12024-12-02 15:43:16 -080063 {});
64}
65
66} // namespace messages
67} // namespace redfish