Add DBus EventLog to Manager
In order to get access to the EventLog on multi-host platforms,
add Journal EventLog to Manager.
This implementation is based on the discussion we had on
patch 76319 [1].
TLDR: On multi-host, we technically would have to split the event log
on a per host node basis, so that each host node has its own
specific event log.
However, this is currently not supported so we had to decide,
whether we put it on a specific ComputerSystem, or refactor the current
implementation of the EventLog, to allow for the EventLog LogService to
be part of the Managers resource.
We chose the latter one, because a), it is not clear on which
ComputerSystem to put the EventLog, as long as we aren't splitting the
event log per host node, and b), if that particular
ComputerSystem is not existing at runtime, there would be no access to
the EventLog at all.
This feature can be enabled with the redfish-eventlog-location meson
option. By default it is set to 'systems', which translates to the
EventLog being under the Systems resource.
To enable the EventLog under the Managers resource set
```
-Dredfish-eventlog-location=managers
```
This in turn, disables the EventLog under the ComputerSystem resource.
Tested: Redfish validation succeeded for both ComputerSystem and
Managers tree.
Patch LogEntry:
```
$ curl -k -X PATCH
'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/4444' \
-H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' \
-H "Content-Type: application/json" -d "{"Resolved":true}"
$ busctl introspect xyz.openbmc_project.Logging
/xyz/openbmc_project/logging/entry/4444
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
...
xyz.openbmc_project.Logging.Entry interface - - -
.GetEntry method - h -
.AdditionalData property a{ss} 5 "CALLOUT_INVENTORY_PATH" "/xyz/open... emits-change writable
.EventId property s "" emits-change writable
.Id property u 4444 emits-change writable
.Message property s "xyz.openbmc_project.Sensor.Threshold... emits-change writable
.Resolution property s "" emits-change writable
.Resolved property b true emits-change writable
```
Delete LogEntry:
```
$ busctl tree xyz.openbmc_project.Logging
...
| |- /xyz/openbmc_project/logging/entry/6498
| |- /xyz/openbmc_project/logging/entry/6499
| |- /xyz/openbmc_project/logging/entry/6500
| |- /xyz/openbmc_project/logging/entry/6501
...
$ curl -k -X DELETE
'https://'"${BMC}"':4443/redfish/v1/Managers/bmc/LogServices/EventLog/Entries/6500' \
-H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' \
-H "Content-Type: application/json"
| |- /xyz/openbmc_project/logging/entry/6498
| |- /xyz/openbmc_project/logging/entry/6499
| |- /xyz/openbmc_project/logging/entry/6501
```
ClearLog action:
```
$ curl -k -X POST
'https://'"${BMC}"':4443/redfish/v1/Managers/bmc/LogServices/EventLog/Actions/LogService.ClearLog' \
-H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN"'' \
-H "Content-Type: application/json"
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.19.Success",
"MessageSeverity": "OK",
"Resolution": "None."
}
]
}
```
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76319
Change-Id: Ie619af8e10a723aef2e02ef03796851511b05008
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
diff --git a/redfish-core/src/redfish.cpp b/redfish-core/src/redfish.cpp
index 45ad5cf..d7c43ed 100644
--- a/redfish-core/src/redfish.cpp
+++ b/redfish-core/src/redfish.cpp
@@ -22,6 +22,7 @@
#include "hypervisor_system.hpp"
#include "log_services.hpp"
#include "manager_diagnostic_data.hpp"
+#include "manager_logservices_dbus_eventlog.hpp"
#include "manager_logservices_journal.hpp"
#include "manager_logservices_journal_eventlog.hpp"
#include "managers.hpp"
@@ -141,7 +142,17 @@
if constexpr (BMCWEB_REDFISH_EVENTLOG_LOCATION == "managers")
{
requestRoutesManagersEventLogService(app);
- requestRoutesManagersJournalEventLog(app);
+ if constexpr (BMCWEB_REDFISH_DBUS_LOG)
+ {
+ requestRoutesManagersDBusLogServiceActionsClear(app);
+ requestRoutesManagersDBusEventLogEntryCollection(app);
+ requestRoutesManagersDBusEventLogEntry(app);
+ requestRoutesManagersDBusEventLogEntryDownload(app);
+ }
+ else
+ {
+ requestRoutesManagersJournalEventLog(app);
+ }
}
if constexpr (BMCWEB_REDFISH_DUMP_LOG)