blob: 7a71151732c654cbb1e50ff101d6ba1996406502 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#pragma once
#include "registries/resource_event_message_registry.hpp"
#include <nlohmann/json.hpp>
namespace redfish
{
namespace messages
{
inline nlohmann::json
getLogResourceEvent(redfish::registries::resource_event::Index name,
std::span<std::string_view> args)
{
size_t index = static_cast<size_t>(name);
if (index >= redfish::registries::resource_event::registry.size())
{
return {};
}
return getLogFromRegistry(redfish::registries::resource_event::header,
redfish::registries::resource_event::registry,
index, args);
}
inline nlohmann::json resourceChanged()
{
return getLogResourceEvent(
redfish::registries::resource_event::Index::resourceChanged, {});
}
inline nlohmann::json resourceCreated()
{
return getLogResourceEvent(
redfish::registries::resource_event::Index::resourceCreated, {});
}
inline nlohmann::json resourceRemoved()
{
return getLogResourceEvent(
redfish::registries::resource_event::Index::resourceRemoved, {});
}
} // namespace messages
} // namespace redfish
|