RebootInstance

Last Updated: Jan 29, 2018

Description

Restarts an ECS instance. When you call this interface, consider the following:

  • You can only restart an ECS instance that is in the Running status.

  • After an ECS instance is restarted, its transient status is Starting.

  • An instance can be forcefully stopped. Forcing an instance to stop (ForceStop) is same as a power failure. The temporary data and files in the instance may be lost.

  • If the specified instance is locked, and the OperationLocks of the instance indicates "LockReason" : "security", you cannot restart the instance.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: RebootInstance.
InstanceId String Yes The specified instance ID.
ForceStop String No Whether to force shutting down the instance before it restarts. Optional values:
  • true: Forces shutting down the instance before it restarts.
  • false: Shuts down the instance normally before it restarts.
Default value: false.

Response parameters

All parameters are common response parameters. For more information, see Common parameters.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=RebootInstance
  2. &InstanceId=i-instance1
  3. &<Common Request Parameters>

Response example

XML format

  1. <RebootInstanceResponse>
  2. <RequestId>F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A</RequestId>
  3. </RebootInstanceResponse>

JSON format

  1. {
  2. "RequestId": "F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A"
  3. }

Error codes

Error code Error message HTTP status code Meaning
MissingParameter The input parameter InstanceId that is mandatory for processing this request is not supplied. 400 You must specify the InstanceId.
InvalidParameter The specified parameter ForceStop is not valid. 400 The specified ForceStop is invalid.
DiskError IncorrectDiskStatus. 403 Abnormal disk status.
IncorrectInstanceStatus The current status of the resource does not support this operation. 403 You can only restart an ECS instance that is in Running status.
InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 403 Your instance is locked for security reasons.
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified InstanceId does not exist.
Thank you! We've received your feedback.