All Products
Search
Document Center

Elastic Compute Service:ModifyInstanceAutoRenewAttribute

Last Updated:Mar 19, 2024

Configures auto-renewal for one or more subscription instances. To reduce maintenance workloads after subscription instances expire, you can configure auto-renewal for the instances.

Operation description

Before you call this operation, make sure that you are familiar with the billing methods and pricing of Elastic Compute Service (ECS). For more information, see the Elastic Compute Service product page.

  • The payment for auto-renewal of an instance is automatically deducted at 08:00:00 (UTC+8) nine days before the instance expires.
  • If the deduction fails, Alibaba Cloud attempts to deduct the payment every day until the payment is deducted or until the instance is locked after the nine-day period ends. Make sure that your account balance or credit balance is sufficient.

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
InstanceIdstringYes

The ID of the instance. You can specify up to 100 subscription instance IDs. Separate the instance IDs with commas (,).

i-bp67acfmxazb4ph****,i-bp67acfmxazb4pi****
RegionIdstringYes

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

cn-hangzhou
DurationintegerNo

The auto-renewal period of the instance.

  • Valid values of Duration when PeriodUnit is set to Year: 1, 2, 3, 4, and 5.
  • Valid values of Duration when PeriodUnit is set to Month: 1, 2, 3, 6, 12, 24, 36, 48, and 60.
1
AutoRenewbooleanNo

Specifies whether to enable auto-renewal for the instance.

Default value: false.

true
RenewalStatusstringNo

The auto-renewal status 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 renewed. The system no longer sends an expiration notification but sends only a renewal notification three days before the instance expires. You can change the value of this parameter from NotRenewal to Normal for an instance, and then manually renew the instance. Alternatively, you can set the RenewalStatus parameter to AutoRenewal.
Note RenewalStatus takes precedence over AutoRenew. If you do not specify RenewalStatus, AutoRenew is used by default.
AutoRenewal
PeriodUnitstringNo

The unit of the renewal period (Duration). Valid values:

  • Month (default)
  • Year
Month

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
400OperationDenied.StarterPackageInstance created with a Starter Package plan can not set auto renew.-
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.Duration%sThe specified Duration parameter is invalid.
403InvalidParameter.RenewalStatus%sThe specified RenewalStatus parameter is invalid.
403InvalidPeriodUnit.ValueNotSupportedThe specified parameter PeriodUnit is not valid.The specified PeriodUnit parameter is invalid.
403InvalidPeriod.StarterPackageThis 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.
500InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.

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

Change history

Change timeSummary of changesOperation
No change history