This API returns the auto-renewal status and renewal period for one or more subscription ECS instances.
Operation description
This API supports only subscription instances. Calling this API for a pay-as-you-go instance returns an error.
Before you configure auto-renewal or manual renewal for an instance, query its renewal status to check if auto-renewal is already enabled.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeInstanceAutoRenewAttribute |
list |
Instance
Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
No |
The instance IDs. You can specify up to 100 subscription instances at a time. Separate multiple instance IDs with commas. Note
You must specify either |
i-bp18x3z4hc7bixhx****,i-bp1g6zv0ce8oghu7**** |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to view the latest list of Alibaba Cloud regions. |
cn-hangzhou |
| RenewalStatus |
string |
No |
The auto-renewal status of the instance. Valid values:
|
AutoRenewal |
| PageSize |
string |
No |
The number of entries per page. Maximum value: 100. Default value: 10. |
10 |
| PageNumber |
string |
No |
The number of the page to return. Minimum value: 1. Default value: 1. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| TotalCount |
integer |
The total number of instances that are returned. |
6 |
| InstanceRenewAttributes |
object |
The auto-renewal attributes of the instances. |
|
| InstanceRenewAttribute |
array<object> |
An array of |
|
|
object |
|||
| PeriodUnit |
string |
The unit of the auto-renewal duration. |
week |
| Duration |
integer |
The auto-renewal duration. |
1 |
| RenewalStatus |
string |
The auto-renewal status of the instance. Valid values:
|
Normal |
| InstanceId |
string |
The instance ID. |
i-bp18x3z4hc7bixhx**** |
| AutoRenewEnabled |
boolean |
Indicates whether auto-renewal is enabled. |
false |
| EnableExpectedRenewDay |
boolean |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 6,
"InstanceRenewAttributes": {
"InstanceRenewAttribute": [
{
"PeriodUnit": "week",
"Duration": 1,
"RenewalStatus": "Normal",
"InstanceId": "i-bp18x3z4hc7bixhx****",
"AutoRenewEnabled": false,
"EnableExpectedRenewDay": false
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Throttling | Request was denied due to request throttling. | |
| 403 | MissingParameter.InstanceId | InstanceId should not be null. | The InstanceId parameter is required. |
| 403 | InvalidParameter.ToManyInstanceIds | InstanceId should be less than 100. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | ChargeTypeViolation | Pay-As-You-Go instances do not support this operation. | The operation is not supported by pay-as-you-go instances. Check the billing method of the instance. |
| 403 | InvalidParameter.RenewalStatus | The specified parameter RenewalStatus is not valid. | The specified RenewalStatus parameter is invalid. |
| 403 | InvalidParameter.RenewalStatusInstanceId | The parameter RenewalStatus and InstanceId can not be both empty. | The RenewalStatus and InstanceId parameters are required. |
| 403 | InvalidParameter.PageSize | The specified parameter PageSize is not valid. | The PageSize parameter is invalid. |
| 403 | InvalidParameter.PageNumber | The specified parameter PageNumber is not valid. | The specified PageNumber parameter is invalid. |
| 403 | InvalidParameter.InvalidInstanceId | The specified InstanceId does not exist. | The specified InstanceId does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.