调用RenewReservedInstances对已购买的一张或多张预留实例券进行续费。
接口说明
- 请确保在使用该接口前,您已充分了解预留实例券的计费方式。详情请参见预留实例券计费方式。
- 您可以调用DescribeReservedInstances查询已购买的预留实例券。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | RenewReservedInstances | 系统规定参数。取值:RenewReservedInstances。 |
ReservedInstanceId.N | String | 是 | ecsri-2ze53qonjqxg7r**** | 预留实例券ID。您可以调用DescribeReservedInstances查看已购买的预留实例券。 单次续费的预留实例券数量最多不超过10个。 |
RegionId | String | 是 | cn-hangzhou | 实例所属的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
Period | Integer | 否 | 1 | 购买预留实例券的时长。 取值范围:1、3。 默认值:1。 |
PeriodUnit | String | 否 | Year | 购买预留实例券的时长单位。 取值范围:Year。 默认值:Year。 |
ClientToken | String | 否 | 123e4567-e89b-12d3-a456-426655440000 | 保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符,且不能超过64个字符。更多信息,请参见如何保证幂等性。 |
AutoRenew | Boolean | 否 | true | 是否要自动续费。
默认值:false。 |
AutoRenewPeriod | Integer | 否 | 1 | 每次自动续费的时长,单位为月。当参数AutoRenew取值为true时,该参数才生效。 取值范围:12,36。默认值为12。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 8C314443-AF0D-4766-9562-C83B7F1**** | 请求ID。 |
ReservedInstanceIdSets | Array of String | ecsri-2ze53qonjqxg7r**** | 预留实例券ID。 |
OrderId | String | 2023912123**** | 订单ID。 |
示例
请求示例
http(s)://ecs.aliyuncs.com/?Action=RenewReservedInstances
&RegionId=cn-hangzhou
&ReservedInstanceId.1=ecsri-2ze53qonjqxg7r****
&ReservedInstanceId.2=ecsri-2ze53qonjqxg7s****
&Period=1
&PeriodUnit=Year
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<RenewReservedInstancesResponse>
<ReservedInstanceIdSets>
<ReservedInstanceId>ecsri-2ze53qonjqxg7r****</ReservedInstanceId>
<ReservedInstanceId>ecsri-2ze53qonjqxg7s****</ReservedInstanceId>
</ReservedInstanceIdSets>
<OrderId>2023912123****</OrderId>
<RequestId>8C314443-AF0D-4766-9562-C83B7F1****</RequestId>
</RenewReservedInstancesResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"ReservedInstanceIdSets" : {
"ReservedInstanceId" : [ "ecsri-2ze53qonjqxg7r****", "ecsri-2ze53qonjqxg7s****" ]
},
"OrderId" : "2023912123****",
"RequestId" : "8C314443-AF0D-4766-9562-C83B7F1****"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
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 | RegionUnauthorized | %s | 该地域未被授权。%s为变量,将根据调用API的实际情况动态返回错误信息。 |
400 | Zone.NotOnSale | %s | 该可用区暂时关闭了售卖。%s为变量,将根据调用API的实际情况动态返回错误信息。 |
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. | 该计费方式不支持,请您重新选择计费方式。 |
403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. | 请求的资源在指定的可用区已售完,请您更换实例规格或者可用区重试,调用 DescribeZones 接口可以获得库存结果。 |
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 | OperationDenied | The resource is out of usage. | 该实例不在运行状态,请您启动实例或检查操作是否合理。 |
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 | InvalidParameter.NotMatch | %s | 您输入的参数无效,请检查参数之间是否冲突。 |
403 | Account.Arrearage | Your account has been in arrears. | 账户余额不足,请先充值再操作。 |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 该资源目前的状态不支持此操作。 |
403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | 付费方式不支持该操作,请您检查实例的付费类型是否与该操作冲突。 |
500 | InternalError | The request processing has failed due to some unknown error. | 内部错误,请重试。 |
500 | InternalError | %s | 内部错误。 |
访问错误中心查看更多错误码。