summaryrefslogtreecommitdiff
path: root/redfish-core/lib/chassis.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-02-01 21:57:49 +0300
committerEd Tanous <ed.tanous@intel.com>2019-02-19 05:54:45 +0300
commit029573d4d59ce5a67e4713a261b703f6cadfd8ef (patch)
tree451a8fdc8b45b5c4f4e2d12d18dccc4c20c9288c /redfish-core/lib/chassis.hpp
parent0f26153344a831f2b7eaf4775d56fa8a019e5c63 (diff)
downloadbmcweb-029573d4d59ce5a67e4713a261b703f6cadfd8ef.tar.xz
bmcweb: Implement single Redfish "system" endpoint
This commit changes the redfish behavior to move to a single, known name under the /redfish/v1/Systems/system path. This is advantageous for a lot of reasons. 1. Lots fewer dbus calls to determine the system name for every path. This could be optimized in other ways, like checking the system name on startup, but because redfish paths are not intended to be informative, this patchset takes the opinion that less code is better. 2. Lots of lowered complexity, given that each endpoint underneath /system doesn't need an individual "does this system exist, and is the name right" check. 3. This makes it possible to correctly implement the "Links" property in Chassis, which is required for the OCP base server profile Tested By: Very minimal testing done, but it seems to pass the validator. Change-Id: Iea3cb5081b92a3843b6877decd009936de00561c Signed-off-by: Ed Tanous <ed.tanous@intel.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'redfish-core/lib/chassis.hpp')
-rw-r--r--redfish-core/lib/chassis.hpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index fd03c8f596..821c7b3eeb 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -218,18 +218,16 @@ class Chassis : public Node
asyncResp->res.jsonValue["Power"] = {
{"@odata.id", "/redfish/v1/Chassis/" +
chassisId + "/Power"}};
-
- // TODO: An array of references to computer systems
- // contained in this chassis.
- // res.jsonValue["Links"]["ComputerSystems"]
- // =
- // {{{"@odata.id",
- // "/redfish/v1/Systems/1"}}};
- // An array of references to the Managers
- // responsible for managing this chassis.
- // res.jsonValue["Links"]["ManagedBy"] =
- // {{{"@odata.id",
- // "/redfish/v1/Managers/1"}}};
+ asyncResp->res.jsonValue["Status"] = {
+ {"Health", "OK"},
+ {"State", "Enabled"},
+ };
+
+ asyncResp->res
+ .jsonValue["Links"]["ComputerSystems"] = {
+ {{"@odata.id", "/redfish/v1/Systems/system"}}};
+ asyncResp->res.jsonValue["Links"]["ManagedBy"] = {
+ {{"@odata.id", "/redfish/v1/Managers/bmc"}}};
},
connectionName, path, "org.freedesktop.DBus.Properties",
"GetAll",