Querying Cluster Details
Function
This API is used to query cluster details.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v1.1/{project_id}/clusters/{cluster_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain it, see Project ID and Account ID. |
| cluster_id | Yes | String | Cluster ID. For details about how to obtain this ID, see Querying the Cluster List. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. This parameter is mandatory when Token Authentication is used. You can obtain it from the X-Subject-Token header in the response of the "Obtaining a User Token" API provided by IAM. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| publicEndpoint | String | EIP bound to the cluster |
| instances | Array of ClusterDetailInstance objects | Cluster node information. |
| security_group_id | String | Security group ID. |
| subnet_id | String | Subnet ID. |
| vpc_id | String | VPC ID |
| customerConfig | CustomerConfig object | User configuration |
| datastore | Datastore object | CDM information |
| isAutoOff | Boolean | Automatic shutdown |
| publicEndpointDomainName | String | Domain name for the EIP bound to the cluster |
| bakExpectedStartTime | String | Start time |
| bakKeepDay | Integer | Retention period |
| maintainWindow | maintainWindow object | Maintenance window |
| recentEvent | Integer | Number of events |
| flavorName | String | Flavor name |
| azName | String | AZ name |
| endpointDomainName | String | Peer domain name |
| publicEndpointStatus | publicEndpointStatus object | EIP status |
| isScheduleBootOff | Boolean | Whether to enable scheduled startup/shutdown. The scheduled startup/shutdown and auto shutdown functions cannot be enabled at the same time. |
| namespace | String | Namespace |
| eipId | String | EIP ID. |
| failedReasons | FailedReasons object | Failure cause. If this parameter is left empty, the cluster is in normal state. |
| dbuser | String | Database user |
| links | Array of ClusterLinks objects | Cluster link information |
| clusterMode | String | Cluster mode. Fixed value: sharding (sharded cluster). |
| task | ClusterTask object | Task information |
| created | String | Cluster creation time in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ |
| statusDetail | String | Cluster status description. Options: |
| config_status | String | Cluster configuration status. |
| actionProgress | ActionProgress object | Cluster operation progress, which consists of a key and a value. The key indicates an ongoing task, and the value indicates the progress of the ongoing task. An example is "action_progress":{"SNAPSHOTTING":"16%"}. |
| name | String | Cluster name |
| id | String | Cluster ID |
| isFrozen | String | Whether the cluster is frozen. Options: |
| actions | Array of strings | Cluster configuration status. Options: |
| updated | String | Cluster update time in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ |
| status | String | Cluster status. The options are as follows: |
| Parameter | Type | Description |
|---|---|---|
| flavor | flavor object | VM specifications of the node. The value is null when listing clusters. |
| volume | volume object | Disk information of the node. The value is null when listing clusters. |
| status | String | Node status |
| actions | Array of strings | Node operation status |
| type | String | Node type. Currently, only cdm is available. |
| id | String | Node VM ID |
| name | String | Name of the VM on the node |
| isFrozen | String | Whether the node is frozen. Options: |
| components | String | Cluster component list. This field is deprecated and fixed to an empty value. |
| config_status | String | Node configuration status. The value is null when the cluster list is queried. |
| role | String | Instance role |
| group | String | Group |
| links | Array of ClusterLinks objects | Links (null is returned for querying the cluster list) |
| paramsGroupId | String | Component group ID. |
| publicIp | String | Public IP address |
| manageIp | String | Management IP address |
| trafficIp | String | Traffic IP address |
| shard_id | String | Shard ID. |
| manage_fix_ip | String | Management fix IP address |
| private_ip | String | Private IP address |
| internal_ip | String | Internal IP address |
| resource | Array of Resource objects | Resource information (null is returned for querying the cluster list) |
| Parameter | Type | Description |
|---|---|---|
| id | String | VM flavor ID |
| links | Array of ClusterLinks objects | Links |
| Parameter | Type | Description |
|---|---|---|
| type | String | Disk type of the node. Only local disks are supported. The actual return value is empty or LOCAL_DISK. |
| size | Long | Size of the disk on the node (GB) |
| Parameter | Type | Description |
|---|---|---|
| resource_id | String | Resource ID. |
| resource_type | String | Resource type. Fixed value: server. |
| Parameter | Type | Description |
|---|---|---|
| failureRemind | String | Failure notification |
| clusterName | String | Cluster type |
| serviceProvider | String | Service provider |
| localDisk | String | Whether the disk is a local disk |
| ssl | String | Whether to enable SSL |
| createFrom | String | Source |
| resourceId | String | Resource ID |
| flavorType | String | Flavor type. Common flavor types are as follows: |
| workSpaceId | String | Workspace ID |
| trial | String | Whether the cluster is a trial cluster. Options: |
| Parameter | Type | Description |
|---|---|---|
| type | String | Type. Generally, the value is cdm. |
| version | String | Cluster version. For example, 2.9.3.300. |
| Parameter | Type | Description |
|---|---|---|
| day | String | Day of a week |
| startTime | String | Start time |
| endTime | String | End time |
| Parameter | Type | Description |
|---|---|---|
| status | String | EIP status. An empty value is returned. |
| errorMessage | String | Error message |
| Parameter | Type | Description |
|---|---|---|
| CREATE_FAILED | CREATE_FAILED object | Cause of the cluster creation failure |
| Parameter | Type | Description |
|---|---|---|
| errorCode | String | Error code |
| errorMsg | String | Failure cause |
| Parameter | Type | Description |
|---|---|---|
| description | String | Task description |
| id | String | Task ID. |
| name | String | Task name |
| Parameter | Type | Description |
|---|---|---|
| CREATING | String | Cluster creation progress, for example, 29% |
| GROWING | String | Cluster expansion progress, for example, 29% |
| RESTORING | String | Cluster restoration progress, for example, 29% |
| SNAPSHOTTING | String | Cluster snapshotting progress, for example, 29% |
| REPAIRING | String | Cluster repairing progress, for example, 29% |
Example Requests
GET /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters/bae65496-643e-47ca-84af-948672de7eeb
Example Responses
Status code: 200
Request succeeded.
{
"publicEndpoint" : "49.xx.xx.10",
"instances" : [ {
"flavor" : {
"id" : "fb8fe666-6734-4b11-bc6c-43d11db3c745"
},
"volume" : {
"size" : "100",
"type" : "LOCAL_DISK"
},
"name" : "cdm-c018",
"id" : "635dce67-3df8-4756-b4c7-90e45e687367",
"isFrozen" : "0",
"type" : "cdm",
"actions" : "REBOOTING",
"config_status" : "In-Sync",
"status" : "200"
} ],
"created" : "2018-09-05T08:38:25",
"statusDetail" : "Normal",
"actionProgress" : { },
"name" : "cdm-c018",
"id" : "bae65496-643e-47ca-84af-948672de7eeb",
"isFrozen" : "0",
"actions" : "REBOOTING",
"updated" : "2018-09-05T08:38:25",
"status" : "200"
} SDK Sample Code
The SDK sample code is as follows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.cdm.v1.region.CdmRegion; import com.huaweicloud.sdk.cdm.v1.*; import com.huaweicloud.sdk.cdm.v1.model.*; public class ShowClusterDetailSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); CdmClient client = CdmClient.newBuilder() .withCredential(auth) .withRegion(CdmRegion.valueOf("<YOUR REGION>")) .build(); ShowClusterDetailRequest request = new ShowClusterDetailRequest(); request.withClusterId("{cluster_id}"); try { ShowClusterDetailResponse response = client.showClusterDetail(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcdm.v1.region.cdm_region import CdmRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcdm.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = CdmClient.new_builder() \ .with_credentials(credentials) \ .with_region(CdmRegion.value_of("<YOUR REGION>")) \ .build() try: request = ShowClusterDetailRequest() request.cluster_id = "{cluster_id}" response = client.show_cluster_detail(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" cdm "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdm/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdm/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdm/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth, err := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). SafeBuild() if err != nil { fmt.Println(err) return } hcClient, err := cdm.CdmClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). SafeBuild() if err != nil { fmt.Println(err) return } client := cdm.NewCdmClient(hcClient) request := &model.ShowClusterDetailRequest{} request.ClusterId = "{cluster_id}" response, err := client.ShowClusterDetail(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | Request error. |
| 401 | Authentication failed. |
| 403 | No operation permissions. |
| 404 | No resources found. |
| 500 | Internal service error. For details about the returned error code, see Error Codes. |
| 503 | Service unavailable. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot