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

Description

When you renew the subscription dedicated hosts, deductible vouchers are used first by default. You must also make sure that your account supports the credit payment method.

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
Action String Yes RenewDedicatedHosts

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

DedicatedHostIds String Yes dh-xxxxxxxxxxxxxxxxx

The list of dedicated host IDs. A maximum of 100 IDs of subscription dedicated hosts can be specified in the list. Specify the dedicated host IDs in a JSON array. Example: ["dh-xxxxxxxxx", "dh-yyyyyyyyy", … "dh-zzzzzzzzz"]. Separate the IDs with commas (,).

Period Integer Yes 1

The renewal period of the subscription dedicated host. For 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 most recent region list.

PeriodUnit String No Month

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

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

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

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 parameter used in this request is different from the one in the previous request even though the ClientToken value 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 parameter 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 this 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 parameter is invalid.
403 LastTokenProcessing The last token request is processing. The error message returned because the last token request is being processed. Try again later.
400 InvalidPeriodUnit.ValueNotSupported The specified parameter PeriodUnit is not valid. The error message returned because the specified PeriodUnit parameter 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 specified dedicated host is being upgraded. 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 a list of error codes, visit the API Error Center.