本介面用於續約一台訂用帳戶的 ECS 執行個體,支援您設定續約時間長度或者續約至統一到期日。
介面說明
請確保在使用該介面前,您已充分瞭解Elastic Compute Service 的計費方式和價格。
請確保您的帳號餘額或信用額度充足。
僅支援訂用帳戶的執行個體,隨用隨付的執行個體調用該介面會報錯。
續約時間長度參數(
Period、PeriodUnit)與統一到期日參數(ExpectedRenewDay)必須指定其中之一,但不能同時設定。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:RenewInstance |
update |
*Instance
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ClientToken |
string |
否 |
保證請求等冪性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多詳情,請參見如何保證等冪性。 |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| InstanceId |
string |
是 |
需要續約的執行個體 ID。 |
i-bp67acfmxazb4p**** |
| Period |
integer |
否 |
訂用帳戶續約時間長度。一旦指定了 PeriodUnit=Month 時,Period 取值:1、2、3、4、5、6、7、8、9、12。 說明
您必須指定續約時間長度參數( |
1 |
| PeriodUnit |
string |
否 |
續約時間長度的時間單位,即參數 Period 的單位。取值範圍: Month。 預設值:Month。 |
Month |
| ExpectedRenewDay |
integer |
否 |
用於續約執行個體至統一到期日。取值範圍:1~28。 使用該參數,您需要設定 ECS 執行個體統一到期日,該參數值必須與您已設定的統一到期日保持一致,否則將調用失敗。 說明
您必須指定續約時間長度參數( |
5 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| OrderId |
string |
訂單 ID。 |
1234567890 |
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
樣本
正常返回樣本
JSON格式
{
"OrderId": "1234567890",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidInternetChargeType.ValueNotSupported | The specified InternetChargeType is not valid. | 暫不支援指定的網路付費類型的執行個體,請確認相關參數是否正確。 |
| 400 | InvalidInstanceType.NotSupported | The specified InstanceType is not Supported. | |
| 400 | InvalidParameter | The specified parameter "InternetMaxBandwidthOut" is not valid. | |
| 400 | InvalidInstanceChargeType.NotFound | The InstanceChargeType does not exist in our records. | 指定的執行個體計費方式不存在。 |
| 400 | InvalidRebootTime.Malformed | The specified RebootTime is not valid. | |
| 400 | InvalidRebootTime.ValueNotSupported | The specified RebootTime is out of the permitted range. | 指定的重啟時間超出取值範圍。 |
| 400 | IdempotenceParamNotMatch | Request uses a client token in a previous request but is not identical to that request. | 與相同 ClientToken 的請求參數不符合。 |
| 400 | InvalidClientToken.ValueNotSupported | The ClientToken provided is invalid. | 指定的 ClientToken 不合法。 |
| 400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | 您指定的執行個體規格不存在,或者您沒有許可權操作此規格的執行個體。 |
| 400 | InvalidInstanceType.codeUnauthorized | The specified InstanceType is not authorized. | 指定的 InstanceType 不合法。 |
| 400 | InvalidInternetChargeType.InstanceNotSupported | The specified instance which is in vpc is not support the parameter InternetChargeType. | 指定的 VPC 網路執行個體不支援指定的網路計費方式。 |
| 400 | InvalidPeriod | The specified period is not valid. | 指定的時段不合法。 |
| 400 | MissingParamter | The specified parameter "Period" is not null. | 操作中缺少了必要的參數 "Period" |
| 400 | Upgrade.NotSupported | Upgrade operation is not supported. | 升級操作不合法。 |
| 400 | OperationDenied | Specified instance is in VPC. | 指定執行個體存在於 VPC。 |
| 400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | |
| 400 | DependencyViolation.InstanceType | Current instancetype cannot be changed to the specified one. | 當前執行個體規格不能更改為指定規格。 |
| 400 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | 參數 PeriodUnit 無效。 |
| 400 | InvalidDedicatedHostId.NotFound | The specified DedicatedHostId does not exist. | 指定的Dedicated Host不存在。 |
| 400 | InvalidDedicatedHostStatus.NotSupport | Operation denied due to dedicated host status. | Dedicated Host當前的狀態不支援此操作。 |
| 400 | IncorrectDedicatedHostStatus | The current status of the resource does not support this operation. | 當前資源的狀態不支援此操作。 |
| 400 | InvalidPeriod.ExceededDedicatedHost | Instance expired date can't exceed dedicated host expired date. | |
| 400 | InvalidStatus.Upgrading | The instance is upgrading; please try again later. | 執行個體正在升級,請稍後重試。 |
| 400 | InvalidPeriod.ExceededMaximumExpirationDate | The specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt. | 指定的續訂期限不能超過最大有效期間限。我們建議您嘗試在下次嘗試時縮短續訂時間。 |
| 400 | LastOrderProcessing | The previous order is still processing, please try again later. | 訂單正在處理中,稍後重試。 |
| 400 | Idempotence.Processing | The previous request is still processing, please try again later. | 請求正在處理中,稍後重試。 |
| 400 | InvalidLoanOrderStatus.Uncompleted | Any unpaid order must be cancelled before you try this action again. The scheduled unpaid order is a loan order that cannot be auto cancelled. For more information, visit the loan management center. | |
| 400 | OperationDenied.UnfinishedOrder | The current instance has unfinished refundOrder, this operation is denied. | 執行個體存在未完成的退款訂單,請耐心等待,稍後重試。 |
| 400 | InvalidPeriod.NotFound | The specified period and expectedRenewDay cannot both be empty. | |
| 400 | InvalidExpectedRenewDay.StarterPackageNotSupported | The specified starterPackage cannot support renew with expectedRenewDay. | |
| 400 | InvalidParam.ExpectedRenewDay | The specified param ExpectedRenewDay is not valid. | |
| 400 | QuotaExceed.AlignInstance | The maximum number of align operations is exceeded. | |
| 400 | InvalidExpectedRenewDay.Conflict | The specified expectedRenewDay is in conflict with period. | |
| 400 | InvalidExpectedRenewDay.ValueNotSupported | The specified parameter ExpectedRenewDay is not valid. | |
| 400 | OperationDenied.AbnormalInstanceInfo | The current renewable operation is not supported due to abnormal information of the instance, please submit ticket to process. | |
| 400 | NoPermission.Price | The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. | 該操作需要價格許可權。請向您的主賬戶申請許可權,或將參數AutoPay設定為true進行自動支付。 |
| 400 | InvalidOperation.ClassicNetworkTypeNotSupported | The classic network instance does not support this operation. | 抱歉,您續約的基於傳統網路架構的執行個體已無法續約,需要遷移至專用網路進行正常續約操作。 |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | |
| 403 | Diskcategory.Mismatch | The disk specified to convert to portable is not allowed due to the disk category does not support. | 由於磁碟種類限制,指定的磁碟不能轉換為可卸載磁碟。 |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | InstanceSpecModification.NotEffective | The specified instance has been reserved for making a spec modification and not taken effective in the current contract period. | 指定的執行個體因規格調整被保留,在當前合約期內無法生效。 |
| 403 | LastTokenProcessing | The last token request is processing. | |
| 403 | Instance.UnPaidOrder | The specified instance has unpaid order. | |
| 403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | 執行個體被安全鎖定。 |
| 403 | InvalidDisk.NotAllowed | The specified disk is not allowed to be converted to portable. | |
| 403 | InstanceTypeNotSupported | The specified zone does not offer the specified instancetype. | |
| 403 | InvalidChargeType.NotSupported | The chargeType of the instance does not support this operation. | 該付費類型的執行個體不支援該操作。 |
| 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.ImageNotValid | The specified image is not authorized. | |
| 403 | InvalidPeriod.StarterPackage | This instance was created by using a Starter Package plan and can only be renewed monthly, not yearly. | 參加了入門級套餐活動的執行個體,只能設定成每月自動續約。 |
| 403 | RenewDateNotSupported.StarterPackage | This instance was created by using a Starter Package plan and can only be renewed three days before it expires. | |
| 403 | PrePaidInstance.Expired | The prePaid instance has expired. | 訂用帳戶執行個體已到期。 |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist. | 指定的磁碟不存在。請您檢查磁碟 ID 是否正確。 |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的執行個體ID無效。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。