Restarts an ECS instance.
Operation description
This is an asynchronous operation. After the instance is restarted, it enters the Starting state. You can call DescribeInstanceStatus to query the instance status. When the returned status is Running, the instance is restarted.
Before you begin
You cannot restart an instance that is locked for security reasons. For more information, see Impacts of resource security locks on API operations.
You can restart only ECS instances that are in the Running (
Running) state.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:RebootInstance |
update |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the instance. |
i-bp67acfmxazb4ph**** |
| ForceStop |
boolean |
No |
Specifies whether to forcefully stop ECS instance before restarting it. Valid values:
Default value: false. |
false |
| DryRun |
boolean |
No |
Specifies whether to perform only a dry run. Valid values:
Default value: false. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | The instance to which the disk is attached is locked for security reasons. |
| 403 | DiskError | IncorrectDiskStatus. | |
| 403 | InstanceExpiredOrInArrears | The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | %s | |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | %s | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | %s | |
| 403 | OperationDenied.KMSKeyUnauthorized | The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation. | |
| 404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region. | |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. | The service is currently unavailable. Please try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.