Shut down a device
POST/api/v1/devices/{deviceId}/commands:shutdown
Requests a remote shutdown. Side effect: the device powers off and stays off. It will not respond again until it is manually powered on. 202 returns a command-result object; then GET commands/results and match the returned reqSeqId in the items to follow the outcome.
Request
Responses
- 202
- 400
- 401
- 403
- 404
- 409
- 422
- 503
Accepted. Track the command in GET commands/results by its reqSeqId until phase is result. For a shutdown, status=0 means the device accepted the command and is powering off; status=1 means it failed, and error.code gives the reason (timedOut if the device did not respond within timeoutSeconds; notSupported, permissionDenied or executionFailed if the device rejected the command).
Malformed request body, or the caller's resource_access claim could not be parsed.
Authentication is required, or the token is invalid.
The caller's role in the organization owning this device is below Admin (Command.NotAuthorized).
Device not found or outside the organizations the caller can access (Device.NotFound), or the device publishes no DTDL model at all (Command.NotFound).
The device is not connected, so the command is rejected rather than queued (Command.OfflineDevice)
Either the target device's agent provides no capability model, or the device does not declare this command (Device.CapabilityNotSupported), or delaySeconds / timeoutSeconds is out of range (timeoutSeconds must be 15..86400) (Command.InvalidParameters). The example below shows the first.
The device's command catalog could not be read. Transient. The device may well support this command; retry.