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. For details, see Obtaining a Project ID and Name.

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 of clusters objects

List of cluster objects

Table 3 clusters field data structure description

Parameter

Type

Description

datastore

Object

Type of the data search engine. For details, see Table 4.

instances

Array of instance objects

List of node 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: Creating.

  • 200: Available.

  • 303: Unavailable, such as creation failed.

endpoint

String

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. CREATING specifies the progress of creation.

actions

Array of strings

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 status, this parameter is not returned. For details, see Table 6.

httpsEnable

Boolean

Communication encryption status.

Value false indicates that communication encryption is not enabled.

Value true indicates that communication encryption is enabled.

authorityEnable

String

Indicates whether to enable authentication. Available values include true and false. Authentication is disabled by default. When authentication is enabled, httpsEnable must be set to true.

  • Value true indicates that authentication is enabled for the cluster.

  • Value false indicates that authentication is disabled for the cluster.

diskEncrypted

Boolean

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

tags

Array of tag objects

Tags of a cluster.

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

  • 100: Creating.

  • 200: Available.

  • 303: Unavailable, such as creation failed.

specCode

String

Node specifications.

azCode

String

AZ to which a node belongs.

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 a cluster fails to be scaled out.

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

Table 7 tags field data structure description

Parameter

Type

Description

key

String

Tag key.

value

String

Tag value.

Examples

  • Example request

    • Example request of querying clusters. A maximum of 10 clusters can be queried by default.

      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": "7.6.2"
                },
                "instances": [
                    {
                        "status": "200",
                        "type": "ess",
                        "id": "c8c90973-924d-4201-b9ff-f32279c87d0e",
                        "name": "css-5492-ess-esn-1-1",
                        "specCode": "css.xlarge.2",
                        "azCode": "eu-de-01"
                    }
                ],
                "updated": "2020-12-01T07:47:34",
                "name": "css-5492",
                "created": "2020-12-01T07:47:34",
                "id": "66ea1e42-4ee2-44ad-bd80-c86e6d8c6b9e",
                "status": "200",
                "endpoint": "10.16.0.151:9200",
                "vpcId": "e7daa617-3ee6-4ff1-b042-8cda4a006a46",
                "subnetId": "6253dc44-24cd-4c0a-90b3-f965e7f4dcd4",
                "securityGroupId": "d478041e-bcbe-4d69-a492-b6122d774b7f",
                "httpsEnable": false,
                "authorityEnable": false,
                "diskEncrypted": true,
                "cmkId": "00f05033-f8ac-4ceb-a1ce-4072fadb6b28",
                "actionProgress": {},
                "actions": [],
                "tags": []
            },
            {
                "datastore": {
                    "type": "elasticsearch",
                    "version": "7.6.2"
                },
                "instances": [
                    {
                        "status": "200",
                        "type": "ess",
                        "id": "a24adddb-1553-4873-9978-9d064418f903",
                        "name": "css-1d01-ess-esn-1-1",
                        "specCode": "css.xlarge.2",
                        "azCode": "eu-de-01"
                    }
                ],
                "updated": "2020-11-26T10:08:44",
                "name": "css-1d01",
                "created": "2020-11-26T10:08:44",
                "id": "af5fbac7-b386-4305-b201-820a0f51f4f1",
                "status": "200",
                "endpoint": "10.16.0.124:9200",
                "vpcId": "e7daa617-3ee6-4ff1-b042-8cda4a006a46",
                "subnetId": "6253dc44-24cd-4c0a-90b3-f965e7f4dcd4",
                "securityGroupId": "d478041e-bcbe-4d69-a492-b6122d774b7f",
                "httpsEnable": true,
                "authorityEnable": false,
                "diskEncrypted": false,
                "cmkId": "",
                "actionProgress": {},
                "actions": [],
                "tags": []
            },
            {
                "datastore": {
                    "type": "elasticsearch",
                    "version": "7.6.2"
                },
                "instances": [
                    {
                        "status": "303",
                        "type": "ess",
                        "id": "071c7ecf-a11d-45bd-9564-201ceb7cfae3",
                        "name": "css-9b36-ess-esn-1-1",
                        "specCode": "css.xlarge.2",
                        "azCode": "eu-de-01"
                    }
                ],
                "updated": "2020-11-13T14:33:24",
                "name": "css-9b36",
                "created": "2020-11-13T14:33:26",
                "id": "cdb26954-c743-47dd-b23a-b693205eb2da",
                "status": "303",
                "endpoint": null,
                "vpcId": "e7daa617-3ee6-4ff1-b042-8cda4a006a46",
                "subnetId": "6253dc44-24cd-4c0a-90b3-f965e7f4dcd4",
                "securityGroupId": "d478041e-bcbe-4d69-a492-b6122d774b7f",
                "httpsEnable": true,
                "authorityEnable": true,
                "diskEncrypted": false,
                "cmkId": "",
                "actionProgress": {},
                "actions": [],
                "tags": []
            }
        ]
    }
    

Status Code

Table 8 describes the status code.

Table 8 Status codes

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.