diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2021-01-06 04:43:44 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2021-01-06 05:23:16 +0300 |
commit | 37ec9072744ab5dec475741c440c6fbbcc7f43ba (patch) | |
tree | 9e3559ecf5b3103c3824f606a2cb37ffff3fe4d0 /redfish-core/lib/systems.hpp | |
parent | 6868ff503529feceba217da7a223b0dfd83628b8 (diff) | |
download | bmcweb-37ec9072744ab5dec475741c440c6fbbcc7f43ba.tar.xz |
Fix Power Restore Policy to match D-Bus
The D-Bus Power Restore Policies are AlwaysOn, AlwaysOff, and Restore.
https://github.com/openbmc/phosphor-dbus-interfaces/blob/32304979b404c24e32f195d08c667e65b9b34695/xyz/openbmc_project/Control/Power/RestorePolicy.interface.yaml#L23
The Redfish states are AlwaysOn, AlwaysOff, and LastState.
Tested: Validator passes.
curl -v -k -X PATCH -d '{"PowerRestorePolicy":"LastState"}' \
https://${bmc}/redfish/v1/Systems/system
...
< HTTP/1.1 204 No Content
curl -k https://${bmc}/redfish/v1/Systems/system
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_13_0.ComputerSystem",
...
"Name": "system",
"PowerRestorePolicy": "LastState",
"PowerState": "Off",
"ProcessorSummary": {
"Count": 0,
Change-Id: I4d91bd4480f626467e3bb9804fa0392bbafcc891
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'redfish-core/lib/systems.hpp')
-rw-r--r-- | redfish-core/lib/systems.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp index 9325a93a22..137ab7e8c7 100644 --- a/redfish-core/lib/systems.hpp +++ b/redfish-core/lib/systems.hpp @@ -1203,7 +1203,7 @@ inline void getPowerRestorePolicy(const std::shared_ptr<AsyncResp>& aResp) "AlwaysOff", "AlwaysOff"}, {"xyz.openbmc_project.Control.Power.RestorePolicy.Policy." - "LastState", + "Restore", "LastState"}}; const std::string* policyPtr = std::get_if<std::string>(&policy); @@ -1541,7 +1541,7 @@ inline void setPowerRestorePolicy(const std::shared_ptr<AsyncResp>& aResp, {"AlwaysOff", "xyz.openbmc_project.Control.Power.RestorePolicy.Policy." "AlwaysOff"}, {"LastState", "xyz.openbmc_project.Control.Power.RestorePolicy.Policy." - "LastState"}}; + "Restore"}}; std::string powerRestorPolicy; |