diff options
author | Johnathan Mantey <johnathanx.mantey@intel.com> | 2019-05-02 19:22:38 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-05-09 20:02:40 +0300 |
commit | 49c53ac9b88fbf71f55076121a1605a760fa0096 (patch) | |
tree | 982a980d848fb4350a21c9028adf5279d78fcfd7 /redfish-core/lib/chassis.hpp | |
parent | 958201849f343b6acc298b8e165d7858bd4ed128 (diff) | |
download | bmcweb-49c53ac9b88fbf71f55076121a1605a760fa0096.tar.xz |
Acquire chassis sensors using the sensor association DBus item
Each entry in the Chassis Collection has, or will have, a sensors DBus
item that lists the sensors that Chassis node contains. This change
queries that DBus entry, and uses the information to collect the
Thermal or Power sensor information.
Tested:
GET https://10.243.48.59/redfish/v1/Chassis/WP_Baseboard
GET https://10.243.48.59/redfish/v1/Chassis/WP_Baseboard/Power
GET https://10.243.48.59/redfish/v1/Chassis/WP_Baseboard/Thermal
On 2 representative systems, one with a chassis, and one without.
Observed correct behavior for both.
Ran Redfish service validator. Observed no errors in Chassis, Thermal,
Power, or ChassisCollection schemas.
Change-Id: I01fcb3707396e2e33345bf125d8ae95170088a2a
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'redfish-core/lib/chassis.hpp')
-rw-r--r-- | redfish-core/lib/chassis.hpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp index f78789a8a8..5cc4531055 100644 --- a/redfish-core/lib/chassis.hpp +++ b/redfish-core/lib/chassis.hpp @@ -279,13 +279,6 @@ class Chassis : public Node } #endif - res.jsonValue["@odata.type"] = "#Chassis.v1_4_0.Chassis"; - res.jsonValue["@odata.id"] = "/redfish/v1/Chassis/" + chassisId; - res.jsonValue["@odata.context"] = - "/redfish/v1/$metadata#Chassis.Chassis"; - res.jsonValue["Name"] = "Chassis Collection"; - res.jsonValue["ChassisType"] = "RackMount"; - auto asyncResp = std::make_shared<AsyncResp>(res); crow::connections::systemBus->async_method_call( [asyncResp, chassisId(std::string(chassisId))]( @@ -326,7 +319,17 @@ class Chassis : public Node continue; } - const std::string connectionName = connectionNames[0].first; + asyncResp->res.jsonValue["@odata.type"] = + "#Chassis.v1_4_0.Chassis"; + asyncResp->res.jsonValue["@odata.id"] = + "/redfish/v1/Chassis/" + chassisId; + asyncResp->res.jsonValue["@odata.context"] = + "/redfish/v1/$metadata#Chassis.Chassis"; + asyncResp->res.jsonValue["Name"] = "Chassis Collection"; + asyncResp->res.jsonValue["ChassisType"] = "RackMount"; + + const std::string &connectionName = + connectionNames[0].first; crow::connections::systemBus->async_method_call( [asyncResp, chassisId(std::string(chassisId))]( const boost::system::error_code ec, |