You can call this operation to enable or disable auto-renewal for one or more subscription dedicated hosts.

Description

Subscription dedicated hosts are automatically renewed nine days before expiration. The automatic payment is deducted at 08:00:00 (UTC+8). If the automatic payment fails, the payment is deducted at the same time the next day. Automatic payment stops after the payment succeeds or after the dedicated host is expired and locked. Make sure that your account has sufficient balance or credit for the payment.

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
DedicatedHostIds String Yes ddh-xxxxxxxxxxxxxxxxx

The ID of the dedicated host. You can enter up to 100 subscription dedicated host IDs in the list. Separate multiple IDs with commas (,).

RegionId String Yes cn-hangzhou

The region ID of the dedicated host.

Action String Yes ModifyDedicatedHostAutoRenewAttribute

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

AutoRenew Boolean No false

Specifies whether to automatically renew the subscription dedicated host. Default value: false. Valid values:

  • true: The subscription dedicated host is automatically renewed.
  • false: The subscription dedicated host is not automatically renewed.
Duration Integer No 1

The billing cycle of the subscription dedicated host. For more information about the valid values, see the description of the PeriodUnit parameter.

PeriodUnit String No Month

The unit of the renewal period. Default value: Month. Valid values:

  • Week: When the PeriodUnit parameter is set to Week, the valid values of the Duration parameter are 1, 2, and 3.
  • Month: When the PeriodUnit parameter is set to Month, the valid values of the Duration parameter are 1, 2, 3, 6, and 12.
RenewalStatus String No Normal

Specifies whether to enable auto-renewal for the subscription dedicated host. The RenewalStatus parameter takes precedence over the AutoRenew parameter. Valid values:

  • AutoRenewal: Auto-renewal is enabled.
  • Normal: The dedicated host is not renewed, but you still receive notifications for renewal.
  • NotRenewal: Auto-renewal is disabled and no expiration notification is sent. You receive notifications for renewal three days before the expiration time of a subscription dedicated host. You can set the dedicated host that is not renewed to Normal and manually renew it by calling the RenewDedicatedHosts operation. Alternatively, you can renew it by setting this parameter to AutoRenewal.

Response parameters

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

The ID of the request.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=ModifyDedicatedHostAutoRenewAttribute
&DedicatedHostIds=ddh-xxxxxxxxxxxxxxxxx
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<ModifyDedicatedHostAutoRenewAttributeResponse>
    <RequestId>2A4EA075-CB5B-41B7-B0EB-70D339F64DE7</RequestId>
</ModifyDedicatedHostAutoRenewAttributeResponse>

JSON format

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

Error codes

HTTP status code Error code Error message Description
403 MissingParameter.DedicatedHostId DedicatedHostId should not be null. The error message returned because the host ID is not specified.
403 InvalidParameter.ToManyDedicatedHostIds DedicatedHostId should be less than 100. The error message returned because the number of dedicated host IDs specified in DedicatedHostIds exceeds the upper limit. DedicatedHostIds supports up to 100 IDs.
403 InvalidParameter.InvalidDedicatedHostId %s The error message returned because the specified DedicatedHostId is invalid.
403 IncorrectHostStatus The current status of the resource does not support this operation. The error message returned because the operation is not supported while the dedicated host is in the current state.
403 ChargeTypeViolation Pay-As-You-Go dedicated host do not support this operation. The error message returned because the current operation is not supported for pay-as-you-go dedicated hosts.
403 InvalidParameter.Duration %s The error message returned because the specified value of the Duration parameter is invalid.
403 InvalidParameter.RenewalStatus %s The error message returned because the specified value of the RenewalStatus parameter is invalid.
403 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. The error message returned because the specified value of the PeriodUnit parameter is invalid.

For a list of error codes, visit the API Error Center.