All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceAutoRenewAttribute

Last Updated:Apr 04, 2026

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeInstanceAutoRenewAttribute

list

Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

Instance

acs:ecs:{#regionId}:{#accountId}: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 InstanceId or RenewalStatus.

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: Auto-renewal is enabled.

  • Normal: Auto-renewal is disabled.

  • NotRenewal: The instance will not be renewed. The system does not send expiration reminders but sends a non-renewal reminder three days before the expiration date. To renew an ECS instance with this status, you must first call ModifyInstanceAutoRenewAttribute to change its status to Normal. You can then manually renew the instance or enable auto-renewal.

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 InstanceRenewAttribute objects.

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:

  • AutoRenewal: The instance is configured for automatic renewal.

  • Normal: Automatic renewal is disabled. You can manually renew the instance or enable auto-renewal.

  • NotRenewal: The instance will not be renewed. The system does not send expiration notifications, but sends a non-renewal notification three days before the expiration date. To enable renewal for an ECS instance with this status, you must first call ModifyInstanceAutoRenewAttribute to change its status to Normal. You can then manually renew the instance or enable auto-renewal.

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.