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>
diff --git a/meson.build b/meson.build
index ad1f401..b9f3732 100644
--- a/meson.build
+++ b/meson.build
@@ -80,6 +80,7 @@
'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 a32a4a4..ecc7aeb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -224,6 +224,15 @@
)
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 d1e43fb..dcd7876 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -2063,8 +2063,10 @@
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 @@
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 @@
pid->run();
}
}
+#else
+ messages::propertyUnknown(asyncResp->res, "Oem");
+ return;
+#endif
}
if (links)
{