You can call this operation to query the auto-renewal status 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
DedicatedHostIds String Yes dh-dedicatedhost1,dh-dedicatedhost2

The ID of the dedicated host. You can enter up to 100 dedicated host IDs in the list. Separate the IDs with commas (,).

RegionId String Yes cn-hangzhou

The region ID of the dedicated host.

Action String Yes DescribeDedicatedHostAutoRenew

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

Response parameters

Parameter Type Example Description
DedicatedHostRenewAttributes

An array of auto-renewal attributes for dedicated hosts.

AutoRenewEnabled Boolean true

Indicates whether auto-renewal is enabled.

DedicatedHostId String ddh-xxxxxxxxxxxxxxxxxxxxx

The ID of the dedicated host.

Duration Integer 0

The auto-renewal period.

PeriodUnit String Month

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

RenewalStatus String Normal

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

  • AutoRenewal: The cluster is automatically renewed.
  • Normal: The dedicated host is not automatically renewed but you will still receive notifications for renewals.
  • NotRenewal: Auto-renewal is disabled and no expiration notification is sent. You receive notifications for renewal 3 days before the expiration time of the dedicated host subscription. You can set the dedicated host that is not renewed to Normal and manually renew it by calling the RenewDedicatedHosts operation. Otherwise, you can renew it by setting this parameter to AutoRenewal.
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Examples

Sample requests


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

Sample success responses

XML format

<DescribeDedicatedHostAutoRenewResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
      <DedicatedHostRenewAttributes>
            <DedicatedHostRenewAttribute>
                  <DedicatedHostId>dh-dedicatedhost1</DedicatedHostId>
                  <Duration>0</Duration>
                  <AutoRenewEnalbed>false</AutoRenewEnalbed>
                  <PeriodUnit>Month</PeriodUnit>
                  <RenewalStatus>Normal</RenewalStatus>
            </DedicatedHostRenewAttribute>
             <DedicatedHostRenewAttribute>
                  <DedicatedHostId>dh-dedicatedhost2</DedicatedHostId>
                  <Duration>1</Duration>
                  <PeriodUnit>Month</PeriodUnit>
                  <AutoRenewEnalbed>true</AutoRenewEnalbed>
                  <RenewalStatus>AutoRenewal</RenewalStatus>
            </DedicatedHostRenewAttribute>
      </DedicatedHostRenewAttributes>
</DescribeDedicatedHostAutoRenewResponse>

JSON format

{
	"DedicatedHostIdRenewAttributes":{
		"DedicatedHostIdRenewAttribute":[
			{
				"RenewalStatus":"Normal",
				"DedicatedHostId":"dh-dedicatedhost1",
				"Duration":0,
				"AutoRenewEnabled":false,
				"PeriodUnit":"Month"
			},
			{
				"RenewalStatus":"AutoRenewal",
				"DedicatedHostId":"dh-dedicatedhost2",
				"Duration":1,
				"AutoRenewEnabled":true,
				"PeriodUnit":"Month"
			}
		]
	},
	"RequestId":"04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HTTP status code Error code Error message Description
403 MissingParameter.DedicatedHostId DedicatedHostId should not be null. The error message returned because the host ID cannot be empty.
403 InvalidParameter.ToManyDedicatedHostIds DedicatedHostId should be less than 100. The error message returned because the number of dedicated host IDs specified in DedicatedHostIds exceeds the upper limit. DedicatedHostIds supports a maximum of 100 IDs.
403 InvalidParameter.InvalidDedicatedHostId %s The error message returned because the specified DedicatedHostId is invalid.
403 IncorrectDedicatedHostStatus The current status of the resource does not support this operation. The error message returned because this 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 the current operation is not supported for pay-as-you-go dedicated hosts.

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