Move the CPU LogService to Systems
The CPU LogService doesn't belong under BMC LogServices,
so moving it to Systems LogServices.
Tested: Verified that the CPU LogService shows up under Systems
and passed the Redfish Service Validator.
Change-Id: Ic04157b966dc0395db94046f37c33590a4e20553
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bd8a71..6756575 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,11 +27,11 @@
Redfish. Paths are under
'/redfish/v1/Managers/bmc/LogServices/Journal'." OFF)
option (BMCWEB_ENABLE_REDFISH_RAW_PECI "Enable PECI transactions through
- Redfish. Paths are under '/redfish/v1/Managers/bmc/LogServices/CpuLog/
+ Redfish. Paths are under '/redfish/v1/Systems/system/LogServices/CpuLog/
Actions/Oem/CpuLog.SendRawPeci'." OFF)
option (BMCWEB_ENABLE_REDFISH_CPU_LOG "Enable CPU log service transactions
through Redfish. Paths are under
- '/redfish/v1/Managers/bmc/LogServices/CpuLog'." OFF)
+ '/redfish/v1/Systems/system/LogServices/CpuLog'." OFF)
# Insecure options. Every option that starts with a BMCWEB_INSECURE flag should
# not be enabled by default for any platform, unless the author fully
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index bcdb80c..3cff994 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -294,6 +294,10 @@
logServiceArray = nlohmann::json::array();
logServiceArray.push_back(
{{"@odata.id", "/redfish/v1/Systems/system/LogServices/EventLog"}});
+#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
+ logServiceArray.push_back(
+ {{"@odata.id", "/redfish/v1/Systems/system/LogServices/CpuLog"}});
+#endif
asyncResp->res.jsonValue["Members@odata.count"] =
logServiceArray.size();
}
@@ -321,7 +325,6 @@
{
std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
- const std::string &name = params[0];
asyncResp->res.jsonValue["@odata.id"] =
"/redfish/v1/Systems/system/LogServices/EventLog";
asyncResp->res.jsonValue["@odata.type"] =
@@ -646,10 +649,6 @@
logServiceArray.push_back(
{{"@odata.id", "/redfish/v1/Managers/bmc/LogServices/Journal"}});
#endif
-#ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
- logServiceArray.push_back(
- {{"@odata.id", "/redfish/v1/Managers/bmc/LogServices/CpuLog"}});
-#endif
asyncResp->res.jsonValue["Members@odata.count"] =
logServiceArray.size();
}
@@ -914,7 +913,7 @@
public:
template <typename CrowApp>
CPULogService(CrowApp &app) :
- Node(app, "/redfish/v1/Managers/bmc/LogServices/CpuLog/")
+ Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
@@ -935,7 +934,7 @@
std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
// Copy over the static data to include the entries added by SubRoute
asyncResp->res.jsonValue["@odata.id"] =
- "/redfish/v1/Managers/bmc/LogServices/CpuLog";
+ "/redfish/v1/Systems/system/LogServices/CpuLog";
asyncResp->res.jsonValue["@odata.type"] =
"#LogService.v1_1_0.LogService";
asyncResp->res.jsonValue["@odata.context"] =
@@ -951,14 +950,14 @@
asyncResp->res.jsonValue["Actions"] = {
{"Oem",
{{"#CpuLog.Immediate",
- {{"target", "/redfish/v1/Managers/bmc/LogServices/CpuLog/"
+ {{"target", "/redfish/v1/Systems/system/LogServices/CpuLog/"
"Actions/Oem/CpuLog.Immediate"}}}}}};
#ifdef BMCWEB_ENABLE_REDFISH_RAW_PECI
asyncResp->res.jsonValue["Actions"]["Oem"].push_back(
{"#CpuLog.SendRawPeci",
- {{"target", "/redfish/v1/Managers/bmc/LogServices/CpuLog/Actions/"
- "Oem/CpuLog.SendRawPeci"}}});
+ {{"target", "/redfish/v1/Systems/system/LogServices/CpuLog/"
+ "Actions/Oem/CpuLog.SendRawPeci"}}});
#endif
}
};
@@ -968,7 +967,7 @@
public:
template <typename CrowApp>
CPULogEntryCollection(CrowApp &app) :
- Node(app, "/redfish/v1/Managers/bmc/LogServices/CpuLog/Entries/")
+ Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/Entries/")
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
@@ -1006,11 +1005,10 @@
asyncResp->res.jsonValue["@odata.type"] =
"#LogEntryCollection.LogEntryCollection";
asyncResp->res.jsonValue["@odata.id"] =
- "/redfish/v1/Managers/bmc/LogServices/CpuLog/Entries";
+ "/redfish/v1/Systems/system/LogServices/CpuLog/Entries";
asyncResp->res.jsonValue["@odata.context"] =
- "/redfish/v1/$metadata#LogEntryCollection.LogEntryCollection";
- asyncResp->res.jsonValue["@odata.id"] =
- "/redfish/v1/Managers/bmc/LogServices/CpuLog/Entries";
+ "/redfish/v1/"
+ "$metadata#LogEntryCollection.LogEntryCollection";
asyncResp->res.jsonValue["Name"] = "Open BMC CPU Log Entries";
asyncResp->res.jsonValue["Description"] =
"Collection of CPU Log Entries";
@@ -1027,7 +1025,7 @@
if (lastPos != std::string::npos)
{
logEntryArray.push_back(
- {{"@odata.id", "/redfish/v1/Managers/bmc/LogServices/"
+ {{"@odata.id", "/redfish/v1/Systems/system/LogServices/"
"CpuLog/Entries/" +
objpath.substr(lastPos + 1)}});
}
@@ -1073,7 +1071,8 @@
{
public:
CPULogEntry(CrowApp &app) :
- Node(app, "/redfish/v1/Managers/bmc/LogServices/CpuLog/Entries/<str>/",
+ Node(app,
+ "/redfish/v1/Systems/system/LogServices/CpuLog/Entries/<str>/",
std::string())
{
entityPrivileges = {
@@ -1122,7 +1121,7 @@
{"@odata.type", "#LogEntry.v1_3_0.LogEntry"},
{"@odata.context", "/redfish/v1/$metadata#LogEntry.LogEntry"},
{"@odata.id",
- "/redfish/v1/Managers/bmc/LogServices/CpuLog/Entries/" +
+ "/redfish/v1/Systems/system/LogServices/CpuLog/Entries/" +
std::to_string(logId)},
{"Name", "CPU Debug Log"},
{"Id", logId},
@@ -1142,7 +1141,7 @@
{
public:
ImmediateCPULog(CrowApp &app) :
- Node(app, "/redfish/v1/Managers/bmc/LogServices/CpuLog/Actions/Oem/"
+ Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/Actions/Oem/"
"CpuLog.Immediate/")
{
entityPrivileges = {
@@ -1287,7 +1286,7 @@
{
public:
SendRawPECI(CrowApp &app) :
- Node(app, "/redfish/v1/Managers/bmc/LogServices/CpuLog/Actions/Oem/"
+ Node(app, "/redfish/v1/Systems/system/LogServices/CpuLog/Actions/Oem/"
"CpuLog.SendRawPeci/")
{
entityPrivileges = {