diff options
author | Borawski.Lukasz <lukasz.borawski@intel.com> | 2018-02-08 15:24:24 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2018-03-28 00:02:27 +0300 |
commit | 5d27b854e5b99a9ab3d3f5ad9f99094252d19092 (patch) | |
tree | 21d8a6314caf088dda87832453d8d1726a19acfc /redfish-core/lib/redfish_sessions.hpp | |
parent | 70141561266d944c1377109698935d129db84e3f (diff) | |
download | bmcweb-5d27b854e5b99a9ab3d3f5ad9f99094252d19092.tar.xz |
Redfish SessionService
- added node version of the SessionService implementation
- added a default timeout member and a get timeout method
to the SessionStore class
Change-Id: I532080789b3d687208510f8b748402735ed888d8
Signed-off-by: Borawski.Lukasz <lukasz.borawski@intel.com>
Diffstat (limited to 'redfish-core/lib/redfish_sessions.hpp')
-rw-r--r-- | redfish-core/lib/redfish_sessions.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp index 75857a1528..4225cc1896 100644 --- a/redfish-core/lib/redfish_sessions.hpp +++ b/redfish-core/lib/redfish_sessions.hpp @@ -36,6 +36,14 @@ static OperationMap sessionCollectionOpMap = { {crow::HTTPMethod::DELETE, {{"ConfigureManager"}}}, {crow::HTTPMethod::POST, {{}}}}; +static OperationMap sessionServiceOpMap = { + {crow::HTTPMethod::GET, {{"Login"}}}, + {crow::HTTPMethod::HEAD, {{"Login"}}}, + {crow::HTTPMethod::PATCH, {{"ConfigureManager"}}}, + {crow::HTTPMethod::PUT, {{"ConfigureManager"}}}, + {crow::HTTPMethod::DELETE, {{"ConfigureManager"}}}, + {crow::HTTPMethod::POST, {{"ConfigureManager"}}}}; + class SessionCollection; class Sessions : public Node { @@ -233,4 +241,31 @@ class SessionCollection : public Node { Sessions memberSession; }; +class SessionService : public Node { + public: + SessionService(CrowApp& app) + : Node(app, EntityPrivileges(std::move(sessionServiceOpMap)), + "/redfish/v1/SessionService/") { + Node::json["@odata.type"] = "#SessionService.v1_0_2.SessionService"; + Node::json["@odata.id"] = "/redfish/v1/SessionService/"; + Node::json["@odata.context"] = + "/redfish/v1/$metadata#SessionService.SessionService"; + Node::json["Name"] = "Session Service"; + Node::json["Description"] = "Session Service"; + Node::json["SessionTimeout"] = + crow::PersistentData::session_store->get_timeout_in_seconds(); + Node::json["Status"]["State"] = "Enabled"; + Node::json["Status"]["Health"] = "OK"; + Node::json["Status"]["HealthRollup"] = "OK"; + Node::json["ServiceEnabled"] = true; + } + + private: + void doGet(crow::response& res, const crow::request& req, + const std::vector<std::string>& params) override { + res.json_value = Node::json; + res.end(); + } +}; + } // namespace redfish |