You need to enable JavaScript to run this app.
导航

DescribeDedicatedHosts

最近更新时间2024.04.22 11:34:50

首次发布时间2024.04.22 11:34:50

调用 DescribeDedicatedHosts 接口查询专有宿主机的详细信息,包括宿主机状态、到期时间和已创建的实例列表等。

请求参数

名称
类型是否必填
示例值
描述

Action

String

DescribeDedicatedHosts

要执行的操作,取值:DescribeDedicatedHosts。

VersionString2020-04-01API的版本,取值:2020-04-01。

DedicatedHostIds.N

String

DedicatedHostIds.1=dh-3ti9101aju3vj0********&DedicatedHostIds.2=dh-ycje2rquioh9l3bn****

专有宿主机ID,最多支持100个ID。

  • 参数 - N:表示专有宿主机ID的序号。

  • 多个ID之间用&分隔。

DedicatedHostNameStringdedicated-host专有宿主机名称,支持关键字模糊查询。
DedicatedHostTypeIdStringecs.ddhr2s专有宿主机规格ID。
DedicatedHostClusterIdStringdc-ycle6b76kgv2wrsm****专有宿主机所属的集群ID。

Status

String

Available

专有宿主机的状态,取值:

  • Starting:启动中。

  • Available:可用。

  • Stopping:停止中。

  • Stopped:已停止。

  • Released:已释放。

  • UnderAssessment:存在潜在风险。

  • TempUnavailable:临时不可用。

  • Pending:维护中。

  • PermanentFailure:永久性故障。

  • Unknown:未知。

ZoneIdStringcn-beijing-a专有宿主机所在可用区ID,您可以调用 DescribeZones 查询一个地域下的可用区信息。

NextToken

String

-

分页查询凭证,用于标记分页的位置,初次调用该接口时无需设置。下次查询时,取值为上一次API调用返回的NextToken参数值。

MaxResults

Integer

10

分页查询时设置的每页行数:

  • 最大值:100

  • 默认值:10

返回数据

名称
类型
示例值
描述
DedicatedHosts
Array of Struct
-
专有宿主机信息。
NextToken
String
eWNsYTg0b2s1Y3Yyd3Jzb2do****
本次调用返回的查询凭证值,返回为空表示该页为末页。

请求示例

GET /?Action=DescribeDedicatedHosts&Version=2020-04-01 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20230714173759DC17D8F861B10D4D****",
        "Action": "DescribeDedicatedHosts",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {
        "DedicatedHosts": [
            {
                "CreatedAt": "2023-07-14T17:17:56+08:00",
                "UpdatedAt": "2023-07-14T17:17:58+08:00",
                "DedicatedHostId": "dh-ycje2rquioh9l3bn****",
                "ZoneId": "cn-beijing-a",
                "Status": "Available",
                "DedicatedHostName": "dedicated-host-test",
                "Description": "",
                "AutoPlacement": "Off",
                "HostRecovery": "Off",
                "HostMaintenance": "Off",
                "CpuOvercommitRatio": 4,
                "Instances": [],
                "Capacity": {
                    "TotalVcpus": 448,
                    "AvailableVcpus": 448,
                    "TotalMemory": 962560,
                    "AvailableMemory": 962560
                },
                "DedicatedHostTypeId": "ecs.ddhr2s",
                "ChargeType": "PrePaid",
                "ExpiredAt": "2023-08-14T23:59:59+08:00"
            }
        ],
        "NextToken": "eWNsYTg0b2s1Y3Yyd3Jzb2do****"
    }
}

错误码

HttpCode错误码错误信息描述
400InvalidArgumentThe specified argument is invalid.指定的参数不合法。
400LimitExceeded.MaximumDedicatedHostIdsThe number of specified DedicatedHostIds exceeds the maximum limit.指定的DedicatedHostIds数量超过最大限制。
500InternalErrorAn internal error has occurred.内部错误,请重试。如果多次尝试失败,请提交工单。