Combine handlers for systems eventlog
Following patch 85522 [1], combine the handlers in systems eventlog.
Tested: Unit tests pass.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/85522
Change-Id: Ib1649de83e64abb289e0379139d0a75466e15257
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
diff --git a/redfish-core/lib/systems_logservices_dbus_eventlog.hpp b/redfish-core/lib/systems_logservices_dbus_eventlog.hpp
index 1851071..a45d7c8 100644
--- a/redfish-core/lib/systems_logservices_dbus_eventlog.hpp
+++ b/redfish-core/lib/systems_logservices_dbus_eventlog.hpp
@@ -192,16 +192,13 @@
eventlog_utils::downloadEventLogEntry(asyncResp, entryId, "System");
}
-inline void requestRoutesSystemsDBusEventLogEntryCollection(App& app)
+inline void requestRoutesSystemsDBusEventLog(App& app)
{
BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/")
.privileges(redfish::privileges::getLogEntryCollection)
.methods(boost::beast::http::verb::get)(std::bind_front(
handleSystemsDBusEventLogEntryCollection, std::ref(app)));
-}
-inline void requestRoutesSystemsDBusEventLogEntry(App& app)
-{
BMCWEB_ROUTE(
app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
.privileges(redfish::privileges::getLogEntry)
@@ -221,18 +218,6 @@
deleteLogEntrySubOverComputerSystemLogServiceCollectionLogServiceLogEntryCollection)
.methods(boost::beast::http::verb::delete_)(std::bind_front(
handleSystemsDBusEventLogEntryDelete, std::ref(app)));
-}
-
-/**
- * DBusLogServiceActionsClear class supports POST method for ClearLog action.
- */
-inline void requestRoutesSystemsDBusLogServiceActionsClear(App& app)
-{
- /**
- * Function handles POST method request.
- * The Clear Log actions does not require any parameter.The action deletes
- * all entries found in the Entries collection for this Log Service.
- */
BMCWEB_ROUTE(
app,
@@ -241,10 +226,7 @@
postLogServiceSubOverComputerSystemLogServiceCollection)
.methods(boost::beast::http::verb::post)(std::bind_front(
handleSystemsDBusLogServiceActionsClear, std::ref(app)));
-}
-inline void requestRoutesSystemsDBusEventLogEntryDownload(App& app)
-{
BMCWEB_ROUTE(
app,
"/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/attachment/")
diff --git a/redfish-core/lib/systems_logservices_journal_eventlog.hpp b/redfish-core/lib/systems_logservices_journal_eventlog.hpp
index 330c98a..bacaccd 100644
--- a/redfish-core/lib/systems_logservices_journal_eventlog.hpp
+++ b/redfish-core/lib/systems_logservices_journal_eventlog.hpp
@@ -110,25 +110,19 @@
asyncResp);
}
-inline void requestRoutesSystemsJournalEventLogEntryCollection(App& app)
+inline void requestRoutesSystemsJournalEventLog(App& app)
{
BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/")
.privileges(redfish::privileges::getLogEntryCollection)
.methods(boost::beast::http::verb::get)(std::bind_front(
handleSystemsLogServiceEventLogLogEntryCollection, std::ref(app)));
-}
-inline void requestRoutesSystemsJournalEventLogEntry(App& app)
-{
BMCWEB_ROUTE(
app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
.privileges(redfish::privileges::getLogEntry)
.methods(boost::beast::http::verb::get)(std::bind_front(
handleSystemsLogServiceEventLogEntriesGet, std::ref(app)));
-}
-inline void requestRoutesSystemsJournalEventLogClear(App& app)
-{
BMCWEB_ROUTE(
app,
"/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog/")
diff --git a/redfish-core/src/redfish.cpp b/redfish-core/src/redfish.cpp
index b176593..7bc6760 100644
--- a/redfish-core/src/redfish.cpp
+++ b/redfish-core/src/redfish.cpp
@@ -124,16 +124,11 @@
requestRoutesSystemsEventLogService(app);
if constexpr (BMCWEB_REDFISH_DBUS_LOG)
{
- requestRoutesSystemsDBusLogServiceActionsClear(app);
- requestRoutesSystemsDBusEventLogEntryCollection(app);
- requestRoutesSystemsDBusEventLogEntry(app);
- requestRoutesSystemsDBusEventLogEntryDownload(app);
+ requestRoutesSystemsDBusEventLog(app);
}
else
{
- requestRoutesSystemsJournalEventLogEntryCollection(app);
- requestRoutesSystemsJournalEventLogEntry(app);
- requestRoutesSystemsJournalEventLogClear(app);
+ requestRoutesSystemsJournalEventLog(app);
}
}