Enables or disables auto-renewal for one or more reserved 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 Yes ModifyReservedInstanceAutoRenewAttribute

The operation that you want to perform. Set the value to ModifyReservedInstanceAutoRenewAttribute.

RegionId String Yes cn-hangzhou

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

Period Integer No 1

The auto-renewal term of the reserved instance. Valid values:

Valid values: 1 and 3.

PeriodUnit String No Month

The unit of the auto-renewal term.

Valid value: Year.

RenewalStatus String No AutoRenewal

Specifies whether to automatically renew the reserved instance. Valid values:

  • AutoRenewal: automatically renews the reserved instance.
  • Normal: You must manually renew the reserved instance.
ReservedInstanceId.N String No ecsri-ajdfaj****

The ID of reserved instance N. You can call the DescribeReservedInstances operation to query the IDs of reserved instances that you purchased.

Only the IDs of reserved instances that are in the Active state can be specified.

You can specify the IDs of up to 100 reserved instances in a single request.

Response parameters

Parameter Type Example Description
RequestId String 2A4EA075-CB5B-41B7-B0EB-70D339F6****

The ID of the request.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=ModifyReservedInstanceAutoRenewAttribute
&RegionId=cn-hangzhou
&Period=1
&PeriodUnit=Month
&RenewalStatus=AutoRenewal
&ReservedInstanceId.1=ecsri-ajdfaj****
&ReservedInstanceId.2=ecsri-abjkql****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyReservedInstanceAutoRenewAttributeResponse>
    <RequestId>2A4EA075-CB5B-41B7-B0EB-70D339F6****</RequestId>
</ModifyReservedInstanceAutoRenewAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "2A4EA075-CB5B-41B7-B0EB-70D339F6****"
}

Error codes

HTTP status code Error code Error message Description
403 InvalidParameter.Duration %s The error message returned because the specified Period parameter is invalid.
403 InvalidParameter.RenewalStatus %s The error message returned because the specified RenewalStatus parameter is invalid.
403 InvalidParameter %s The error message returned because a specified parameter is invalid.

For a list of error codes, see Service error codes.