diff options
author | Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> | 2019-01-31 22:13:39 +0300 |
---|---|---|
committer | James Feist <james.feist@linux.intel.com> | 2019-03-11 18:45:18 +0300 |
commit | 413961de57624a9eb35f46f143ba44f99f40b7ac (patch) | |
tree | d3deb535783812e2be8a8de381841377d8496a21 /redfish-core/lib/thermal.hpp | |
parent | 491d8ee799aa9405febc5d4276c6f93ad60e511f (diff) | |
download | bmcweb-413961de57624a9eb35f46f143ba44f99f40b7ac.tar.xz |
Patch support for sensor overrride
Support added for overriding sensor, which can be
used for validation / ad-hoc debugging. This provides
option to make PATCH call to redfish/v1/<chassisId>/Thermal
or power id. Based on schema, will accept Temperatures /
Voltages collection with properties MemberId and
ReadingCelsius / ReadingVolts.
TODO:
1. Need to make a dynamic way of enabling / disbaling this command.
Unit-Test:
1. Verified sensor values are getting updated by doing PATCH
method to a known sensor. Verified the value got updated
using ipmitool sensor list.
2. Verified negative cases of making PATCH call on invalid
chasisId, Invalid MemberId etc.
Testedeby:
Used Postman tool to issue the PATCH call to the
1. https://xx.xx.xx.xx/redfish/v1/Chassis/XXYYZZ/Thermal with
content
{
"Temperatures": [
{
"MemberId" : "SensorNameXX",
"ReadingCelsius" : valueXX
}
]
}
2. https://xx.xx.xx.xx/redfish/v1/Chassis/XXYYZZ/Power with
content
{
"Voltages": [
{
"MemberId" : "SensorNameXX",
"ReadingVolts" : valueXX
}
]
}
Change-Id: Idf2d891ac0d10b5d20f78c386232cae8a6896f1a
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Diffstat (limited to 'redfish-core/lib/thermal.hpp')
-rw-r--r-- | redfish-core/lib/thermal.hpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp index d0fbccfed8..4b2a0a45d2 100644 --- a/redfish-core/lib/thermal.hpp +++ b/redfish-core/lib/thermal.hpp @@ -37,6 +37,10 @@ class Thermal : public Node } private: + std::initializer_list<const char*> typeList = { + "/xyz/openbmc_project/sensors/fan", + "/xyz/openbmc_project/sensors/temperature", + "/xyz/openbmc_project/sensors/fan_pwm"}; void doGet(crow::Response& res, const crow::Request& req, const std::vector<std::string>& params) override { @@ -58,16 +62,16 @@ class Thermal : public Node "/redfish/v1/Chassis/" + chassisName + "/Thermal"; auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>( - res, chassisName, - std::initializer_list<const char*>{ - "/xyz/openbmc_project/sensors/fan", - "/xyz/openbmc_project/sensors/temperature", - "/xyz/openbmc_project/sensors/fan_pwm"}, - "Thermal"); + res, chassisName, typeList, "Thermal"); // TODO Need to get Chassis Redundancy information. getChassisData(sensorAsyncResp); } + void doPatch(crow::Response& res, const crow::Request& req, + const std::vector<std::string>& params) override + { + setSensorOverride(res, req, params, typeList, "Thermal"); + } }; } // namespace redfish |