Queries the details of hosts in a dedicated cluster.

After hosts are created in a dedicated cluster, you can view the details of the hosts. The details include performance metrics, the total number of CPU cores, the total memory, and the total storage.

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 DescribeDedicatedHosts

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

RegionId String Yes cn-hangzhou

The ID of the region. For more information about region IDs, see Region IDs.

DedicatedHostGroupId String Yes dhg-h5i4p331f509****

The ID of the dedicated cluster.

Note You can view the dedicated cluster ID on the Dedicated Clusters page in the ApsaraDB MyBase console.
OrderId Long No 123456789

The ID of the order. To view the order ID, log on to the ApsaraDB MyBase console, choose Expenses > Orders in the top navigation bar, and then find the order ID that you want to view on the Orders page.

HostType String No dhg_cloud_ssd

The storage type of the host. Valid values:

  • dhg_local_ssd: local SSD
  • dhg_cloud_ssd or dhg_cloud_essd: enhanced SSD (ESSD)
HostStatus String No 1

The status of the host. Valid values:

  • 0: The host is being created.
  • 1: The host is running.
  • 2: The host is faulty.
  • 3: The host is ready for deactivation.
  • 4: The host is being maintained.
  • 5: The host is deactivated.
  • 6: The host is restarting.
  • 7: The host is locked.
Note When a host fails, the host is deactivated. Before the host is deactivated, the data of the instances that run on the host is migrated to another host.
AllocationStatus String No Allocatable

Specifies whether instances can be created on the host. Valid values:

  • Allocatable: Instances can be created on the host.
  • Suspended: Instances cannot be created on the host.
ZoneId String No ap-southeast-1a

The ID of the zone. You can call the DescribeRegions operation to query the zone ID.

DedicatedHostId String No ch-bp10a5id3boqi****

The ID of the host in the dedicated cluster. You can view the host ID on the Host Information tab in the ApsaraDB MyBase console.

PageNumbers Integer No 50

The total number of pages to return.

PageSize Integer No 20

The number of entries to return on each page.

Tags String No null

The tags that are added to the host. Each tag is a key-value pair that consists of two parts: TagKey and TagValue. You can specify a maximum of five tags in the following format for each request: {"key1":"value1","key2":"value2"...}.

Note If you want to filter hosts by tag, do not specify the DedicatedHostId parameter. Otherwise, the DedicatedHostId parameter is used as the filter condition.

Response parameters

Parameter Type Example Description
TotalRecords Integer 40

The total number of returned hosts.

PageSize Integer 20

The number of entries returned per page.

RequestId String D6E068C3-25BC-455A-85FE-45F0B22EASER

The ID of the request.

PageNumbers Integer 2

The total number of returned pages.

DedicatedHostGroupId String dhg-6w7q18iwt5jo****

The ID of the dedicated cluster.

DedicatedHosts Array of DedicatedHosts

The details of the hosts.

DedicatedHosts
DeployType String Basic

The method of deployment. This parameter is returned only if the host is created in an ApsaraDB MyBase for MySQL dedicated cluster. Valid values:

  • High-availability
  • Basic
HostType String dhg_cloud_ssd

The storage type of the host.

HostStorage String 1234

The total storage capacity of the host. Unit: GB.

MemoryUsed String 24576

The amount of memory used by the host. Unit: GB.

DedicatedHostGroupId String dhg-6w7q18iwt5jo****

The ID of the dedicated cluster in which the host is created.

AllocationStatus String Suspended

Indicates whether instances can be created on the host. Valid values:

  • Allocatable: Instances can be created on the host.
  • Suspended: Instances cannot be created on the host.
StorageUsed String 588800

The amount of used storage. Unit: GB. You can view the amount of used storage on the Host Information tab in the ApsaraDB MyBase console.

EcsClassCode String ecs.r5.16xlarge

The instance type of the Elastic Compute Service (ECS) instance. For more information, see Instance family.

DedicatedHostId String ch-bp10a5id3boqi****

The ID of the host.

MemAllocationRatio String 90

The memory usage of the host in percentage.

CreatedTime String 2020-10-16 16:30:19

The time when the host was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

IPAddress String 192.168.0.56

The IP address of the host.

HostStatus String 1

The status of the host. Valid values:

  • 0: The host is being created.
  • 1: The host is running.
  • 2: The host is faulty.
  • 3: The host is ready for deactivation.
  • 4: The host is being maintained.
  • 5: The host is deactivated.
  • 6: The host is restarting.
  • 7: The host is locked.
Note When a host fails, the host is deactivated. Before the host is deactivated, the data of the instances that run on the host is migrated to another host.
HostName String ch-bp15xfnp706tl****

The name of the host.

HostCPU String 16

The number of CPU cores configured for the host.

CpuUsed String 10

The number of used CPU cores.

InstanceNumber String 1

The number of instances on the host.

OpenPermission String 0

Indicates whether the feature that allows you to have the OS permissions on the host is enabled.

DistributionSymbol String 0

Indicates whether the host is a distributed host. This parameter is returned only if the host is created in a Tair cluster.

VPCId String vpc-bp1roz55mrbj3ka1s****

The ID of the virtual private cloud (VPC) in which the dedicated cluster is deployed. The host is created in the dedicated cluster.

HostClass String rds.g6.4xlarge

The instance type of the host.

EndTime String 2021-10-16 16:30:19

The time when the host expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

VSwitchId String vsw-bp133c8ifzxd3iv6q****

The ID of the vSwitch to which the host is connected.

ZoneId String ap-southeast-1a

The ID of the zone in which the host resides.

CPUAllocationRatio String 10

The CPU utilization of the host.

ImageCategory String ALinux

The image type of the host.

Engine String mysql

The database engine of the host.

DiskAllocationRatio String 10

The disk usage of the host in percentage.

HostMem String 65536

The memory of the host.

BastionInstanceId String bastionhost-cn-i7m2fgw****

The ID of the bastion host with which the host is associated.

AccountName String test

The custom name of the host account.

  • The name can contain lowercase letters, digits, and underscores (_).
  • The name must start with a lowercase letter and end with a lowercase letter or a digit.
  • The name must be 2 to 16 characters in length.
AccountType String Normal

The type of the host account. Valid values:

Normal: a standard account

Admin: an administrator account

DistributionTag String t4n9uz07h3r1tmce****:1

The distribution tag of the host.

MaxAutoScaleHostStorage Long 0

The maximum storage capacity of local SSDs for auto scaling.

Examples

Sample requests

http(s)://cddc.aliyuncs.com/?Action=DescribeDedicatedHosts
&RegionId=cn-hangzhou
&DedicatedHostGroupId=dhg-h5i4p331f509****
&OrderId=123456789
&HostType=dhg_cloud_ssd
&HostStatus=1
&AllocationStatus=Allocatable
&ZoneId=ap-southeast-1a
&DedicatedHostId=ch-bp10a5id3boqi****
&PageNumbers=50
&PageSize=20
&Tags={"key1":"value1"}
&<Common request parameters>

Sample success responses

XML format

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

<DescribeDedicatedHostsResponse>
    <TotalRecords>40</TotalRecords>
    <PageSize>20</PageSize>
    <RequestId>D6E068C3-25BC-455A-85FE-45F0B22EASER</RequestId>
    <PageNumbers>2</PageNumbers>
    <DedicatedHostGroupId>dhg-6w7q18iwt5jo****</DedicatedHostGroupId>
    <DedicatedHosts>
        <DeployType>Basic</DeployType>
        <HostType>dhg_cloud_ssd</HostType>
        <HostStorage>1234</HostStorage>
        <MemoryUsed>24576</MemoryUsed>
        <DedicatedHostGroupId>dhg-6w7q18iwt5jo****</DedicatedHostGroupId>
        <AllocationStatus>Suspended</AllocationStatus>
        <StorageUsed>588800</StorageUsed>
        <EcsClassCode>ecs.r5.16xlarge</EcsClassCode>
        <DedicatedHostId>ch-bp10a5id3boqi****</DedicatedHostId>
        <MemAllocationRatio>90</MemAllocationRatio>
        <CreatedTime>2020-10-16 16:30:19</CreatedTime>
        <IPAddress>192.168.0.56</IPAddress>
        <HostStatus>1</HostStatus>
        <HostName>ch-bp15xfnp706tl****</HostName>
        <HostCPU>16</HostCPU>
        <CpuUsed>10</CpuUsed>
        <InstanceNumber>1</InstanceNumber>
        <OpenPermission>0</OpenPermission>
        <DistributionSymbol>0</DistributionSymbol>
        <VPCId>vpc-bp1roz55mrbj3ka1s****</VPCId>
        <HostClass>rds.g6.4xlarge</HostClass>
        <EndTime>2021-10-16 16:30:19</EndTime>
        <VSwitchId>vsw-bp133c8ifzxd3iv6q****</VSwitchId>
        <ZoneId>ap-southeast-1a</ZoneId>
        <CPUAllocationRatio>10</CPUAllocationRatio>
        <ImageCategory>ALinux</ImageCategory>
        <Engine>mysql</Engine>
        <DiskAllocationRatio>10</DiskAllocationRatio>
        <HostMem>65536</HostMem>
        <BastionInstanceId>bastionhost-cn-i7m2fgw****</BastionInstanceId>
        <AccountName>test</AccountName>
        <AccountType>Normal</AccountType>
        <DistributionTag>t4n9uz07h3r1tmce****:1</DistributionTag>
    </DedicatedHosts>
    <MaxAutoScaleHostStorage>0</MaxAutoScaleHostStorage>
</DescribeDedicatedHostsResponse>

JSON format

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

{
  "TotalRecords" : 40,
  "PageSize" : 20,
  "RequestId" : "D6E068C3-25BC-455A-85FE-45F0B22EASER",
  "PageNumbers" : 2,
  "DedicatedHostGroupId" : "dhg-6w7q18iwt5jo****",
  "DedicatedHosts" : [ {
    "DeployType" : "Basic",
    "HostType" : "dhg_cloud_ssd",
    "HostStorage" : "1234",
    "MemoryUsed" : "24576",
    "DedicatedHostGroupId" : "dhg-6w7q18iwt5jo****",
    "AllocationStatus" : "Suspended",
    "StorageUsed" : "588800",
    "EcsClassCode" : "ecs.r5.16xlarge",
    "DedicatedHostId" : "ch-bp10a5id3boqi****",
    "MemAllocationRatio" : "90",
    "CreatedTime" : "2020-10-16 16:30:19",
    "IPAddress" : "192.168.0.56",
    "HostStatus" : "1",
    "HostName" : "ch-bp15xfnp706tl****",
    "HostCPU" : "16",
    "CpuUsed" : "10",
    "InstanceNumber" : "1",
    "OpenPermission" : "0",
    "DistributionSymbol" : "0",
    "VPCId" : "vpc-bp1roz55mrbj3ka1s****",
    "HostClass" : "rds.g6.4xlarge",
    "EndTime" : "2021-10-16 16:30:19",
    "VSwitchId" : "vsw-bp133c8ifzxd3iv6q****",
    "ZoneId" : "ap-southeast-1a",
    "CPUAllocationRatio" : "10",
    "ImageCategory" : "ALinux",
    "Engine" : "mysql",
    "DiskAllocationRatio" : "10",
    "HostMem" : "65536",
    "BastionInstanceId" : "bastionhost-cn-i7m2fgw****",
    "AccountName" : "test",
    "AccountType" : "Normal",
    "DistributionTag" : "t4n9uz07h3r1tmce****:1"
  } ],
  "MaxAutoScaleHostStorage" : 0
}

Error codes

Http status code Error code Error message Description
403 Forbidden.RAM User not authorized to operate on the specified resource, or this API does not support RAM. The error message returned because you are not authorized to perform the specified operation.

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