blob: 1b23d1c177c92833d48d0088a97ee9e75d5d8b79 [file] [log] [blame]
Ed Tanous911ac312017-08-15 09:37:42 -07001#pragma once
2
Ed Tanous04e438c2020-10-03 08:06:26 -07003#include <app.hpp>
Ed Tanousa8c4ce92021-03-24 08:44:51 -07004#include <http_request.hpp>
5#include <http_response.hpp>
Ed Tanousa8c4ce92021-03-24 08:44:51 -07006
7#include <string>
Ed Tanous1abe55e2018-09-05 08:30:59 -07008
Ed Tanous1abe55e2018-09-05 08:30:59 -07009namespace redfish
10{
Ed Tanousa8c4ce92021-03-24 08:44:51 -070011
Ed Tanousd3355c52022-05-11 14:40:49 -070012inline void redfishGet(App& app, const crow::Request& req,
13 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
14{
Carson Labrado3ba00072022-06-06 19:40:56 +000015 if (!redfish::setUpRedfishRoute(app, req, asyncResp))
Ed Tanousd3355c52022-05-11 14:40:49 -070016 {
17 return;
18 }
19 asyncResp->res.jsonValue["v1"] = "/redfish/v1/";
20}
21
Ed Tanousf65fca62022-05-24 12:49:41 -070022inline void requestRoutesRedfish(App& app)
Ed Tanous1abe55e2018-09-05 08:30:59 -070023{
24 BMCWEB_ROUTE(app, "/redfish/")
Ed Tanousb41187f2019-10-24 16:30:02 -070025 .methods(boost::beast::http::verb::get)(
Ed Tanousd3355c52022-05-11 14:40:49 -070026 std::bind_front(redfishGet, std::ref(app)));
Ed Tanous3dac7492017-08-02 13:46:20 -070027}
Ed Tanousf65fca62022-05-24 12:49:41 -070028
Ed Tanous1abe55e2018-09-05 08:30:59 -070029} // namespace redfish