• MapReduce Service

mrs
  1. Help Center
  2. MapReduce Service
  3. API Reference
  4. APIs
  5. Cluster Management APIs
  6. Listing Cluster Hosts

Listing Cluster Hosts

Function

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

URI

  • Format:

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

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory or Not

    Description

    project_id

    Yes

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

    cluster_id

    Yes

    Cluster ID

Request

  • Example:

    None.

  • Parameter description
    Table 2 URI parameter description

    Parameter

    Mandatory or Not

    Description

    pageSize

    No

    Maximum number of hosts displayed on a page

    The value ranges from 1 to 2147483646.

    currentPage

    No

    Current page number

Response

  • Example
{
  "total": 5,
  "hosts": [
    {
      "id": "063d1d47-ae91-4a48-840c-b3cfe4efbcf0",
      "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_IQhiC",
      "ip": "192.168.0.169",
      "status": "ACTIVE",
      "flavor": "c2.2xlarge.linux.mrs",
      "type": "Core",
      "mem": "16384",
      "cpu": "8",
      "root_volume_size": "40",
      "data_volume_type": "SATA",
      "data_volume_size": 100,
      "data_volume_count": 1
    },
    {
      "id": "dc5c6208-faa2-4727-a65a-2b1ce235d350",
      "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_master1_ASzkl",
      "ip": "192.168.0.156",
      "status": "ACTIVE",
      "flavor": "c2.4xlarge.linux.mrs",
      "type": "Master",
      "mem": "32768",
      "cpu": "16",
      "root_volume_size": "40",
      "data_volume_type": "SATA",
      "data_volume_size": 100,
      "data_volume_count": 1
    },
    {
      "id": "c0ce793d-848b-448a-835b-ea0cac534b09",
      "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_ANnRN",
      "ip": "192.168.0.243",
      "status": "ACTIVE",
      "flavor": "c2.2xlarge.linux.mrs",
      "type": "Core",
      "mem": "16384",
      "cpu": "8",
      "root_volume_size": "40",
      "data_volume_type": "SATA",
      "data_volume_size": 100,
      "data_volume_count": 1
    },
    {
      "id": "95c23e43-ef6e-4732-b6ed-a5f1c7779fae",
      "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_uRRiA",
      "ip": "192.168.0.126",
      "status": "ACTIVE",
      "flavor": "c2.2xlarge.linux.mrs",
      "type": "Core",
      "mem": "16384",
      "cpu": "8",
      "root_volume_size": "40",
      "data_volume_type": "SATA",
      "data_volume_size": 100,
      "data_volume_count": 1
    },
    {
      "id": "63bdbf75-1133-4a94-8c27-1fa12c8b9e70",
      "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_master2_StqFu",
      "ip": "192.168.0.22",
      "status": "ACTIVE",
      "flavor": "c2.4xlarge.linux.mrs",
      "type": "Master",
      "mem": "32768",
      "cpu": "16",
      "root_volume_size": "40",
      "data_volume_type": "SATA",
      "data_volume_size": 100,
      "data_volume_count": 1
    }
  ]
}
  • Parameter description
    Table 3 Response parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    total

    Yes

    String

    Total numbers of hosts in a list

    Hosts

    Yes

    Array

    Host list parameters

    For details, see Table 4.

    Table 4 hosts parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    id

    YES

    String

    VM ID

    ip

    YES

    String

    VM IP address

    flavor

    YES

    String

    VM flavor ID

    type

    YES

    String

    VM type

    Currently, MasterNode, CoreNode, and TaskNode are supported.

    name

    YES

    String

    VM name

    status

    YES

    String

    VM status

    mem

    YES

    String

    Memory

    cpu

    YES

    String

    Number of CPU cores

    root_volume_size

    YES

    String

    Capacity of the operating system disk

    data_volume_type

    YES

    String

    Data disk type

    data_volume_size

    YES

    String

    Data disk capacity

    data_volume_count

    YES

    String

    Number of data disks

Status Code

Table 5 describes the status code of this API.

Table 5 Status code

Status Code

Description

200

The host list of the specified cluster is successfully queried.

For the description about error status codes, see section Status Codes.