[Redfish] Add OCP required properties for Chassis
- Thermal
- Redundancy
- Fans
Tested:
GET /redfish/v1/Chassis/<chassis id>/Thermal HTTP/1.1
Response:
{
"@odata.context": "/redfish/v1/$metadata#Thermal.Thermal",
"@odata.id": "/redfish/v1/Chassis/<chassis id>/Thermal",
"@odata.type": "#Thermal.v1_4_0.Thermal",
"Fans": [],
"Id": "Thermal",
"Name": "Thermal",
"Redundancy": [],
"Temperatures": [
{
"@odata.id": "/redfish/v1/Chassis/<chassis id>/Thermal#/Temperatures/0",
"@odata.type": "#Thermal.v1_3_0.Temperature",
"LowerThresholdCritical": 0,
"LowerThresholdNonCritical": 5,
"MaxReadingRangeTemp": 127,
"MemberId": "BMC_Temp",
"MinReadingRangeTemp": -128,
"Name": "BMC_Temp",
"ReadingCelsius": 34.6870002746582,
"Status": {
"Health": "OK",
"State": "Enabled"
},
"UpperThresholdCritical": 115,
"UpperThresholdNonCritical": 110
},
...
}
Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
Change-Id: I8fe41e698ef55b02779b04468dee51ebe5561762
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 0736149..c44ff71 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -273,6 +273,9 @@
{
sensorsAsyncResp->res.jsonValue["@odata.type"] =
"#Thermal.v1_4_0.Thermal";
+ sensorsAsyncResp->res.jsonValue["Fans"] = nlohmann::json::array();
+ sensorsAsyncResp->res.jsonValue["Temperatures"] =
+ nlohmann::json::array();
}
sensorsAsyncResp->res.jsonValue["@odata.id"] =
"/redfish/v1/Chassis/" + sensorsAsyncResp->chassisId + "/" +
@@ -1015,6 +1018,7 @@
std::move(getConnectionCb));
BMCWEB_LOG_DEBUG << "getChassisCb exit";
};
+ SensorsAsyncResp->res.jsonValue["Redundancy"] = nlohmann::json::array();
// Get set of sensors in chassis
getChassis(SensorsAsyncResp, std::move(getChassisCb));
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 384fe1a..56ffc5a 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -51,7 +51,6 @@
return;
}
const std::string& chassisName = params[0];
-
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
res, chassisName, typeList, "Thermal");