Enables or disables auto-renewal for one or more subscription dedicated hosts.
Description
- If you enable auto-renewal for your subscription dedicated host, the system attempts to deduct the renewal payment at 08:00:00 (UTC+8) nine days before the dedicated host expires to renew the dedicated host. If this deduction attempt fails, the system attempt to deduct the payment at the same point in time the next day. The system attempts to deduct the payment once every day until the dedicated host expires or until the payment is deducted. Make sure that your account balance is sufficient.
- Subscription dedicated hosts can be automatically renewed along with the subscription Elastic Compute Service (ECS) instances that are hosted on the dedicated hosts. For more information, see the description of the AutoRenewWithEcs parameter.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyDedicatedHostAutoRenewAttribute |
The operation that you want to perform. Set the value to ModifyDedicatedHostAutoRenewAttribute. |
DedicatedHostIds | String | Yes | dh-bp165p6xk2tlw61e**** |
The IDs of dedicated hosts. You can specify up to 100 subscription dedicated host IDs. Separate the IDs with commas (,). |
RegionId | String | Yes | cn-hangzhou |
The region ID of the dedicated host. |
Duration | Integer | No | 1 |
The renewal duration. Valid values:
|
PeriodUnit | String | No | Month |
The unit of the renewal duration. Valid values:
Default value: Month. |
AutoRenew | Boolean | No | false |
Specifies whether to automatically renew the subscription dedicated host. Valid values:
Default value: false. |
RenewalStatus | String | No | Normal |
Specifies whether to automatically renew the subscription dedicated host. The
|
AutoRenewWithEcs | String | No | StopRenewWithEcs |
Specifies whether to automatically renew the subscription dedicated host along with the subscription ECS instances hosted on it. If auto-renewal is enabled for the subscription ECS instances hosted on your subscription dedicated host, you can specify this parameter to automatically renew the dedicated host along with the subscription ECS instances. When the subscription ECS instances hosted on your dedicated host are automatically renewed, the dedicated host is also automatically renewed if the expiration time of the dedicated host is earlier than the expiration time of the renewed instances. When the dedicated host is configured to be automatically renewed along with the subscription
ECS instances hosted on it, the system checks the expiration time of the renewed instances
and selects a minimum renewal duration for the dedicated host so that the dedicated
host is renewed by a duration that expires later than the expiration time of the renewed
instances. For more information about supported renewal durations, see the descriptions
of the For example, assume that you have a subscription dedicated host that expires on January
15 of the current year. Subscription ECS instances hosted on the dedicated host have
the auto-renewal feature enabled, and are automatically renewed to November 15 of
the same year. The expiration time of the dedicated host is earlier than the expiration
time of the ECS instances by 10 months. In this case, the system selects a renewal
duration of 12 months (a minimum duration calculated based on a Valid values:
Note If you set this parameter to AutoRenewWithEcs, make sure that
AutoRenew is set to true to enable auto-renewal for the dedicated host. Otherwise, only the
parameter value is changed. The dedicated host is not automatically renewed along
with the subscription ECS instances hosted on it.
Default value: NoOperation. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 2A4EA075-CB5B-41B7-B0EB-70D339F6**** |
The ID of the request. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=ModifyDedicatedHostAutoRenewAttribute
&DedicatedHostIds=dh-bp165p6xk2tlw61e****
&Duration=1
&PeriodUnit=Month
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDedicatedHostAutoRenewAttributeResponse>
<RequestId>2A4EA075-CB5B-41B7-B0EB-70D339F6****</RequestId>
</ModifyDedicatedHostAutoRenewAttributeResponse>
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 | MissingParameter.DedicatedHostId | DedicatedHostId should not be null. | The error message returned because the DedicatedHostIds parameter is not specified. |
403 | InvalidParameter.ToManyDedicatedHostIds | DedicatedHostId should be less than 100. | The error message returned because more than 100 dedicated host IDs are specified in the DedicatedHostIds parameter. |
403 | InvalidParameter.InvalidDedicatedHostId | %s | The error message returned because the specified DedicatedHostIds parameter 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 resource is in the current state. |
403 | ChargeTypeViolation | Pay-As-You-Go dedicated host do not support this operation. | The error message returned because pay-as-you-go dedicated hosts do not support this operation. |
403 | InvalidParameter.Duration | %s | The error message returned because the specified Duration parameter is invalid. |
403 | InvalidParameter.RenewalStatus | %s | The error message returned because the specified RenewalStatus parameter is invalid. |
403 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | The error message returned because the specified PeriodUnit parameter is invalid. |
For a list of error codes, visit the API Error Center.