Systems: Update LocationIndicatorActive property
Modify get/set of LocationIndicatorActive property for Systems to use
identifying association instead of hard-coding led group.[1]
History: Almost 5 years ago IBM added support for this property to the
Systems.[2] That original implementation assumed the system and chassis
shared the same LED and just looked at the enclosure_identify_blink and
enclosure_identify like the existing IndicatorLED property did.
IBM renamed these functions getSystemLocationIndicatorActive and
setSystemLocationIndicatorActive.[3]
The interest from other companies has mostly been around IndicatorLED
(old deprecated LED property).[4]
Today, LEDs have the association documented above and used elsewhere
like PowerSupplies, Fans, etc. Switching to this association: 1) follows
the design 2) allows multiple chassis support 3) doesn't assume your
system led is your chassis led.
This is the last caller of the getSystemLocationIndicatorActive() and
setSystemLocationIndicatorActive() functions so they are being removed.
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/58299
[2] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/36886
[3] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57765
[4] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/27301
Tested:
- Redfish Service Validator passes
- Confirm able to set and get LED
1. Get for Systems
```
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system
{
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_22_0.ComputerSystem",
...
"LocationIndicatorActive": false,
...
}
```
2. Set for Systems
```
curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PATCH -d '{"LocationIndicatorActive": true}' https://${bmc}/redfish/v1/Systems/system
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Systems/system
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_22_0.ComputerSystem",
...
"LocationIndicatorActive": true,
...
}
```
Change-Id: I1c06621586148d4b299b1f8e1ee1fb0ccdc51f10
Signed-off-by: George Liu <liuxiwei@inspur.com>
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
Co-authored-by: George Liu <liuxiwei@inspur.com>
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 2be5dde..e006b9a 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -3114,7 +3114,16 @@
aRsp->res.jsonValue["Links"]["Chassis"] = std::move(chassisArray);
});
- getSystemLocationIndicatorActive(asyncResp);
+ systems_utils::getValidSystemsPath(
+ asyncResp, systemName,
+ [asyncResp,
+ systemName](const std::optional<std::string>& validSystemsPath) {
+ if (validSystemsPath)
+ {
+ getLocationIndicatorActive(asyncResp, *validSystemsPath);
+ }
+ });
+
// TODO (Gunnar): Remove IndicatorLED after enough time has passed
getIndicatorLedState(asyncResp);
getComputerSystem(asyncResp);
@@ -3248,7 +3257,20 @@
if (locationIndicatorActive)
{
- setSystemLocationIndicatorActive(asyncResp, *locationIndicatorActive);
+ systems_utils::getValidSystemsPath(
+ asyncResp, systemName,
+ [asyncResp, systemName,
+ locationIndicatorActive{*locationIndicatorActive}](
+ const std::optional<std::string>& validSystemsPath) {
+ if (!validSystemsPath)
+ {
+ messages::resourceNotFound(asyncResp->res, "Systems",
+ systemName);
+ return;
+ }
+ setLocationIndicatorActive(asyncResp, *validSystemsPath,
+ locationIndicatorActive);
+ });
}
// TODO (Gunnar): Remove IndicatorLED after enough time has