diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2020-11-25 23:17:37 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2020-12-15 02:24:18 +0300 |
commit | d6aa0093aa8736b36766df0197f7b3bb80fe4af7 (patch) | |
tree | 88614251128b44ff5f87742b67a8bb1a66712b1a | |
parent | 8ba7ae5b697305b9e9829186e1017977325225ce (diff) | |
download | bmcweb-d6aa0093aa8736b36766df0197f7b3bb80fe4af7.tar.xz |
IndicatorLED: Add a deprecated warning header
Added a warning header when IndicatorLED is patched telling the
client it is deprecated and pointing to LocationIndicatorActive.
Used the warning syntax from
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Warning
Tested: curl -X PATCH -v -d '{ "IndicatorLED":"Off"}' \
-k https://$bmc/redfish/v1/Systems/system
...
< HTTP/1.1 204 No Content
< Warning: 299 - "IndicatorLED is deprecated. Use LocationIndicatorActive instead."
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< X-Frame-Options: DENY
Change-Id: Ic25a02508b0a1bcada1fa71ffa413c493fad00c4
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
-rw-r--r-- | redfish-core/lib/chassis.hpp | 6 | ||||
-rw-r--r-- | redfish-core/lib/systems.hpp | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp index cd26849c65..2ebdaefff2 100644 --- a/redfish-core/lib/chassis.hpp +++ b/redfish-core/lib/chassis.hpp @@ -416,6 +416,12 @@ class Chassis : public Node { return; // delete this when we support more patch properties } + if (indicatorLed) + { + res.addHeader(boost::beast::http::field::warning, + "299 - \"IndicatorLED is deprecated. Use " + "LocationIndicatorActive instead.\""); + } const std::array<const char*, 2> interfaces = { "xyz.openbmc_project.Inventory.Item.Board", diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp index 2817d924da..9325a93a22 100644 --- a/redfish-core/lib/systems.hpp +++ b/redfish-core/lib/systems.hpp @@ -2233,6 +2233,9 @@ class Systems : public Node if (indicatorLed) { setIndicatorLedState(asyncResp, *indicatorLed); + res.addHeader(boost::beast::http::field::warning, + "299 - \"IndicatorLED is deprecated. Use " + "LocationIndicatorActive instead.\""); } if (powerRestorePolicy) |