本介面用於啟動一台ECS執行個體,您可以透過指定執行個體ID以及按需設定 InitLocalDisk 等參數啟動執行個體。
介面說明
該介面為非同步介面,執行個體的啟動不是立即完成的,成功呼叫後,執行個體會先進入啟動中(Starting)狀態,您可以呼叫 DescribeInstanceStatus 查看執行個體狀態,當返回的狀態為Running時代表啟動成功。
使用須知
被安全鎖定的執行個體不能透過呼叫該介面啟動。更多資訊,請參閱資源安全鎖定對呼叫 API 的影響。
ECS 執行個體狀態必須為已停止(
Stopped)。節省停機模式下可能會因為庫存不足導致啟動失敗。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:StartInstance |
update |
*Instance
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| InstanceId |
string |
是 |
指定啟動的執行個體 ID。 |
i-bp67acfmxazb4p**** |
| InitLocalDisk |
boolean |
否 |
當本機磁碟出現故障時,可透過此參數指定啟動執行個體時,是否將執行個體恢復到最初的健康狀態。適用於執行個體規格族 d1、i1 或者 i2 等包含本機磁碟的執行個體。取值範圍:
預設值為 false。 |
true |
| DryRun |
boolean |
否 |
是否只預檢查此次請求。取值範圍:
預設值為 false。 |
true |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | LackResource | There's no enough resource on the specified capacity reservation. | |
| 400 | InvalidDedicatedHost.NotEnoughResource | The specified dedicated host has not enough resource due to host affinity. | |
| 400 | InvalidInstance.NotFoundSystemDisk | The specified instance does not have system disk. | |
| 400 | Invalid.PrivatePoolOptions.NoStock | The PrivatePool has been used up. | 指定的私有集區(彈性保障、資源預訂)容量已經使用完。 |
| 500 | InstanceNotReady | The specified instance is not ready for use. | |
| 500 | InternalError | The request processing has failed due to an internal error and you may retry later or contact support with the request ID. | |
| 403 | 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. | |
| 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. | 磁碟掛載的執行個體因安全原因被鎖定。 |
| 403 | InsufficientBalance | Your account does not have enough balance. | |
| 403 | DiskError | IncorrectDiskStatus. | |
| 403 | InstanceExpired | The postPaid instance has been expired.Please ensure your account have enough balance. | 包年包月執行個體已過期,請您續費後再進行操作。 |
| 403 | InstanceNotReady | The specified instance is not ready for use. | |
| 403 | DiskInArrears | The specified operation is denied as your disk has expired. | |
| 403 | OperationDenied.SpotPriceLowerThanPublicPrice | The spot instance price is lower than public price. | 搶占式執行個體的競價價格不能低於公開的價格。 |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK needs to be added ECS tag. | CMK 需要新增 ECS 標籤。 |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | The ECS service is not authorized to access your KMS key. Please grant the ECS service permission to use the key and try again. | |
| 403 | QuotaExceed.ElasticQuota | No additional quota is available for the specified ECS instance type. | 您在當前地域選擇的執行個體規格所要建立的台數超出系統限額,或者全執行個體規格 vCPU 配額超出系統限額,您可以前往 ECS 管理主控台或配額中心申請提高限額。 |
| 403 | OperationDenied.HostRepairing | The specified operation is denied as the host of ECS instance is being repaired. | ECS 執行個體所在實體機正在維修中,不允許執行指定操作。 |
| 403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone, try other types of resources or other regions and zones. | 指定的可用區或叢集中不存在指定磁碟類別,或指定的可用區與叢集不匹配。 |
| 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 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的執行個體不存在,請您檢查執行個體 ID 是否正確。 |
| 404 | InvalidCapacityReservationId.NotFound | The specified capacity reservation does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 請求後端逾時,請稍後重試。 |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. | 目前服務不可用。請稍後重試。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。