9. Actions
9.1 System Reset
Actions are used for operations that do not map easily to CRUD (create, read, update, and delete) semantics. For example, performing a reset of a device is not as simple as modifying a desired property since a reset operation will likely start various sequences and state transitions internal to the device, which will cause many other properties in the model to change.
The Actions property in a resource is an object that contains the available actions that can be performed on the resource. Each property inside of the Actions property represents one of the actions supported on the resource. It also contains properties that describe the supported parameters and parameter values for each action. Clients can perform a POST operation on the action URI to invoke the action.
The following example shows the supported actions for a ComputerSystem resource found at the URI /redfish/v1/Systems/1:
{
"@odata.id": "/redfish/v1/Systems/1",
"@odata.type": "#ComputerSystem.v0_0_1.ComputerSystem",
"Id": "1",
"Name": "avtoob_000001",
"Actions": {
"#ComputerSystem.Reset": {
"target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset",
"ResetType@Redfish.AllowableValues": [
"On",
"ForceOff",
"ForceRestart",
"GracefulShutdown",
"GracefulRestart"
]
}
},
... <Other ComputerSystem properties>
}
In the previous example, there is one action supported named #ComputerSystem.Reset. The target property contains the URI on which the client performs the POST operation. It also contains ResetType@Redfish.AllowableValues to show the supported values for the ResetType parameter. Additionally, if the client wants to modify the duration that the power or reset button is held down, it can include the optional DurationInMs parameter. When this parameter is provided, its value (in milliseconds) will be used; if omitted, a default duration will apply.
The request may also include the optional PowerOnTimeoutSeconds parameter, which specifies the maximum time (in seconds) allowed for the device to complete its boot process after issuing a On command. Valid values range from 10 to 300 seconds. If this parameter is not provided, a default timeout of 90 seconds will be used.
A user can perform a force restart of the system with the following request:
curl -k -X POST 'https://<REDFISH-HOST>/redfish/v1/Systems/1/Actions/ComputerSystem.Reset' \
-H "Content-Type: application/json" -H 'X-Auth-Token: <SESSION-TOKEN>' \
-d '{ "ResetType": "ForceRestart", "DurationInMs":1000 }'
Response:
HTTP Status Code: 204 No Content
If the operation is successful, a status code 204 No Content will be returned.
HTTP Status Code: 202 Accepted
When the service returns an HTTP 202 Accepted status code, it indicates that the ERMI module has accepted the request and has created a Task to process the requested power command asynchronously.
The response includes a TaskMonitor property, which provides the URI of the newly created Task.
Clients should issue a GET request to the TaskMonitor URI to track the execution state and result of the Task.
HTTP Status Code: 400 Bad Request
If the ResetType command requires the ERMI daemon to execute the operation but the ERMI daemon is not running or not present, the request will return 400 Bad Request.
A 400 Bad Request will also be returned if the requested ResetType does not match the current power state of the device. For example, issuing a GracefulRestart command while the system is currently powered off will result in this error.
Additionally, if any parameter in the request body contains invalid values or an unsupported configuration, the service will return 400 Bad Request.
HTTP Status Code: 409 Conflict
Some power-related commands are executed asynchronously through tasks. If the ERMI module has already reached its maximum number of allowed tasks (10), any additional request that requires task creation will fail with a 409 Conflict status code.
HTTP Status Code: 500 Internal Server Error
If an unexpected issue occurs during the execution of a power command, the request will fail with a 500 Internal Server Error. For example, if a GracefulRestart command is delegated to the ERMI daemon but the daemon returns an execution failure or becomes unresponsive, the system will respond with a 500 error.
9.2 Camera Action
curl -k -X POST 'https://<REDFISH-HOST>/redfish/v1/Systems/1/Oem/Camera/Actions/Camera.Active' \
-H "Content-Type: application/json" -H 'X-Auth-Token: <SESSION-TOKEN>' \
-d '{ "ActivetType": "StreamStart" }'
Response:
HTTP Status Code: 204 No Content
If the operation is successful, a status code 204 No Content will be returned.
9.3 Manager Reset
The Manager.Reset action in Redfish is used to reset a management controller, such as a BMC (Baseboard Management Controller). This action allows user to remotely restart the manager without requiring physical access to the hardware.
Typical use cases include applying new configurations, recovering from a non-responsive state, or performing maintenance operations.
The action accepts a ResetType parameter, which defines the type of reset to perform (for example, GracefulRestart).
When invoked, the manager will terminate running processes and reboot according to the specified reset type.
Important: Using this action will temporarily interrupt Redfish services and other management functions until the manager becomes available again.
URI: /redfish/v1/Managers/{managerId}/Actions/Manager.Reset
Method: POST
Request Body Example:
Response
HTTP Status Code: 204 No Content
If the operation is successful, a status code 204 No Content will be returned.
HTTP Status Code: 403 Forbidden
If the session token is invalid, a status code 403 Forbidden will be returned.
HTTP Status Code: 400 Bad Request
If the request body is not in JSON format, or the parameter is invalid, a 400 Bad Request status code will be returned.