Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying a Host List

Updated on 2024-12-10 GMT+08:00

Function

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

Constraints

None

Debugging

You can debug this API in API Explorer. Automatic authentication is supported. API Explorer can automatically generate sample SDK code and provide the sample SDK code debugging.

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

    Explanation

    Maximum number of clusters displayed on a page.

    Constraints

    N/A

    Value range

    1-2147483646

    Default value

    10

    currentPage

    No

    Integer

    Explanation

    Current page number.

    Constraints

    N/A

    Value range

    N/A

    Default value

    N/A

Request Parameters

None

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Explanation

Host parameters.

Constraints

N/A

Value range

N/A

Default value

N/A

hosts

Array of HostModel objects

Explanation

Host parameters

For details, see Table 4.

Constraints

N/A

Value range

N/A

Default value

N/A

Table 4 HostModel

Parameter

Type

Description

id

String

Explanation

VM ID.

Constraints

N/A

Value range

N/A

Default value

N/A

ip

String

Explanation

VM IP address.

Constraints

N/A

Value range

N/A

Default value

N/A

availability_zone_id

String

Explanation

Availability zone.

Constraints

N/A

Value range

N/A

Default value

N/A

tags

Array of TagPlain objects

Explanation

The tag list. For details, see Table 5.

Constraints

N/A

Value range

N/A

Default value

N/A

flavor

String

Explanation

VM specification ID.

Constraints

N/A

Value range

N/A

Default value

N/A

type

String

Explanation

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

Constraints

N/A

Value range

N/A

Default value

N/A

name

String

Explanation

VM name.

Constraints

N/A

Value range

N/A

Default value

N/A

status

String

Explanation

Current VM state.

Constraints

N/A

Value range

N/A

Default value

N/A

resource_id

String

Explanation

Node resource ID.

Constraints

N/A

Value range

N/A

Default value

N/A

mem

String

Explanation

Memory.

Constraints

N/A

Value range

N/A

Default value

N/A

cpu

String

Explanation

Number of CPU cores.

Constraints

N/A

Value range

N/A

Default value

N/A

root_volume_size

String

Explanation

OS disk capacity.

Constraints

N/A

Value range

N/A

Default value

N/A

data_volume_type

String

Explanation

Data disk type.

Constraints

N/A

Value range

N/A

Default value

N/A

data_volume_size

Integer

Explanation

Data disk capacity.

Constraints

N/A

Value range

N/A

Default value

N/A

data_volume_count

Integer

Explanation

Number of data disks.

Constraints

N/A

Value range

N/A

Default value

N/A

node_group_name

String

Explanation

Node group name.

Constraints

N/A

Value range

N/A

Default value

N/A

Table 5 TagPlain parameters

Parameter

Type

Description

key

String

Explanation

Tag key.

Constraints

N/A

Value 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

Explanation

Tag value.

Constraints

N/A

Value 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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback