Modifies the auto-renewal attributes of one or more subscription instances, helping you reduce the maintenance cost of resource expiration.
Operation description
Before using this API, make sure you fully understand the billing methods and pricing of Elastic Compute Service (ECS).
-
Make sure your account balance or credit limit is sufficient.
-
Only subscription instances are supported. An error is returned if you call this API for pay-as-you-go instances.
-
The auto-renewal deduction date is 9 days before the instance expires. The deduction starts at 08:00:00 (UTC+8).
-
If the auto-deduction fails on the previous day, it will be retried at the scheduled time on the next day until the deduction succeeds or the instance is locked after expiration 9 days later.
-
If the purchase duration of a newly created instance is one week, the auto-renewal deduction is made on the first day after the instance is created.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyInstanceAutoRenewAttribute |
update |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
Instance ID. You can specify up to 100 subscription instances at a time. Separate multiple instance IDs with commas (,). |
i-bp67acfmxazb4ph****,i-bp67acfmxazb4pi**** |
| RegionId |
string |
Yes |
The region ID of the instance. You can call DescribeRegions to view the latest list of Alibaba Cloud regions. |
cn-hangzhou |
| Duration |
integer |
No |
The auto-renewal duration of the instance.
|
1 |
| AutoRenew |
boolean |
No |
Specifies whether to automatically renew the instance before it expires.
Default value: false. |
true |
| RenewalStatus |
string |
No |
The auto-renewal status of the instance. Valid values:
Note
The |
AutoRenewal |
| PeriodUnit |
string |
No |
The unit of the renewal duration, that is, the unit of the
|
Month |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | OperationDenied.StarterPackage | Instance created with a Starter Package plan can not set auto renew. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | MissingParameter.InstanceId | InstanceId should not be null. | The InstanceId parameter is required. |
| 403 | InvalidParameter.ToManyInstanceIds | InstanceId should be less than 100. | |
| 403 | InvalidParameter.InvalidInstanceId | %s | The specified InstanceId parameter is invalid. |
| 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.Duration | %s | The specified Duration parameter is invalid. |
| 403 | InvalidParameter.RenewalStatus | %s | The specified RenewalStatus parameter is invalid. |
| 403 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | |
| 403 | InvalidPeriod.StarterPackage | This instance was created by using a Starter Package plan and can only be renewed monthly, not yearly. | The instance was created in a Starter Package plan and can only be automatically renewed on a monthly basis. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.