调用DescribeDedicatedHostAutoRenew查询一台或多台包年包月专有宿主机自动续费状态。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 |
类型 |
是否必选 |
示例值 |
描述 |
Action | String | 是 | DescribeDedicatedHostAutoRenew | 系统规定参数。取值:DescribeDedicatedHostAutoRenew。 |
DedicatedHostIds | String | 是 | dh-bp165p6xk2tlw61e****,dh-bp1f9vxmno**** | 专有宿主机ID。最多可以输入100个包年包月专有宿主机ID,ID之间用半角逗号(,)隔开。 |
RegionId | String | 是 | cn-hangzhou | 专有宿主机所属的地域ID。 |
返回数据
名称 |
类型 |
示例值 |
描述 |
RequestId | String | 04F0F334-1335-436C-A1D7-6C044FE73368 | 请求ID。 |
DedicatedHostRenewAttributes | Array of DedicatedHostRenewAttribute | 专有宿主机自动续费属性组成的数组。 |
|
DedicatedHostRenewAttribute | |||
PeriodUnit | String | Month | 续费单位。可能值:
|
Duration | Integer | 0 | 自动续费时长。 |
DedicatedHostId | String | dh-bp165p6xk2tlw61e**** | 专有宿主机ID。 |
RenewalStatus | String | Normal | 是否自动续费包年包月专有宿主机。可能值:
|
AutoRenewEnabled | Boolean | false | 是否自动续费。可能值:
|
AutoRenewWithEcs | String | StopRenewWithEcs | 包年包月专有宿主机内的包年包月ECS实例自动续费时,如果ECS实例续费后的到期时间比专有宿主机的到期时间晚,则该专有宿主机是否随ECS实例自动续费。可能值:
|
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeDedicatedHostAutoRenew
&RegionId=cn-hangzhou
&DedicatedHostIds=dh-bp165p6xk2tlw61e****,dh-bp1f9vxmno****
&<公共请求参数>
正常返回示例
XML
格式
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
格式
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"
} ]
}
}
错误码
HttpCode |
错误码 |
错误信息 |
描述 |
403 | ChargeTypeViolation | Pay-As-You-Go dedicated host does not support this operation. | 按量付费的宿主机不支持当前操作。 |
403 | MissingParameter.DedicatedHostId | DedicatedHostId should not be null. | 参数 DedicatedHostId 不能为空。 |
403 | InvalidParameter.ToManyDedicatedHostIds | DedicatedHostId should be less than 100. | 参数 DedicatedHostIds 包含的专有宿主机 ID 应该少于 100 个。 |
403 | InvalidParameter.InvalidDedicatedHostId | %s | 指定的参数 DedicatedHostId 无效。 |
403 | IncorrectDedicatedHostStatus | The current status of the resource does not support this operation. | 当前资源的状态不支持此操作。 |
403 | MissingParamter.InstanceId | InstanceId should not be null. | 实例id不能为空 |
访问错误中心查看更多错误码。