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
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.
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.
|
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.
|
diskEncrypted | Boolean | Indicates whether disks are 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. |
Parameter | Type | Description |
---|---|---|
type | String | Supported type: elasticsearch |
version | String | Engine version number. |
Parameter | Type | Description |
---|---|---|
type | String | Supported type: ess (indicating the Elasticsearch node) |
id | String | Instance ID. |
name | String | Instance name. |
status | String | Instance status.
|
specCode | String | Node specifications. |
azCode | String | AZ to which a node belongs. |
Parameter | Type | Description |
---|---|---|
error_code | String | Error code.
|
error_msg | String | Detailed error information. |
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.
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. |