• Cloud Search Service

css
  1. Help Center
  2. Cloud Search Service
  3. API Reference
  4. APIs Related to Cluster Management
  5. Querying the List of Clusters

Querying the List of Clusters

Function

This API is used to query and display the cluster list and cluster status.

URI

GET /v1.0/{project_id}/clusters
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

start

No

Integer

Start value of the query. The default value is 1, indicating that the query starts from the first cluster.

limit

No

Integer

Number of clusters to be queried. The default value is 10, indicating that 10 clusters are queried at a time.

Request

None

Response

Table 2 describes the response parameters.

Table 2 Parameter description

Parameter

Type

Description

clusters

Array

List of cluster objects.

updated

String

Last modification time of a cluster. The format is ISO8601: CCYY-MM-DDThh:mm:ss.

name

String

Cluster name.

created

String

Time when a cluster is created. The format is ISO8601: CCYY-MM-DDThh:mm:ss.

NOTE:

The returned cluster list is sorted by creation time in descending order. Specifically, the cluster with the latest creation time is at the top.

id

String

Cluster ID.

status

String

Return value.

  • 100: The cluster is being created.
  • 200: The cluster is available.
  • 303: The cluster is unavailable.

endpoint

String

Indicates the IP address and port number of the user used to access the VPC.

actionProgress

Object

Cluster operation progress, which indicates the progress of cluster creation and expansion in percentage.

actions

Array

Current behavior on a cluster. Value REBOOTING indicates that the cluster is being restarted, GROWING indicates that capacity expansion is being performed on the cluster, RESTORING indicates that the cluster is being restored, and SNAPSHOTTING indicates that the snapshot is being created.

failed_reasons

Object

Failure cause. If the cluster is in the Available state, this parameter is not returned.

httpsEnable

Boolean

Communication encryption status.

Value false indicates that communication encryption is not enabled.

Value true indicates that communication encryption is enabled.

diskEncrypted

Boolean

Whether disks are encrypted.

  • Value true indicates that disks are encrypted.
  • Value false indicates that disks are not encrypted.

cmkId

String

Key ID used for disk encryption.

vpcId

String

VPC ID.

subnetId

String

Subnet ID.

securityGroupId

String

Security group ID.

Table 3 clusters field data structure description

Parameter

Type

Description

datastore

Object

Type of the data search engine.

instances

Array

List of node objects.

Table 4 datastore field data structure description

Parameter

Type

Description

type

String

Supported type: elasticsearch

version

String

Engine version number.

Table 5 instances field data structure description

Parameter

Type

Description

type

String

Supported type: ess (indicating the Elasticsearch node)

id

String

Instance ID.

name

String

Instance name.

status

String

Instance state.

  • 100: The instance is being created.
  • 200: The instance is available.
  • 303: The instance is unavailable.
Table 6 failed_reasons field data structure description

Parameter

Type

Description

error_code

String

Error code.

  • CSS.6000: indicates that a cluster fails to be created.
  • CSS.6001: indicates that capacity expansion of a cluster fails.
  • CSS.6002: indicates that a cluster fails to be restarted.
  • CSS.6004: indicates that a node fails to be created in a cluster.
  • CSS.6005: indicates that the service fails to be initialized.

error_msg

String

Detailed error information.

Examples

  • Example request
    • Example request of querying all clusters
      GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters
    • Example request of querying clusters by page

      Example 1: Query the first two clusters.

      Method 1

      GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?start=1&limit=2
      Method 2
      GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?limit=2

      Example 2: Query the first 10 clusters.

      Method 1
      GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?start=1&limit=10
      Method 2
      GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?start=1
  • Example response
    {
      "clusters": [
        {
          "datastore": {
            "type": "elasticsearch",
            "version": "6.2.3"
          },
          "instances": [
            {
              "status": "200",
              "type": "ess",
              "id": "a8922be2-5e41-4cd1-8486-630c04c2d1e3",
              "name": "ES-new1-ess-esn-1-1"
            }
          ],
          "updated": "2017-11-27T10:36:18",
          "name": "ES-new1",
          "created": "2017-11-27T10:36:18",
          "id": "306e5597-d7a9-4cbe-866c-33428440d0e3",
          "status": "200",
          "endpoint": "192.168.0.219:9200",
          "httpsEnable": false,
          "diskEncrypted" : true,
          "cmkId" : "42546bb1-8025-4ad1-868f-600729c341ae",
          "actionProgress": {
          "CREATING": "5%"
          },
          "actions": []
        },
        {
          "datastore": {
            "type": "elasticsearch",
            "version": "6.2.3"
          },
          "instances": [
            {
              "status": "200",
              "type": "ess",
              "id": "9635de45-895c-45e1-ba0b-d9f497c8ce52",
              "name": "Es-Test1-ess-esn-1-1"
            }
          ],
          "updated": "2017-11-14T12:32:00",
          "name": "Es-Test1",
          "created": "2017-11-14T12:32:00",
          "id": "c99b1514-647e-4418-8b6d-2748255f2f95",
          "status": "200",
          "endpoint": "192.168.0.127:9200",
          "httpsEnable": false,
          "diskEncrypted" : true,
          "cmkId" : "42546bb1-8025-4ad1-868f-600729c341ae",
          "vpcId": "07761987-bb61-4bbf-9d14-a7e6b6909224",
          "subnetId": "675ae21c-cc1c-4fc5-9cb4-4c07fce79648",
          "securityGroupId": "e9e098c8-2116-4b92-823c-036f0f17360b",
          "actionProgress": {},
          "actions": [
            "REBOOTING"
          ]
        }
      ]
    }

Status Code

Table 7 describes the status code.

Table 7 Status code

Status Code

Code

Status Code Description

400

BadRequest

Invalid request.

The client should not repeat the request without modifications.

404

NotFound

The requested resource cannot be found.

The client should not repeat the request without modifications.

200

OK

The request is processed successfully.