Reboot a device
POST/api/v1/devices/{deviceId}/commands:reboot
Requests a remote reboot. Side effect: the device goes offline while it restarts and is briefly unreachable before it reconnects. 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 reboot, status=0 means the device accepted the command and is restarting; 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 is not an admin of the organization owning this device (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.