You can call this operation to renew one or more subscription dedicated hosts.

Description

When you renew the subscription, deductible vouchers are used first by default. Your account must support credit payments.

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 dh-xxxxxxxxxxxxxxxxx

The list of dedicated host IDs. You can enter up to 100 IDs of subscription dedicated hosts in the list. Specify the dedicated host IDs in a JSON array, for example, "dh-xxxxxxxxx", "dh-yyyyyyyy", ... "dh-zzzzzzzzz". Separate the IDs with commas (,).

Period Integer Yes 1

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

RegionId String Yes cn-hangzhou

The region ID of the dedicated host. You can call the DescribeRegions operation to query the latest region list.

Action String No RenewDedicatedHosts

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

ClientToken String No xxxxxxxxxxxxxxxxxxxxxxxx

The client token that is used to ensure the idempotence of the request. You can use different methods to generate this value. However, you must ensure that the value is unique among different requests. It can contain a maximum of 64 ASCII characters. For more information, see How to ensure idempotence.

PeriodUnit String No Month

The unit of the billing cycle. Valid values:

  • Week: When the PeriodUnit parameter is set to Week, the valid values of the Period parameter are 1, 2, 3, and 4.
  • Month: This is the default value. When the PeriodUnit parameter is set to Month, the valid values of the Period parameter are 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60.

Response parameters

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

The ID of the request.

Examples

Sample requests


http(s)://ecs.aliyuncs.com/? Action=RenewDedicatedHosts
&DedicatedHostIds=dh-xxxxxxxxxxxxxxxxx
&Period=1
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

HTTP status code Error code Error message Description
400 IdempotenceParamNotMatch Request uses a client token in a previous request but is not identical to that request. The error message returned because the parameters used in this request are different from the ones in the previous request even though the ClientToken in this request is identical to the one in the previous request.
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. The error message returned because the specified ClientToken is invalid.
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 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.
400 InvalidPeriod The specified period is not valid. The error message returned because the specified Period is invalid.
403 LastTokenProcessing The last token request is processing. The error message returned because the last request is still being processed. Please try again later.
400 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. The error message returned because the specified PeriodUnit is invalid.
400 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist. The error message returned because the specified dedicated host ID does not exist.
400 InvalidStatus.Upgrading The dedicated host is upgrading, please try it later. The error message returned because the dedicated host is being renewed. Try again later.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Try again later. If the problem persists, submit a ticket.
400 LastOrderProcessing The previous order is still processing, please try again later. The error message returned because an order is being processed. Try again later.

For more information about error codes, see API Error Center.