bmcweb: Update to use delay-reset not async timer
The old patch used an async timer, which left the state in bmcweb.
This new patch uses a delay-reset service that handles the state.
Tested:
curl http://localhost:80/redfish/v1/Systems/system/ResetActionInfo/
{
"@odata.id": "/redfish/v1/Systems/system/ResetActionInfo",
"@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
"Id": "ResetActionInfo",
"Name": "Reset Action Info",
"Parameters": [
{
"AllowableValues": [
"On",
"ForceOff",
"ForceOn",
"ForceRestart",
"GracefulRestart",
"GracefulShutdown",
"PowerCycle",
"Nmi"
],
"DataType": "String",
"Delay": "Number",
"Name": "ResetType",
"Required": true
}
]
}
curl http://localhost:80/redfish/v1/Systems/system/Actions/ComputerSystem.Reset/ -d "{\"ResetType\": \"ForceOn\", \"Delay\": 5 }"
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request completed successfully.",
"MessageArgs": [],
"MessageId": "Base.1.13.0.Success",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}
journalctl
systemd[1]: Starting Delay power off...
(5 seconds later)
systemd[1]: Started Delay power off.
curl[11898]: % Total % Received % Xferd Average Speed Time Time Time Current
curl[11898]: Dload Upload Total Spent Left Speed
curl[11898]: [158B blob data]
curl[11898]: {
curl[11898]: "@Message.ExtendedInfo": [
curl[11898]: {
curl[11898]: "@odata.type": "#Message.v1_1_1.Message",
curl[11898]: "Message": "The request completed successfully.",
curl[11898]: "MessageArgs": [],
curl[11898]: "MessageId": "Base.1.13.0.Success",
curl[11898]: "MessageSeverity": "OK",
curl[11898]: "Resolution": "None"
curl[11898]: }
curl[11898]: ]
bmcweb[11842]: W0210 19:17:45.846359 11842 grpc_server.h:81] Received request; |url|=/redfish/v1/Systems/system/Memory/dimm10/MemoryMetrics; |method|=GET
systemd[1]: delay-reset@5.service: Deactivated successfully.
curl[11898]: }
$ curl http://localhost:80/redfish/v1/Systems/system/Actions/ComputerSystem.Reset/ -d "{\"ResetType\": \"ForceOn\", \"Delay\": 123}"
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The value '120' for the property Delay is not in the supported range of acceptable values.",
"MessageArgs": [
"120",
"Delay"
],
"MessageId": "Base.1.13.0.PropertyValueOutOfRange",
"MessageSeverity": "Warning",
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed."
}
],
"code": "Base.1.13.0.PropertyValueOutOfRange",
"message": "The value '120' for the property Delay is not in the supported range of acceptable values."
}
}
$ curl http://localhost:80/redfish/v1/Systems/system/Actions/ComputerSystem.Reset/ -d "{\"ResetType\": \"ForceOff\", \"Delay\": 5}"
{
"resetType@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The value 'ForceOff' for the property resetType is not in the list of acceptable values.",
"MessageArgs": [
"ForceOff",
"resetType"
],
"MessageId": "Base.1.13.0.PropertyValueNotInList",
"MessageSeverity": "Warning",
"Resolution": "Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed."
}
]
}
Patch tracking info stays the same.
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I1855aa618b5e64d671ae5b1c667ee9769f3d1632
(cherry picked from commit 4cc363ca86919535778f462fde69c5e2bb55d6a1)
1 file changed