summaryrefslogtreecommitdiff
path: root/redfish-core/lib/log_services.hpp
diff options
context:
space:
mode:
authorAbhishek Patel <Abhishek.Patel@ibm.com>2021-05-14 06:57:36 +0300
committerGunnar Mills <gmills@us.ibm.com>2021-05-19 16:49:39 +0300
commitde8d94a3dfda08ef6a80a245e2a31df8ec2496d2 (patch)
treebe5d09fd6fc3284698ea0df4f120f47e8830f50d /redfish-core/lib/log_services.hpp
parent3cde86f14b7835775d7c37e993fb84a3cd01ef9d (diff)
downloadbmcweb-de8d94a3dfda08ef6a80a245e2a31df8ec2496d2.tar.xz
Change AdditionalDataURI to be a child URI
Make the AdditionalDataURI a child relationship of the resource to better follow Hypermedia API best practices and match the AdditionalDataURI of the coming Post Code log entries. Changed the AdditionalDataURI for bmc dump, system dump, and log entry A hypermedia API gives us a search form in response and tells API what URL to use, which HTTP verb is appropriate, and what parameters to supply. URL change:- Old: "/redfish/v1/Systems/system/LogServices/EventLog/attachment/<str>" New: "/redfish/v1/Systems/system/LogServices/EventLog/Entries/<str>/attachment" openbmc/bmcweb#205 Tested: Validator passes. - Verified the new AdditionalDataURI was correct for /redfish/v1/Systems/system/LogServices/EventLog/Entries: $ curl -k https://w15.aus.stglabs.ibm.com/redfish/v1/Systems/system/LogServices/EventLog/Entries/1 { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/1/attachment", "Created": "2021-03-15T18:47:26+00:00", "EntryType": "Event", "Id": "1", "Message": "xyz.openbmc_project.Common.Error.InternalFailure", "Modified": "2021-04-30T17:26:38+00:00", "Name": "System Event Log Entry", "Resolved": true, "Severity": "Critical" } Change-Id: Ifb720ac2710ebd4a2df37a83c9deb8a6eefdffd5 Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com>
Diffstat (limited to 'redfish-core/lib/log_services.hpp')
-rw-r--r--redfish-core/lib/log_services.hpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 8464d06f2d..acf2794e8c 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -511,18 +511,16 @@ inline void
{
thisEntry["DiagnosticDataType"] = "Manager";
thisEntry["AdditionalDataURI"] =
- "/redfish/v1/Managers/bmc/LogServices/Dump/"
- "attachment/" +
- entryID;
+ "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/" +
+ entryID + "/attachment";
}
else if (dumpType == "System")
{
thisEntry["DiagnosticDataType"] = "OEM";
thisEntry["OEMDiagnosticDataType"] = "System";
thisEntry["AdditionalDataURI"] =
- "/redfish/v1/Systems/system/LogServices/Dump/"
- "attachment/" +
- entryID;
+ "/redfish/v1/Systems/system/LogServices/Dump/Entries/" +
+ entryID + "/attachment";
}
}
asyncResp->res.jsonValue["Members@odata.count"] =
@@ -636,9 +634,8 @@ inline void
{
asyncResp->res.jsonValue["DiagnosticDataType"] = "Manager";
asyncResp->res.jsonValue["AdditionalDataURI"] =
- "/redfish/v1/Managers/bmc/LogServices/Dump/"
- "attachment/" +
- entryID;
+ "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/" +
+ entryID + "/attachment";
}
else if (dumpType == "System")
{
@@ -646,9 +643,8 @@ inline void
asyncResp->res.jsonValue["OEMDiagnosticDataType"] =
"System";
asyncResp->res.jsonValue["AdditionalDataURI"] =
- "/redfish/v1/Systems/system/LogServices/Dump/"
- "attachment/" +
- entryID;
+ "/redfish/v1/Systems/system/LogServices/Dump/Entries/" +
+ entryID + "/attachment";
}
}
if (foundDumpEntry == false)
@@ -1508,8 +1504,8 @@ class DBusEventLogEntryCollection : public Node
{
thisEntry["AdditionalDataURI"] =
"/redfish/v1/Systems/system/LogServices/EventLog/"
- "attachment/" +
- std::to_string(*id);
+ "Entries/" +
+ std::to_string(*id) + "/attachment";
}
}
std::sort(entriesArray.begin(), entriesArray.end(),
@@ -1659,8 +1655,8 @@ class DBusEventLogEntry : public Node
{
asyncResp->res.jsonValue["AdditionalDataURI"] =
"/redfish/v1/Systems/system/LogServices/EventLog/"
- "attachment/" +
- std::to_string(*id);
+ "Entries/" +
+ std::to_string(*id) + "/attachment";
}
},
"xyz.openbmc_project.Logging",
@@ -1761,10 +1757,10 @@ class DBusEventLogEntryDownload : public Node
{
public:
DBusEventLogEntryDownload(App& app) :
- Node(
- app,
- "/redfish/v1/Systems/system/LogServices/EventLog/attachment/<str>/",
- std::string())
+ Node(app,
+ "/redfish/v1/Systems/system/LogServices/EventLog/Entries/<str>/"
+ "attachment",
+ std::string())
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},