調用RenewInstance接口,并可以指定InstanceId、Period、ExpectedRenewDay等參數,續費一臺包年包月ECS實例。
接口說明
- 請確保在使用該接口前,您已充分了解云服務器 ECS的計費方式和產品定價。
- 僅支持為包年包月 ECS 實例續費時長或者續費至統一到期日。
- 續費實例的時長和續費實例至統一到期日的操作不能同步執行,即續費時長參數(
Period
、PeriodUnit
)與統一到期日參數(ExpectedRenewDay
)必須指定其中之一,但不能同時設置。 - 您的賬號必須支持賬號余額支付或信用支付。
調試
您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。
授權信息
當前API暫無授權信息透出。
請求參數
名稱 | 類型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ClientToken | string | 否 | 保證請求冪等性。從您的客戶端生成一個參數值,確保不同請求間該參數值唯一。ClientToken 只支持 ASCII 字符,且不能超過 64 個字符。更多詳情,請參見如何保證冪等性。 | 0c593ea1-3bea-11e9-b96b-88e9fe637760 |
InstanceId | string | 是 | 需要續費的實例 ID。 | i-bp67acfmxazb4p**** |
Period | integer | 否 | 包年包月續費時長。一旦指定了
說明
您必須指定續費時長參數( Period 、PeriodUnit )或統一到期日參數(ExpectedRenewDay )的其中一個,但不能同時設置。
| 1 |
PeriodUnit | string | 否 | 續費時長的時間單位,即參數 Period 的單位。取值范圍:
默認值:Month。 | Month |
ExpectedRenewDay | integer | 否 | 統一到期日。該參數值必須與您已設置的統一到期日保持一致,否則將調用失敗。指定該參數后,您的實例將續費至統一到期日。取值范圍:1~28。 關于統一到期日功能的限制說明,請參見統一實例到期日。 說明
您必須指定續費時長參數( Period 、PeriodUnit )或統一到期日參數(ExpectedRenewDay )的其中一個,但不能同時設置。
| 5 |
返回參數
示例
正常返回示例
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. | 不支持指定的InstanceType。 |
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. | 指定的 RebootTime 不合法。 |
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. | - |
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 | InvalidParameter | The specified parameter " InternetMaxBandwidthOut " is not valid. | - |
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 | OperationDenied | The current user does not support this operation. | 您使用的賬號暫不支持此操作。 |
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.Conflict | The specified expectedRenewDay is in conflict with periodUnit. | - |
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. | - |
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 | OperationDenied.NoStock | The resource is out of usage. | 該實例不在運行狀態,請您啟動實例或檢查操作是否合理。 |
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. | - |
404 | InvalidDiskId.NotFound | The specified disk does not exist. | 指定的磁盤不存在。請您檢查磁盤 ID 是否正確。 |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的實例ID未找到。 |
500 | InternalError | The request processing has failed due to some unknown error. | 內部錯誤,請重試。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
變更時間 | 變更內容概要 | 操作 |
---|---|---|
2022-08-24 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |