Updated on 2026-06-27 GMT+08:00

Querying a Host List - ListHosts

Function

This API is used to query the host list details of a specified cluster.

Constraints

None

Debugging

You can debug this API in API Explorer, which supports automatic authentication and authorization. API Explorer can automatically generate sample SDK code and supports sample SDK code debugging.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.

URI

  • Format

    GET /v1.1/{project_id}/clusters/{cluster_id}/hosts

  • Parameter description
    Table 1 URI parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Explanation

    Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

    Constraints

    N/A

    Value range

    The value must consist of 1 to 64 characters. Only letters and digits are allowed.

    Default value

    N/A

    cluster_id

    Yes

    String

    Explanation

    Cluster ID If this parameter is specified, the latest metadata of the cluster that has been patched will be obtained. For details about how to obtain the cluster ID, see Obtaining a Cluster ID.

    Constraints

    N/A

    Value range

    The value can contain 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-).

    Default value

    N/A

    Table 2 Query parameters

    Parameter

    Mandatory

    Type

    Description

    pageSize

    No

    Integer

    Definition

    Maximum number of clusters displayed on a page.

    Constraints

    N/A

    Range

    1-2147483646

    Default Value

    10

    currentPage

    No

    Integer

    Definition

    Current page number.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request Parameters

None

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Definition

Host parameters.

Constraints

N/A

Range

N/A

Default Value

N/A

hosts

Array of HostModel objects

Definition

Host parameters

For details, see Table 4.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 4 HostModel

Parameter

Type

Description

id

String

Definition

VM ID.

Constraints

N/A

Range

N/A

Default Value

N/A

name

String

Definition

VM name.

Constraints

N/A

Range

N/A

Default Value

N/A

ip

String

Definition

VM IP address.

Constraints

N/A

Range

N/A

Default Value

N/A

availability_zone_id

String

Definition

Availability zone.

Constraints

N/A

Range

N/A

Default Value

N/A

tags

Array of TagPlain objects

Definition

The tag list. For details, see Table 5.

Constraints

N/A

Range

N/A

Default Value

N/A

status

String

Definition

Current VM status, which is ACTIVE under normal conditions.

Constraints

N/A

Range

  • ACTIVE: The VM is running.

  • STARTED: The VM is running (a state of ACTIVE).

  • SHUTOFF: The VM is stopped.

  • ERROR: The VM is faulty.

  • BUILD: The VM is being created.

  • DELETED: The VM has been deleted.

  • DELETING: The VM is being deleted.

  • STOPPING: The VM is being stopped.

  • STARTED: The VM is running.

  • ATTACHED: The VM has been de-isolated.

  • DETACHED: The VM has been isolated.

  • DETACH_FAIL: The VM fails to be isolated.

  • UNKNOWN: The VM status is unknown.

  • SCALING_UP: The VM specifications are being upgraded.

  • DECOMMISSIONING: The node is being decommissioned.

  • DECOMMISSIONED: The node has been decommissioned.

  • VOLUMES_EXPANDING: The disk capacity is being expanded.

Default Value

N/A

resource_id

String

Definition

Node resource ID.

Constraints

N/A

Range

N/A

Default Value

N/A

flavor

String

Definition

VM specification ID.

Constraints

N/A

Range

N/A

Default Value

N/A

type

String

Definition

VM type. The value can be MasterNode, CoreNode, or TaskNode.

Constraints

N/A

Range

  • MasterNode: Master node
  • CoreNode: Core node
  • TaskNode: Task node

Default Value

N/A

mem

String

Definition

Memory, in GB.

Constraints

N/A

Range

N/A

Default Value

N/A

cpu

String

Definition

Number of CPU cores.

Constraints

N/A

Range

N/A

Default Value

N/A

root_volume_size

String

Definition

OS disk capacity, in GB.

Constraints

N/A

Range

N/A

Default Value

N/A

data_volume_type

String

Definition

Data disk type.

Constraints

N/A

Range

SATA: common I/O

SAS: high I/O

SSD: ultra-high I/O

Default Value

N/A

data_volume_size

Integer

Definition

Data disk capacity, in GB.

Constraints

N/A

Range

N/A

Default Value

N/A

data_volume_count

Integer

Definition

Number of data disks.

Constraints

N/A

Range

N/A

Default Value

N/A

node_group_name

String

Definition

Node group name.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 5 TagPlain parameters

Parameter

Type

Description

key

String

Definition

Tag key.

Constraints

N/A

Range

A tag key can contain letters, digits, spaces, and special characters _.:=+-@, but cannot start or end with a space or start with _sys_.

Default Value

N/A

value

String

Definition

Tag value.

Constraints

N/A

Range

The value can contain letters, digits, spaces, and special characters _.:=+-@, but cannot start or end with a space or start with _sys_.

Default Value

N/A

Example Request

GET /v1.1/{project_id}/clusters/{cluster_id}/hosts

Example Response

Status code: 200

Querying the host list is successful.

{
  "total" : "5",
  "hosts" : [ {
    "id" : "063d1d47-ae91-4a48-840c-b3cfe4efbcf0",
    "name" : "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_IQhiC",
    "ip" : "192.168.0.169",
    "availability_zone_id" : null,
    "tags" : null,
    "status" : "ACTIVE",
    "resource_id" : "95c1eabc-ed1d-4037-97d1-62f0587790c7",
    "flavor" : "c2.2xlarge.linux.mrs",
    "type" : "Core",
    "mem" : "16384",
    "cpu" : "8",
    "root_volume_size" : "480",
    "data_volume_type" : "SATA",
    "data_volume_size" : "600",
    "data_volume_count" : "1",
    "node_group_name" : "node_group_1"
  }, {
    "id" : "dc5c6208-faa2-4727-a65a-2b1ce235d350",
    "name" : "a78e161c-d14f-4b68-8c2d-0219920ce844_node_master1_ASzkl",
    "ip" : "192.168.0.156",
    "availability_zone_id" : null,
    "tags" : null,
    "status" : "ACTIVE",
    "resource_id" : "95c1eabc-ed1d-4037-97d1-62f0587790c7",
    "flavor" : "c2.4xlarge.linux.mrs",
    "type" : "Master",
    "mem" : "32768",
    "cpu" : "16",
    "root_volume_size" : "480",
    "data_volume_type" : "SATA",
    "data_volume_size" : "600",
    "data_volume_count" : "1",
    "node_group_name" : "master_node_default_group"
  }, {
    "id" : "c0ce793d-848b-448a-835b-ea0cac534b09",
    "name" : "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_ANnRN",
    "ip" : "192.168.0.243",
    "availability_zone_id" : null,
    "tags" : null,
    "status" : "ACTIVE",
    "resource_id" : "95c1eabc-ed1d-4037-97d1-62f0587790c7",
    "flavor" : "c2.2xlarge.linux.mrs",
    "type" : "Core",
    "mem" : "16384",
    "cpu" : "8",
    "root_volume_size" : "480",
    "data_volume_type" : "SATA",
    "data_volume_size" : "600",
    "data_volume_count" : "1",
    "node_group_name" : "node_group_1"
  }, {
    "id" : "95c23e43-ef6e-4732-b6ed-a5f1c7779fae",
    "name" : "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_uRRiA",
    "ip" : "192.168.0.126",
    "availability_zone_id" : null,
    "tags" : null,
    "status" : "ACTIVE",
    "resource_id" : "95c1eabc-ed1d-4037-97d1-62f0587790c7",
    "flavor" : "c2.2xlarge.linux.mrs",
    "type" : "Core",
    "mem" : "16384",
    "cpu" : "8",
    "root_volume_size" : "480",
    "data_volume_type" : "SATA",
    "data_volume_size" : "600",
    "data_volume_count" : "1",
    "node_group_name" : "node_group_1"
  }, {
    "id" : "63bdbf75-1133-4a94-8c27-1fa12c8b9e70",
    "name" : "a78e161c-d14f-4b68-8c2d-0219920ce844_node_master2_StqFu",
    "ip" : "192.168.0.22",
    "availability_zone_id" : null,
    "tags" : null,
    "status" : "ACTIVE",
    "resource_id" : "95c1eabc-ed1d-4037-97d1-62f0587790c7",
    "flavor" : "c2.4xlarge.linux.mrs",
    "type" : "Master",
    "mem" : "32768",
    "cpu" : "16",
    "root_volume_size" : "480",
    "data_volume_type" : "SATA",
    "data_volume_size" : "600",
    "data_volume_count" : "1",
    "node_group_name" : "master_node_default_group"
  } ]
}

Status Codes

Table 6 describes the status code.

Table 6 Status code

Status Code

Description

200

The host list has been queried.

See Status Codes.

Error Codes

See Error Codes.