blob: 28991dc5d15fbe1cfb49ac4509b61e78ee7f00bf [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)
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::HeartbeatEvent::Index name,
36 std::span<const std::string_view> args)
Ed Tanousa8a5bc12024-12-02 15:43:16 -080037{
38 size_t index = static_cast<size_t>(name);
Patrick Williams4a102cd2025-02-27 14:52:54 -050039 if (index >= redfish::registries::HeartbeatEvent::registry.size())
Ed Tanousa8a5bc12024-12-02 15:43:16 -080040 {
41 return {};
42 }
Patrick Williams4a102cd2025-02-27 14:52:54 -050043 return getLogFromRegistry(redfish::registries::HeartbeatEvent::header,
44 redfish::registries::HeartbeatEvent::registry,
Ed Tanousa8a5bc12024-12-02 15:43:16 -080045 index, args);
46}
47
48/**
49 * @internal
50 * @brief Formats RedfishServiceFunctional 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 redfishServiceFunctional()
Ed Tanousa8a5bc12024-12-02 15:43:16 -080056{
57 return getLog(
Patrick Williams4a102cd2025-02-27 14:52:54 -050058 redfish::registries::HeartbeatEvent::Index::redfishServiceFunctional,
Ed Tanousa8a5bc12024-12-02 15:43:16 -080059 {});
60}
61
62} // namespace messages
63} // namespace redfish