You can call this operation to set or cancel auto-renewal for one or more Subscription-based DDHs.

Description

Subscription-based DDHs are automatically renewed nine days before expiration. The payment is automatically made at 08:00:00 Chinese Standard Time (UTC+8). The payment is made the next day at the same time if automatic deduction fails. Automatic deduction stops after the payment is successful or the DDH is locked. Make sure that your account used for payment has sufficient balance.

Request parameters

Name Type Required Description
Action String Yes The operation that you want to perform. Set the value to ModifyDedicatedHostAutoRenewAttribute
RegionId String Yes The ID of the region where the DDH is created.
DedicatedHostIds String Yes The list of DDH IDs. You can enter up to 100 DDH IDs in the list. Separate the IDs with commas (,).
Period String No The subscription duration. For valid values, see the description section in PeriodUnit.
PeriodUnit String No The unit of the subscription duration. Valid values:
  • Week: Week. Valid values of the Period parameter: {1, 2, 3}.
  • Month (default value): Month. Valid values of the Period parameter: { 1, 2, 3, 6, 12}.
AutoRenew Boolean No Indicates whether a subscription-based DDH has enabled automatic renewal. Default value: False.
RenewalStatus String No Indicates whether a Subscription-based DDH has enabled automatic renewal. The RenewalStatus parameter take precedence over the AutoRenew parameter. Valid values:
  • AutoRenewal: Auto renewal is enabled.
  • Normal: To be renewed.
  • NotRenewal: Auto renewal is disabled. No notifications will be sent to notify you of the expiration date. You will receive notifications for renewal three days before the expiration time of a DDH subscription. You can set the DDH that is not renewed to Normal and manually renew it (RenewDedicatedHosts), or set the DDH to auto-renewal (AutoRenewal).
ClientToken String No

Guarantees the idempotence of the request.  The value is generated by a client and must be globally unique. Only ASCII characters are allowed. It can contain a maximum of 64 ASCII characters. For more information, see How to ensure idempotence.

Response parameters

All are common response parameters. See Common response parameters.

Samples

Sample requests
https://ecs.aliyuncs.com/?Action=ModifyDedicatedHostAutoRenewAttribute
&RegionId=cn-hangzhou
&DedicatedHostIds=dh-dedicatedhost1,dh-dedicatedhost2
&AutoRenew=True
&<Common Request Parameters>
Sample responses

XML format

<ModifyDedicatedHostAutoRenewAttributeResponse>
  <RequestId>2A4EA075-CB5B-41B7-B0EB-70D339F64DE7</RequestId>
</ModifyDedicatedHostAutoRenewAttributeResponse>
JSON format
{
    "RequestId":"2A4EA075-CB5B-41B7-B0EB-70D339F64DE7"
}

Error codes

Error code Error message HTTP status code Description
IncorrectHostStatus The current status of the resource does not support this operation. 403 The error message returned when the instance is expired and the operation is not allowed.
InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. 403 The error message returned when the specified unit of the subscription cycle is invalid.
InvalidParameter.ToManyDedicatedHostIds No more than 100 DedicatedHostIds can be specified. 403 The error message returned when the number of DDH IDs is invalid. You can specify up to 100 DDH IDs at a time.
MissingParameter.DedicatedHostId DedicatedHostId should not be null. 403 The error message returned when the value of DedicatedHostIds is empty. You must enter a value.
InvalidParameter.InvalidDedicatedHostId The specified dedicatedHostIds is not valid. 403 The error message returned when the specified DedicatedHostIds parameter contains an invalid DDH ID.
InvalidParameter.Duration The auto renewal duration should be one of the following values: 1|2|3|6|12. 403 The error message returned when the specified renewal duration is invalid. Valid values: [1,2,3,6,12].
InvalidParameter.RenewalStatus The specified parameter RenewalStatus must be AutoRenewal NotRenewal or Normal. 403 The error message returned when the specified RenewalStatus parameter is invalid.
InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist. 404 The error message returned when the specified DedicatedHostIds list contains a DDH ID that does not exist.