summaryrefslogtreecommitdiff
path: root/redfish-core/lib/log_services.hpp
diff options
context:
space:
mode:
authorAsmitha Karunanithi <asmitk01@in.ibm.com>2020-05-07 14:21:47 +0300
committerRatan Gupta <ratagupt@linux.vnet.ibm.com>2020-08-08 12:17:04 +0300
commitf71882ffecef5e64d1f5ad7ef59e811383de7156 (patch)
tree61e93c33799219eeec3b22b89494ab2a6215250e /redfish-core/lib/log_services.hpp
parent87f171a8e9c7069baea8b03f7825423563120ea7 (diff)
downloadbmcweb-f71882ffecef5e64d1f5ad7ef59e811383de7156.tar.xz
Redfish: Support for DownloadLog Action
Supports offloading a dump to the client Tested-By: * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc/LogServices/ Dump/attachment/<dump-id> * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/ Dump/attachment/<dump-id> Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I99bbb50bc171408273744f89220a46bfe64ba4c4
Diffstat (limited to 'redfish-core/lib/log_services.hpp')
-rw-r--r--redfish-core/lib/log_services.hpp41
1 files changed, 36 insertions, 5 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index b572bbfa4f..aed37b0668 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -2140,6 +2140,36 @@ class BMCDumpCreate : public Node
}
};
+class BMCDumpEntryDownload : public Node
+{
+ public:
+ BMCDumpEntryDownload(CrowApp& app) :
+ Node(app, "/redfish/v1/Managers/bmc/LogServices/Dump/attachment/<str>/",
+ std::string())
+ {
+ entityPrivileges = {
+ {boost::beast::http::verb::get, {{"Login"}}},
+ {boost::beast::http::verb::head, {{"Login"}}},
+ {boost::beast::http::verb::patch, {{"ConfigureManager"}}},
+ {boost::beast::http::verb::put, {{"ConfigureManager"}}},
+ {boost::beast::http::verb::delete_, {{"ConfigureManager"}}},
+ {boost::beast::http::verb::post, {{"ConfigureManager"}}}};
+ }
+
+ private:
+ void doGet(crow::Response& res, const crow::Request& req,
+ const std::vector<std::string>& params) override
+ {
+ if (params.size() != 1)
+ {
+ messages::internalError(res);
+ return;
+ }
+ const std::string& entryID = params[0];
+ crow::obmc_dump::handleDumpOffloadUrl(req, res, entryID);
+ }
+};
+
class BMCDumpClear : public Node
{
public:
@@ -2319,20 +2349,21 @@ class SystemDumpEntryDownload : public Node
public:
SystemDumpEntryDownload(CrowApp& app) :
Node(app,
- "/redfish/v1/Systems/system/LogServices/System/Entries/<str>/"
- "Actions/"
- "LogEntry.DownloadLog/",
+ "/redfish/v1/Systems/system/LogServices/Dump/attachment/<str>/",
std::string())
{
entityPrivileges = {
{boost::beast::http::verb::get, {{"Login"}}},
{boost::beast::http::verb::head, {{"Login"}}},
+ {boost::beast::http::verb::patch, {{"ConfigureManager"}}},
+ {boost::beast::http::verb::put, {{"ConfigureManager"}}},
+ {boost::beast::http::verb::delete_, {{"ConfigureManager"}}},
{boost::beast::http::verb::post, {{"ConfigureManager"}}}};
}
private:
- void doPost(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ void doGet(crow::Response& res, const crow::Request& req,
+ const std::vector<std::string>& params) override
{
if (params.size() != 1)
{