本介面用於續費一台包年包月的 ECS 執行個體,支援您設定續費時長或者續費至統一到期日。
介面說明
請確保在使用該介面前,您已充分了解雲端伺服器 ECS 的計費方式和價格。
請確保您的帳號餘額或信用額度充足。
僅支援包年包月的執行個體,按量付費的執行個體呼叫該介面會報錯。
續費時長參數(
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. | 該執行個體不支援指定的 InternetChargeType。 |
| 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. | 指定的快照不允許建立資料磁碟。 |
| 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. | 指定的專用宿主機不存在。 |
| 400 | InvalidDedicatedHostStatus.NotSupport | Operation denied due to dedicated host status. | 專用宿主機目前的狀態不支援此操作。 |
| 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 marketplace image is not authorized. Please verify the marketplace image authorization and try again. | |
| 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 是否正確。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。