diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2022-08-05 20:01:32 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-08-10 17:38:26 +0300 |
commit | 54dce7f5d81a1f89061d19bdae657625273d5faa (patch) | |
tree | 66bdc2a9eb71015874e13421de3a01909c7dc720 | |
parent | 351053f210e8b233f680bde66d9ea9760c22d848 (diff) | |
download | bmcweb-54dce7f5d81a1f89061d19bdae657625273d5faa.tar.xz |
Add redfish-oem-manager-fan-data option
IBM doesn't use the Redfish OEM fan data in OemManager.
IBM does not use phosphor-pid-control instead using
phosphor-fan-presence and such.
This is data such as PidControllers, StepwiseControllers, FanZones,
FanControllers, and Profile.
This has been in bmcweb since Oct 2018 so defaulting this flag to
enabled to not break anyone.
Why we want a flag:
1) Have observed 500 errors with getting the thermalMode.
"Jan 24 16:34:57 rain534 bmcweb[435]: (2022-01-24 16:34:57) [ERROR
"managers.hpp":1196] GetPIDValues: Can't get thermalModeIface
/xyz/openbmc_project/control/thermal/0"
2) This Redfish OEM fan data includes PATCHing.
Commit turning this off in meta-ibm:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/56327
Tested: With this flag enabled and disabled.
Manager resource looks as expected.
Before on a dummy PATCH to this:
curl -k -X PATCH https://$bmc/redfish/v1/Managers/bmc -d \
'{"Oem":{"OpenBmc":{"Fan":{"Profile":"Acoustic"}}}}'
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request failed due to an internal service...
With this change and the meta-ibm change (instead see a PropertyUnknown)
curl -k -X PATCH https://$bmc/redfish/v1/Managers/bmc -d \
'{"Oem":{"OpenBmc":{"Fan":{"Profile" : "Acoustic"} }}}'
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The property %1 is not in the list of valid...
"MessageArgs": [
"Oem"
],
"MessageId": "Base.1.13.0.PropertyUnknown",
PATCHed the DateTime with this enabled.
Change-Id: I374292ca2798e096b18d49df5bbc7a93c7f1c400
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | meson_options.txt | 9 | ||||
-rw-r--r-- | redfish-core/lib/managers.hpp | 7 |
3 files changed, 17 insertions, 0 deletions
diff --git a/meson.build b/meson.build index ad1f4018dd..b9f37325c7 100644 --- a/meson.build +++ b/meson.build @@ -80,6 +80,7 @@ feature_map = { 'redfish-dump-log' : '-DBMCWEB_ENABLE_REDFISH_DUMP_LOG', 'redfish-host-logger' : '-DBMCWEB_ENABLE_REDFISH_HOST_LOGGER', 'redfish-new-powersubsystem-thermalsubsystem' : '-DBMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM', + 'redfish-oem-manager-fan-data' : '-DBMCWEB_ENABLE_REDFISH_OEM_MANAGER_FAN_DATA', 'redfish-provisioning-feature' : '-DBMCWEB_ENABLE_REDFISH_PROVISIONING_FEATURE', 'redfish-post-to-old-updateservice' : '-DBMCWEB_ENABLE_REDFISH_UPDATESERVICE_OLD_POST_URL', 'redfish' : '-DBMCWEB_ENABLE_REDFISH', diff --git a/meson_options.txt b/meson_options.txt index a32a4a4f99..ecc7aebc22 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -224,6 +224,15 @@ option( ) option( + 'redfish-oem-manager-fan-data', + type: 'feature', + value: 'enabled', + description: '''Enables Redfish OEM fan data on the manager resource. + This includes PID and Stepwise controller data. See + OemManager schema for more detail.''' +) + +option( 'https_port', type: 'integer', min: 1, diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp index d1e43fb448..dcd7876c99 100644 --- a/redfish-core/lib/managers.hpp +++ b/redfish-core/lib/managers.hpp @@ -2063,8 +2063,10 @@ inline void requestRoutesManager(App& app) managerDiagnosticData["@odata.id"] = "/redfish/v1/Managers/bmc/ManagerDiagnosticData"; +#ifdef BMCWEB_ENABLE_REDFISH_OEM_MANAGER_FAN_DATA auto pids = std::make_shared<GetPIDValues>(asyncResp); pids->run(); +#endif getMainChassisId(asyncResp, [](const std::string& chassisId, @@ -2215,6 +2217,7 @@ inline void requestRoutesManager(App& app) if (oem) { +#ifdef BMCWEB_ENABLE_REDFISH_OEM_MANAGER_FAN_DATA std::optional<nlohmann::json> openbmc; if (!redfish::json_util::readJson(*oem, asyncResp->res, "OpenBmc", openbmc)) @@ -2244,6 +2247,10 @@ inline void requestRoutesManager(App& app) pid->run(); } } +#else + messages::propertyUnknown(asyncResp->res, "Oem"); + return; +#endif } if (links) { |