Queries the auto-renewal states of one or more subscription dedicated hosts.

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 DescribeDedicatedHostAutoRenew

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

DedicatedHostIds String Yes dh-bp165p6xk2tlw61e****,dh-bp1f9vxmno****

The IDs of the dedicated hosts. You can specify up to 100 subscription dedicated host IDs. Separate multiple IDs with commas (,).

RegionId String Yes cn-hangzhou

The region ID of the dedicated host.

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

DedicatedHostRenewAttributes Array of DedicatedHostRenewAttribute

Details about the auto-renewal attributes of the dedicated hosts.

DedicatedHostRenewAttribute
PeriodUnit String Month

The unit of the auto-renewal period. Valid values:

  • Week
  • Month
Duration Integer 0

The auto-renewal period.

DedicatedHostId String dh-bp165p6xk2tlw61e****

The ID of the dedicated host.

RenewalStatus String Normal

Indicates whether the subscription dedicated host is automatically renewed. Valid values:

  • AutoRenewal: The dedicated host is automatically renewed.
  • Normal: The dedicated host is not automatically renewed, and you will receive notifications for renewal.
  • NotRenewal: The dedicated host is not renewed, and no expiration notification is sent. Notifications for renewal are automatically sent three days before the dedicated host expires. You can change the value of this parameter from NotRenewal to Normal for the dedicated host and manually renew it by calling the RenewDedicatedHosts operation. Alternatively, you can set this parameter to AutoRenewal to configure the dedicated host to be automatically renewed.
AutoRenewEnabled Boolean false

Indicates whether the subscription dedicated host is automatically renewed. Valid values:

  • true: The dedicated host is automatically renewed.
  • false: The dedicated host is not automatically renewed.
AutoRenewWithEcs String StopRenewWithEcs

Indicates whether the subscription dedicated host is automatically renewed along with the subscription Elastic Compute Service (ECS) instances hosted on it if the new expiration time of the renewed instances is later than the expiration time of the dedicated host. Valid values:

  • AutoRenewWithEcs: The subscription dedicated host is automatically renewed along with the subscription ECS instances hosted on it.
  • StopRenewWithEcs: The subscription dedicated host is not automatically renewed along with the subscription ECS instances hosted on it.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeDedicatedHostAutoRenew
&RegionId=cn-hangzhou
&DedicatedHostIds=dh-bp165p6xk2tlw61e****,dh-bp1f9vxmno****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeDedicatedHostAutoRenewResponse>
    <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
    <DedicatedHostRenewAttributes>
        <DedicatedHostRenewAttribute>
            <AutoRenewEnabled>false</AutoRenewEnabled>
            <DedicatedHostId>dh-bp165p6xk2tlw61e****</DedicatedHostId>
            <RenewalStatus>Normal</RenewalStatus>
            <AutoRenewWithEcs>StopRenewWithEcs</AutoRenewWithEcs>
            <Duration>0</Duration>
            <PeriodUnit>Month</PeriodUnit>
        </DedicatedHostRenewAttribute>
        <DedicatedHostRenewAttribute>
            <AutoRenewEnabled>true</AutoRenewEnabled>
            <DedicatedHostId>dh-bp1f9vxmno****</DedicatedHostId>
            <RenewalStatus>AutoRenewal</RenewalStatus>
            <AutoRenewWithEcs>StopRenewWithEcs</AutoRenewWithEcs>
            <Duration>1</Duration>
            <PeriodUnit>Month</PeriodUnit>
        </DedicatedHostRenewAttribute>
    </DedicatedHostRenewAttributes>
</DescribeDedicatedHostAutoRenewResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368",
  "DedicatedHostRenewAttributes" : {
    "DedicatedHostRenewAttribute" : [ {
      "AutoRenewEnabled" : false,
      "DedicatedHostId" : "dh-bp165p6xk2tlw61e****",
      "RenewalStatus" : "Normal",
      "AutoRenewWithEcs" : "StopRenewWithEcs",
      "Duration" : 0,
      "PeriodUnit" : "Month"
    }, {
      "AutoRenewEnabled" : true,
      "DedicatedHostId" : "dh-bp1f9vxmno****",
      "RenewalStatus" : "AutoRenewal",
      "AutoRenewWithEcs" : "StopRenewWithEcs",
      "Duration" : 1,
      "PeriodUnit" : "Month"
    } ]
  }
}

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 IncorrectDedicatedHostStatus 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 pay-as-you-go dedicated hosts do not support this operation.

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