All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceAutoRenewAttribute

Last Updated:Mar 19, 2024

Queries the auto-renewal status of subscription Elastic Compute Service (ECS) 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

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
InstanceRenewAttributesobject []

The renewal attributes of instances.

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 changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 403
    Added Error Codes: 400