Renews one or more reserved instances that you purchased.
Usage notes
- Before you call this operation, make sure that you are familiar with the billing method of reserved instances. For more information, see Reserved instances.
- You can call the DescribeReservedInstances operation to query the reserved instances that you purchased.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | RenewReservedInstances | The operation that you want to perform. Set the value to RenewReservedInstances. |
ReservedInstanceId.N | String | Yes | ecsri-2ze53qonjqxg7r**** | The ID of reserved instance N. You can call the DescribeReservedInstances operation to query the IDs of reserved instances that you purchased. You can specify the IDs of up to 10 reserved instances in a single request. |
RegionId | String | Yes | cn-hangzhou | The region ID of the reserved instance. You can call the DescribeRegions operation to query the most recent region list. |
Period | Integer | No | 1 | The term of the reserved instance. Valid values: 1 and 3. Default value: 1. |
PeriodUnit | String | No | Year | The unit of the term of the reserved instance. Valid value: Year. Default value: Year. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-426655440000 | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
AutoRenew | Boolean | No | true | Specifies whether to enable auto-renewal for the reserved instance.
Default value: false. |
AutoRenewPeriod | Integer | No | 1 | The auto-renewal term of the reserved instance. Unit: months. This parameter takes effect only when AutoRenew is set to true. Valid values: 12 and 36. Default value: 12. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 8C314443-AF0D-4766-9562-C83B7F1**** | The ID of the request. |
ReservedInstanceIdSets | Array of String | ecsri-2ze53qonjqxg7r**** | The IDs of the reserved instances. |
OrderId | String | 2023912123**** | The ID of the order. |
Examples
Sample requests
http(s)://ecs.aliyuncs.com/?Action=RenewReservedInstances
&RegionId=cn-hangzhou
&ReservedInstanceId.1=ecsri-2ze53qonjqxg7r****
&ReservedInstanceId.2=ecsri-2ze53qonjqxg7s****
&Period=1
&PeriodUnit=Year
&<Common request parameters>
Sample success responses
XML
format
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
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"ReservedInstanceIdSets" : {
"ReservedInstanceId" : [ "ecsri-2ze53qonjqxg7r****", "ecsri-2ze53qonjqxg7s****" ]
},
"OrderId" : "2023912123****",
"RequestId" : "8C314443-AF0D-4766-9562-C83B7F1****"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | The error message returned because you are not authorized to use the specified instance type. |
400 | InvalidParameter.Conflict | The specified region and cluster do not match. | The error message returned because the specified region and the specified cluster do not correspond to each other. |
400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | The error message returned because the specified tag key-related parameter is invalid. |
400 | RegionUnauthorized | %s | The error message returned because you are not authorized to perform this operation in the specified region. %s is a variable. An error message is dynamically returned based on call conditions. |
400 | Zone.NotOnSale | %s | The error message returned because the requested resources are unavailable in the specified zone. %s is a variable. An error message is dynamically returned based on call conditions. |
400 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | The error message returned because the specified PeriodUnit parameter is invalid. |
400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The error message returned because the specified tag value-related parameter is invalid. |
400 | InvalidChargeType.ValueNotSupported | ChargeType is not valid. | The error message returned because the specified billing method is not supported. Specify a supported billing method. |
403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. | The error message returned because the requested resources are unavailable in the specified zone. Try a different instance type or zone. You can call the DescribeZones operation to query available resources. |
403 | OperationDenied | Sales of this resource are temporarily suspended in the specified region; please try again later. | The error message returned because the requested resources are unavailable in the specified region. Try again later. |
403 | NodeControllerUnavailable | The Node Controller is temporarily unavailable. | The error message returned because the node controller is unavailable. |
403 | OperationDenied | The resource is out of usage. | The error message returned because the instance is not in the Running state. Start the instance or check whether the specified operation is valid. |
403 | InvalidParameter.ResourceOwnerAccount | ResourceOwnerAccount is Invalid. | The error message returned because the specified ResourceOwnerAccount parameter is invalid. |
403 | Zone.NotOpen | The specified zone is not granted to you to buy resources yet. | The error message returned because you are not authorized to purchase resources in the specified zone. |
403 | Zone.NotOnSale | The specified zone is not available for purchase. | The error message returned because the requested resources are unavailable in the specified zone. Try another instance type or select a different region or zone. |
403 | InvalidParameter.NotMatch | %s | The error message returned because the specified parameter is invalid. Check whether parameter conflicts exist. |
403 | Account.Arrearage | Your account has been in arrears. | The error message returned because your account balance is insufficient. Add funds to your Alibaba Cloud account and try again. |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | The error message returned because the operation is not supported while the instance is in the current state. |
403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | The error message returned because the billing method of the instance does not support this operation. |
500 | InternalError | The request processing has failed due to some unknown error. | The error message returned because an internal error has occurred. Try again later. |
500 | InternalError | %s | The error message returned because an internal error has occurred. |
For a list of error codes, see Service error codes.