You can call this operation to query the auto-renewal status of one or more subscription ECS instances.

Description

  • Before you configure auto-renewal or manual renewal for subscription instances, you can query the auto-renewal status of the instances.
  • This operation is applicable only to subscription instances. An error is returned if you call this operation on pay-as-you-go instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DescribeInstanceAutoRenewAttribute

The operation that you want to perform. For API requests using the HTTP and HTTPS methods, the Action parameter is required. Set the value to DescribeInstanceAutoRenewAttribute.

RegionId String Yes cn-hangzhou

The region ID of the instances to be queried. You can call the DescribeRegions operation to query the most recent region list.

InstanceId String No i-bp18x3z4hc7bixhxh***,i-bp1g6zv0ce8oghu7k***

The IDs of the instances. You can specify a maximum of 100 subscription instance IDs at a time. Separate multiple instance IDs with commas (,).

Note You must specify InstanceId, RenewalStatus, or both.
RenewalStatus String No AutoRenewal

The auto-renewal status of the instances. Valid values:

  • AutoRenewal: indicates that auto-renewal is enabled.
  • Normal: indicates that auto-renewal is disabled.
  • NotRenewal: The instance will not be renewed. The system sends no more expiration reminders, but sends only a non-renewal reminder three days before the expiration date. For an instance that will not be renewed, you can call the ModifyInstanceAutoRenewAttribute operation to change its auto-renewal status to Normal. Then you can manually renew the instance or enable auto-renewal for the instance.
PageSize String No 10

The number of entries to return on each page.

Valid values: 1 to 100

Default value: 10

PageNumber String No 1

The number of the page to return.

Pages start from page 1.

Default value: 1

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

TotalCount Integer 6

The total number of instances.

InstanceRenewAttributes Array

The returned instance renewal attribute information. It is an array that consists of InstanceRenewAttribute data.

InstanceId String i-bp18x3z4hc7bixhxh***

The instance ID.

AutoRenewEnabled Boolean false

Indicates whether auto-renewal was enabled.

Duration Integer 1

The auto-renewal period.

PeriodUnit String week

The unit of the auto-renewal period.

RenewalStatus String Normal

The auto-renewal status of the instance. Valid values:

  • AutoRenewal: indicates that auto-renewal was enabled.
  • Normal: indicates that auto-renewal was disabled.
  • NotRenewal: The instance would not be renewed. The system sends no more expiration reminders, but sends only a non-renewal reminder three days before the expiration date. For an instance that would not be renewed, you can call the ModifyInstanceAutoRenewAttribute operation to change its auto-renewal status to Normal. Then you can manually renew the instance or enable auto-renewal for the instance.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeInstanceAutoRenewAttribute
&RegionId=cn-hangzhou
&PageNumber=1
&PageSize=1
&RenewalStatus=AutoRenewal
&<Common request parameters>

Sample success responses

XML format

<DescribeInstanceAutoRenewAttributeResponse>
      <PageNumber>1</PageNumber>
      <TotalCount>1</TotalCount>
      <InstanceRenewAttributes>
            <InstanceRenewAttribute>
                  <RenewalStatus>AutoRenewal</RenewalStatus>
                  <Duration>1</Duration>
                  <InstanceId>i-bp18x3z4hc7bixhxh***</InstanceId>
                  <AutoRenewEnabled>true</AutoRenewEnabled>
                  <PeriodUnit>Week</PeriodUnit>
            </InstanceRenewAttribute>
      </InstanceRenewAttributes>
      <PageSize>1</PageSize>
      <RequestId>DAE023B4-A78F-4B39-8860-96F17B54F772</RequestId>
</DescribeInstanceAutoRenewAttributeResponse>

JSON format

{
    "PageNumber": 1,
    "TotalCount": 1,
    "InstanceRenewAttributes": {
        "InstanceRenewAttribute": [
            {
                "RenewalStatus": "AutoRenewal",
                "Duration": 1,
                "InstanceId": "i-bp18x3z4hc7bixhxh***",
                "AutoRenewEnabled": true,
                "PeriodUnit": "Week"
            }
        ]
    },
    "PageSize": 1,
    "RequestId": "DAE023B4-A78F-4B39-8860-96F17B54F772"
}

Error codes

HTTP status code Error code Error message Description
403 MissingParameter.InstanceId InstanceId should not be null. The error message returned because InstanceId is not specified.
403 InvalidParameter.ToManyInstanceIds InstanceId should be less than 100. The error message returned because more than 100 instance IDs are specified.
403 InvalidParameter.InvalidInstanceId %s The error message returned because the specified InstanceId parameter is invalid.
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 resource is in the current state.
403 ChargeTypeViolation Pay-As-You-Go instances do not support this operation. The error message returned because this operation is applicable only to subscription instances.
403 InvalidParameter.RenewalStatus The specified parameter RenewalStatus is not valid. The error message returned because the specified RenewalStatus parameter is invalid.
403 InvalidParameter.RenewalStatusInstanceId The parameter RenewalStatus and InstanceId can not be both empty. The error message returned because neither of the RenewalStatus and InstanceId parameters is specified.

For a list of error codes, visit the API Error Center.