全部產品
Search
文件中心

Elastic Compute Service:RenewReservedInstances - 續約預留執行個體券

更新時間:Apr 04, 2026

本介面用於對一張或多張預留執行個體券進行續約,支援您在續約時設定購買時間長度和自動續約屬性。

介面說明

請確保在使用該介面前,已充分瞭解預留執行個體券的收費方式和價格

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ecs:RenewReservedInstances

create

*ReservedInstance

acs:ecs:{#regionId}:{#accountId}:reservedinstance/{#ReservedInstanceId}

請求參數

名稱

類型

必填

描述

樣本值

ReservedInstanceId

array

預留執行個體券 ID。

string

預留執行個體券 ID。您可以調用 DescribeReservedInstances 查看已購買的預留執行個體券。

單次續約的預留執行個體券數量最多不超過 10 個。

ecsri-2ze53qonjqxg7r****

RegionId

string

預留執行個體券所屬的地區 ID。

您可以調用 DescribeRegions 擷取最新的阿里雲地區列表。

cn-hangzhou

Period

integer

購買預留執行個體券的時間長度。

取值範圍:1、3。

預設值:1。

1

PeriodUnit

string

購買預留執行個體券的時間長度單位。

取值範圍:Year。

預設值:Year。

Year

ClientToken

string

保證請求等冪性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多資訊,請參見如何保證等冪性

123e4567-e89b-12d3-a456-426655440000

AutoRenew

boolean

是否要自動續約。

  • true:自動續約。

  • false:不自動續約。

預設值:false。

true

AutoRenewPeriod

integer

每次自動續約的時間長度,單位為月。當參數 AutoRenew 取值為 true 時,該參數才生效。

取值範圍:12,36。預設值為 12。

1

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

8C314443-AF0D-4766-9562-C83B7F1****

ReservedInstanceIdSets

object

ReservedInstanceId

array

預留執行個體券 ID 列表。

string

預留執行個體券 ID。

ecsri-2ze53qonjqxg7r****

OrderId

string

訂單 ID。

2023912123****

樣本

正常返回樣本

JSON格式

{
  "RequestId": "8C314443-AF0D-4766-9562-C83B7F1****",
  "ReservedInstanceIdSets": {
    "ReservedInstanceId": [
      "ecsri-2ze53qonjqxg7r****"
    ]
  },
  "OrderId": "2023912123****"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized.
400 InvalidParameter.Conflict The specified region and cluster do not match. 指定的地區與指定的叢集不匹配。
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. 指定的標籤鍵參數有誤。
400 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. 參數 PeriodUnit 無效。
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. 指定的標籤值參數有誤。
400 InvalidChargeType.ValueNotSupported ChargeType is not valid.
400 OperationDenied The specified InstanceType or Zone is not authorized for current user.
400 InvalidPeriod The specified Period or PeriodUnit is not correct.
400 MissingParameter.ReservedInstanceIds The specified ReservedInstanceIds does not exist.
400 InvalidParameter.PeriodUnit The specified PeriodUnit is invalid. 指定的PeriodUnit無效
400 InvalidParameter.Period The specified Period is invalid.
400 InvalidParameter.ReservedInstanceIds The specified ReservedInstanceIds is invalid.
400 InvalidPeriod.ExceededMaximumExpiration The specified renewal period cannot exceed the maximum expiration date. We recommend you try shortening the renewal period at next attempt.
500 InternalError The request processing has failed due to some unknown error.
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 Sales of this resource are temporarily suspended in the specified region; please try again later. 指定的地區暫時關閉了此資源的售賣,請稍後重試。
403 NodeControllerUnavailable The Node Controller is temporarily unavailable.
403 InvalidParameter.ResourceOwnerAccount ResourceOwnerAccount is Invalid. 指定的 ResourceOwnerAccount 不合法。
403 Zone.NotOpen The specified zone is not granted to you to buy resources yet.
403 Zone.NotOnSale The specified zone is not available for purchase. 指定可用性區域已經售罄,請您更換執行個體規格或者更換地區建立。
403 Account.Arrearage Your account has been in arrears.
403 InvalidReservedInstanceName.Malformed The specified parameter ReservedInstanceName is invalid.
403 InvalidParameter.Scope The specified parameter 'Scope' is invalid.
403 InvalidReservedInstanceStatus.ValueNotSupported ReservedInstance status is not supported.
403 InvalidReservedInstanceOfferingType.ValueNotSupported The OfferingType is not supported.
403 InvalidReservedInstanceOfferingClass.ValueNotSupported The OfferingClass is not supported.
403 MissingParameter.ZoneId The specified zoneId should be not empty.
403 MissingParameter.InstanceType The instanceType should be not empty.
403 MissingParameter.ReservedInstanceId The ids of reservedInstance can not be empty.
403 MissingParameter.ReservedInstanceConfiguration The configurations of reservedInstance can not be empty.
403 InvalidParameter.SplitOrMerge The Many-to-many of modification is not supported.
403 MissingParameter.InstanceTypeAndAmountBothEmpty The instanceType and amount can not be both empty.
403 InvalidReservedInstancePlatform.ValueNotSupported The Platform is not supported.
403 InvalidParameter.ReservedInstanceName The reservedInstanceName is invalid. reservedInstanceName欄位值不合法
403 InvalidReservedInstanceZone.ValueNotSupported The zoneId is not exist.
403 InvalidParameter.ValueNotSupported The instanceTypeFamily of the instance to be changed must be consistent.
403 IncorrectInstanceStatus The status of specified reservedInstance must be active. 預留執行個體券狀態不正確導致續約失敗
403 InvalidPlatform.ValueNotSupported The platform of reservedInstance is invalid.
403 InvalidScope.ValueNotSupported The scope of reservedInstance is invalid, The valid value is Zone or Region.
403 InvalidConfiguration.ValueNotSupported The modification Configuration should not be empty.
403 InvalidZoneId.ValueNotSupported The specified zoneId should be same.
403 InvalidParameter The parameter is invalid.Please check it.
403 InvalidInstanceAmount.ValueNotSupported The instanceAmount is invalid.
403 OperationDenied.OnlyModifyName It is not allowed to modify the ReservedInstanceName only. 不允許只修改預留執行個體券的名稱。
403 InvalidReservedInstanceId.NotFound The specified parameter ReservedInstanceId is invalid.
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance.
404 InvalidZoneId.NotFound The ZoneId provided does not exist in our records.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情