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>
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 9325a93..137ab7e 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -1203,7 +1203,7 @@
"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 @@
{"AlwaysOff", "xyz.openbmc_project.Control.Power.RestorePolicy.Policy."
"AlwaysOff"},
{"LastState", "xyz.openbmc_project.Control.Power.RestorePolicy.Policy."
- "LastState"}};
+ "Restore"}};
std::string powerRestorPolicy;