All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceAutoRenewAttribute

Last Updated:Nov 14, 2024

Queries the auto-renewal attribute of subscription Elastic Compute Service (ECS) instances, including whether auto-renewal is enabled for the instances and the auto-renewal durations of the instances.

Operation 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 to only subscription instances. An error is returned if you call this operation on pay-as-you-go instances.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeInstanceAutoRenewAttributeget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringNo

The IDs of the instances. You can specify up to 100 subscription instance IDs in a single request. Separate multiple instance IDs with commas (,).

Note InstanceId and RenewalStatus cannot be empty at the same time.
i-bp18x3z4hc7bixhx****,i-bp1g6zv0ce8oghu7****
RegionIdstringYes

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

cn-hangzhou
RenewalStatusstringNo

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

  • AutoRenewal: Auto-renewal is enabled for the instance.
  • Normal: Auto-renewal is disabled for the instance.
  • NotRenewal: The instance is not to 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 is not to 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.
AutoRenewal
PageSizestringNo

The number of entries per page.

Valid values: 1 to 100.

Default value: 10.

10
PageNumberstringNo

The page number.

Pages start from page 1.

Default value: 1.

1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
TotalCountinteger

The total number of queried instances.

6
InstanceRenewAttributesarray<object>

The renewal attributes of instances.

InstanceRenewAttributeobject
PeriodUnitstring

The unit of the auto-renewal duration.

week
Durationinteger

The auto-renewal duration.

1
RenewalStatusstring

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

  • AutoRenewal: Auto-renewal is enabled for the instance.
  • Normal: Auto-renewal is disabled for the instance.
  • NotRenewal: The instance is not to 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 is not to 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.
Normal
InstanceIdstring

The ID of the instance.

i-bp18x3z4hc7bixhx****
AutoRenewEnabledboolean

Indicates whether auto-renewal is enabled.

false

Examples

Sample success responses

JSONformat

{
  "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
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400ThrottlingRequest was denied due to request throttling.-
403MissingParameter.InstanceIdInstanceId should not be null.The InstanceId parameter is required.
403InvalidParameter.ToManyInstanceIdsInstanceId should be less than 100.The number of instances must be smaller than 100.
403InvalidParameter.InvalidInstanceId%sThe specified InstanceId parameter is invalid.
403IncorrectInstanceStatusThe current status of the resource does not support this operation.The resource is in a state that does not support the current operation.
403ChargeTypeViolationPay-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.
403InvalidParameter.RenewalStatusThe specified parameter RenewalStatus is not valid.The specified RenewalStatus parameter is invalid.
403InvalidParameter.RenewalStatusInstanceIdThe parameter RenewalStatus and InstanceId can not be both empty.The RenewalStatus and InstanceId parameters are required.
403InvalidParameter.PageSizeThe specified parameter PageSize is not valid.The PageSize parameter is invalid.
403InvalidParameter.PageNumberThe specified parameter PageNumber is not valid.The specified PageNumber parameter is invalid.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2021-11-04The Error code has changedView Change Details