全部产品
Search
文档中心

云服务器 ECS:DescribeDedicatedHostAutoRenew

更新时间:Sep 11, 2023

调用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

续费单位。可能值:

  • Week。
  • Month。
Duration Integer 0

自动续费时长。

DedicatedHostId String dh-bp165p6xk2tlw61e****

专有宿主机ID。

RenewalStatus String Normal

是否自动续费包年包月专有宿主机。可能值:

  • AutoRenewal:自动续费。
  • Normal:待续费。
  • NotRenewal:不续费,也不发送到期提醒。到期前第三天阿里云会发送不续费提醒。不续费的专有宿主机可以设置成待续费(Normal),再自行续费RenewDedicatedHosts或设置为自动续费(AutoRenewal)。
AutoRenewEnabled Boolean false

是否自动续费。可能值:

  • true:自动续费。
  • false:不自动续费。
AutoRenewWithEcs String StopRenewWithEcs

包年包月专有宿主机内的包年包月ECS实例自动续费时,如果ECS实例续费后的到期时间比专有宿主机的到期时间晚,则该专有宿主机是否随ECS实例自动续费。可能值:

  • AutoRenewWithEcs:跟随ECS实例自动续费。
  • StopRenewWithEcs:不跟随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不能为空

访问错误中心查看更多错误码。