Ratan Gupta | 453fed0 | 2019-12-14 09:39:47 +0530 | [diff] [blame^] | 1 | #pragma once |
| 2 | #include <app.h> |
| 3 | #include <tinyxml2.h> |
| 4 | |
| 5 | #include <async_resp.hpp> |
| 6 | |
| 7 | namespace crow |
| 8 | { |
| 9 | namespace ibm_mc |
| 10 | { |
| 11 | |
| 12 | template <typename... Middlewares> void requestRoutes(Crow<Middlewares...> &app) |
| 13 | { |
| 14 | |
| 15 | // allowed only for admin |
| 16 | BMCWEB_ROUTE(app, "/ibm/v1/") |
| 17 | .requires({"ConfigureComponents", "ConfigureManager"}) |
| 18 | .methods("GET"_method)( |
| 19 | [](const crow::Request &req, crow::Response &res) { |
| 20 | res.jsonValue["@odata.type"] = |
| 21 | "#ibmServiceRoot.v1_0_0.ibmServiceRoot"; |
| 22 | res.jsonValue["@odata.id"] = "/ibm/v1/"; |
| 23 | res.jsonValue["Id"] = "IBM Rest RootService"; |
| 24 | res.jsonValue["Name"] = "IBM Service Root"; |
| 25 | res.jsonValue["ConfigFiles"] = { |
| 26 | {"@odata.id", "/ibm/v1/Host/ConfigFiles"}}; |
| 27 | res.jsonValue["LockService"] = { |
| 28 | {"@odata.id", "/ibm/v1/HMC/LockService"}}; |
| 29 | res.end(); |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | } // namespace ibm_mc |
| 34 | } // namespace crow |