From 0657843a00da62c3a076dacbf6203867a4fb5eb5 Mon Sep 17 00:00:00 2001 From: raviteja-b Date: Mon, 3 Feb 2020 12:50:42 -0600 Subject: Redfish: Download action support for system dump entry Tested By: POST https://${IP}/redfish/v1/Systems/system/LogServices/SystemDump/Entries//Actions/Oem/OpenBmc/LogEntry.DownloadLog Change-Id: I06262cf0799920aeb065a065886320b20c04aa7c Signed-off-by: Ravi Teja --- redfish-core/lib/log_services.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'redfish-core/lib') diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp index 79433b9a0c..8590373267 100644 --- a/redfish-core/lib/log_services.hpp +++ b/redfish-core/lib/log_services.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1849,6 +1850,36 @@ class SystemDumpEntry : public Node } }; +class SystemDumpEntryDownload : public Node +{ + public: + SystemDumpEntryDownload(CrowApp &app) : + Node(app, + "/redfish/v1/Systems/system/LogServices/System/Entries//" + "Actions/" + "LogEntry.DownloadLog/", + std::string()) + { + entityPrivileges = { + {boost::beast::http::verb::get, {{"Login"}}}, + {boost::beast::http::verb::head, {{"Login"}}}, + {boost::beast::http::verb::post, {{"ConfigureManager"}}}}; + } + + private: + void doPost(crow::Response &res, const crow::Request &req, + const std::vector ¶ms) override + { + if (params.size() != 1) + { + messages::internalError(res); + return; + } + const std::string &entryID = params[0]; + crow::obmc_dump::handleDumpOffloadUrl(req, res, entryID); + } +}; + class CrashdumpService : public Node { public: -- cgit v1.2.3