summaryrefslogtreecommitdiff
path: root/redfish-core/lib/log_services.hpp
diff options
context:
space:
mode:
authorCarson Labrado <clabrado@google.com>2022-06-06 22:40:56 +0300
committerEd Tanous <ed@tanous.net>2022-06-15 03:22:52 +0300
commit3ba0007367777144f474fdf99439ae8c03633486 (patch)
tree4b2d561630a44a0f2859a2b55f2c2c6b28780252 /redfish-core/lib/log_services.hpp
parenta7a80296f731ef1069d3ecfbd3069668fb71cd68 (diff)
downloadbmcweb-3ba0007367777144f474fdf99439ae8c03633486.tar.xz
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation operations. The functions in query.hpp are used by all endpoints making them the logical location. The aggregation code requires a shared_ptr to the AsyncResp so these functions need to be able to supply that. This patch is broken out of a future patch for routing Redfish Aggregation requests https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310 The follow commands can be used to perform most of the replacements: find . -type f | xargs sed -i 's/setUpRedfishRoute(app, req, asyncResp->res/setUpRedfishRoute(app, req, asyncResp/g' find . -type f | xargs sed -i 's/setUpRedfishRouteWithDelegation(app, req, asyncResp->res/setUpRedfishRouteWithDelegation(app, req, asyncResp/g' Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I4f4f9f22cdcfb14a3bd94b9a8f3d64aae34e57bc
Diffstat (limited to 'redfish-core/lib/log_services.hpp')
-rw-r--r--redfish-core/lib/log_services.hpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 4f6e85b782..be909861e3 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -888,7 +888,7 @@ inline void requestRoutesSystemLogServiceCollection(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -968,7 +968,7 @@ inline void requestRoutesEventLogService(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1006,7 +1006,7 @@ inline void requestRoutesJournalEventLogClear(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1149,7 +1149,7 @@ inline void requestRoutesJournalEventLogEntryCollection(App& app)
};
query_param::Query delegatedQuery;
if (!redfish::setUpRedfishRouteWithDelegation(
- app, req, asyncResp->res, delegatedQuery, capabilities))
+ app, req, asyncResp, delegatedQuery, capabilities))
{
return;
}
@@ -1236,7 +1236,7 @@ inline void requestRoutesJournalEventLogEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1300,7 +1300,7 @@ inline void requestRoutesDBusEventLogEntryCollection(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1456,7 +1456,7 @@ inline void requestRoutesDBusEventLogEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1569,7 +1569,7 @@ inline void requestRoutesDBusEventLogEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& entryId) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1606,7 +1606,7 @@ inline void requestRoutesDBusEventLogEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1658,7 +1658,7 @@ inline void requestRoutesDBusEventLogEntryDownload(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1826,7 +1826,7 @@ inline void requestRoutesSystemHostLogger(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1856,7 +1856,7 @@ inline void requestRoutesSystemHostLoggerCollection(App& app)
};
query_param::Query delegatedQuery;
if (!redfish::setUpRedfishRouteWithDelegation(
- app, req, asyncResp->res, delegatedQuery, capabilities))
+ app, req, asyncResp, delegatedQuery, capabilities))
{
return;
}
@@ -1925,7 +1925,7 @@ inline void requestRoutesSystemHostLoggerLogEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -1987,7 +1987,7 @@ inline void requestRoutesBMCLogServiceCollection(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2022,7 +2022,7 @@ inline void requestRoutesBMCJournalLogService(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2120,7 +2120,7 @@ inline void requestRoutesBMCJournalLogEntryCollection(App& app)
};
query_param::Query delegatedQuery;
if (!redfish::setUpRedfishRouteWithDelegation(
- app, req, asyncResp->res, delegatedQuery, capabilities))
+ app, req, asyncResp, delegatedQuery, capabilities))
{
return;
}
@@ -2202,7 +2202,7 @@ inline void requestRoutesBMCJournalLogEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& entryID) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2273,7 +2273,7 @@ inline void requestRoutesBMCDumpService(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2313,7 +2313,7 @@ inline void requestRoutesBMCDumpEntryCollection(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2338,7 +2338,7 @@ inline void requestRoutesBMCDumpEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2351,7 +2351,7 @@ inline void requestRoutesBMCDumpEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2368,7 +2368,7 @@ inline void requestRoutesBMCDumpCreate(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2385,7 +2385,7 @@ inline void requestRoutesBMCDumpClear(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2400,7 +2400,7 @@ inline void requestRoutesSystemDumpService(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2441,7 +2441,7 @@ inline void requestRoutesSystemDumpEntryCollection(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2467,7 +2467,7 @@ inline void requestRoutesSystemDumpEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2481,7 +2481,7 @@ inline void requestRoutesSystemDumpEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2498,7 +2498,7 @@ inline void requestRoutesSystemDumpCreate(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2517,7 +2517,7 @@ inline void requestRoutesSystemDumpClear(App& app)
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2539,7 +2539,7 @@ inline void requestRoutesCrashdumpService(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2582,7 +2582,7 @@ void inline requestRoutesCrashdumpClear(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2686,7 +2686,7 @@ inline void requestRoutesCrashdumpEntryCollection(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2749,7 +2749,7 @@ inline void requestRoutesCrashdumpEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& param) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2770,7 +2770,7 @@ inline void requestRoutesCrashdumpFile(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& logID, const std::string& fileName) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2863,7 +2863,7 @@ inline void requestRoutesCrashdumpCollect(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -2984,7 +2984,7 @@ inline void requestRoutesDBusLogServiceActionsClear(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -3024,7 +3024,7 @@ inline void requestRoutesPostCodesLogService(App& app)
.methods(boost::beast::http::verb::get)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -3063,7 +3063,7 @@ inline void requestRoutesPostCodesClear(App& app)
.methods(boost::beast::http::verb::post)(
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -3340,7 +3340,7 @@ inline void requestRoutesPostCodesEntryCollection(App& app)
};
query_param::Query delegatedQuery;
if (!redfish::setUpRedfishRouteWithDelegation(
- app, req, asyncResp->res, delegatedQuery, capabilities))
+ app, req, asyncResp, delegatedQuery, capabilities))
{
return;
}
@@ -3409,7 +3409,7 @@ inline void requestRoutesPostCodesEntryAdditionalData(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& postCodeID) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}
@@ -3486,7 +3486,7 @@ inline void requestRoutesPostCodesEntry(App& app)
[&app](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& targetID) {
- if (!redfish::setUpRedfishRoute(app, req, asyncResp->res))
+ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
return;
}