查询集群详情
功能介绍
该接口用于查询并显示单个集群详情。
调用方法
请参见如何调用API。
URI
GET /v1.0/{project_id}/clusters/{cluster_id}
请求参数
无
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
datastore |
ClusterDetailDatastore object |
参数解释: 数据搜索引擎类型。 |
instances |
Array of ClusterDetailInstances objects |
参数解释: 节点对象列表。 |
publicKibanaResp |
publicKibanaRespBody object |
参数解释: Kibana公网访问信息。 |
elbWhiteList |
elbWhiteListResp object |
参数解释: 公网访问控制信息。 |
updated |
String |
参数解释: 集群上次修改时间,格式为ISO8601: CCYY-MM-DDThh:mm:ss。 |
name |
String |
参数解释: 集群名称。 |
publicIp |
String |
参数解释: 公网IP和端口信息。 |
created |
String |
参数解释: 集群创建时间,格式为ISO8601: CCYY-MM-DDThh:mm:ss。 |
id |
String |
参数解释: 集群ID。 |
status |
String |
参数解释: 集群状态值。 取值范围:
|
endpoint |
String |
参数解释: 集群内网访问IPv4地址和端口号。 |
vpcId |
String |
参数解释: VPC ID。 |
subnetId |
String |
参数解释: 子网ID。 |
securityGroupId |
String |
参数解释: 安全组ID。 |
vpcepIp |
String |
参数解释: 终端节点IP。 |
vpcepIpv6Address |
String |
参数解释: 终端节点IPv6。 |
bandwidthSize |
Integer |
参数解释: 公网带宽大小。单位:Mbit/s |
httpsEnable |
Boolean |
参数解释: 通信加密状态。 取值范围:
|
diskEncrypted |
Boolean |
参数解释: 磁盘是否加密。 取值范围:
|
authorityEnable |
Boolean |
参数解释: 是否开启认证,取值范围为true或false。默认关闭认证功能。 取值范围:
|
backupAvailable |
Boolean |
参数解释: 快照是否开启。 取值范围:
|
actionProgress |
Object |
参数解释: 集群行为进度,显示创建或扩容进度的百分比。 |
actions |
Array of strings |
参数解释: 集群当前行为。REBOOTING表示重启、GROWING表示扩容、RESTORING表示恢复集群、SNAPSHOTTING表示创建快照等。 |
enterpriseProjectId |
String |
参数解释: 集群所属的企业项目ID。 如果集群所属用户没有开通企业项目,则不会返回该参数。 |
tags |
Array of ClusterDetailTags objects |
参数解释: 集群标签。 |
failedReason |
ClusterDetailFailedReasons object |
参数解释: 失败原因。如果集群处于正常状态,则不返回该参数。 |
period |
Boolean |
参数解释: 是否为包周期集群。 取值范围:
|
bandwidthResourceId |
String |
参数解释: 公网访问的资源id。 |
ipv6Endpoint |
String |
参数解释: 集群内网访问IPv6地址和端口号。 |
supportVpcep |
Boolean |
参数解释: 当前集群是否支持开启终端节点服务。 |
参数 |
参数类型 |
描述 |
---|---|---|
type |
String |
参数解释: 引擎类型。 取值范围: elasticsearch、logstash和opensearch。 |
version |
String |
参数解释: CSS集群引擎版本号。详细请参考CSS使用前必读中支持的版本。 |
subVersion |
String |
参数解释: 集群镜像发布版本号。 |
isEosCluster |
Boolean |
参数解释: 表示集群镜像发布版本是否EOS。 取值范围: true表示过期,false表示不过期。 |
参数 |
参数类型 |
描述 |
---|---|---|
status |
String |
参数解释: 节点状态值。 取值范围:
|
resourceId |
String |
参数解释: 该实例对应的资源Id。 |
type |
String |
参数解释: 当前节点的类型。 |
id |
String |
参数解释: 实例ID。 |
name |
String |
参数解释: 实例名字。 |
specCode |
String |
参数解释: 节点规格名称。 |
azCode |
String |
参数解释: 节点所属AZ信息。 |
privateIp |
String |
参数解释: 实例ip信息。 |
volume |
ShowClusterVolumeRsp object |
参数解释: 实例磁盘信息。 |
参数 |
参数类型 |
描述 |
---|---|---|
type |
String |
参数解释: 实例磁盘类型。 |
size |
Integer |
参数解释: 实例磁盘大小。 |
resourceIds |
Array of strings |
参数解释: 该实例拥有的磁盘对应的资源Id。 |
参数 |
参数类型 |
描述 |
---|---|---|
eipSize |
Integer |
带宽大小。单位:Mbit/s |
elbWhiteListResp |
kibanaElbWhiteListResp object |
参数解释: kibana公网访问控制信息。 |
publicKibanaIp |
String |
参数解释: kibana访问IP。 |
bandwidthResourceId |
String |
参数解释: 当前kibana公网对应的资源Id。 |
参数 |
参数类型 |
描述 |
---|---|---|
enableWhiteList |
Boolean |
是否开启kibana访问控制。 取值范围:
|
whiteList |
String |
参数解释: kibana公网访问白名单。 |
请求示例
查询集群详细信息。
GET https://{Endpoint}/v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/5c2bab0d-ec5f-491f-9418-b8da38a26760
响应示例
状态码: 200
请求已成功。
{ "datastore" : { "type" : "elasticsearch", "version" : "7.10.2", "subVersion" : "7.10.2_24.3.0_0827", "isEosCluster" : false, "supportSecuritymode" : false }, "instances" : [ { "status" : "200", "type" : "ess", "id" : "{INSTANCE_ID}", "name" : "css-8bc5-ess-esn-1-1", "specCode" : "ess.spec-4u8g", "azCode" : "{AZ_CODE}", "volume" : { "type" : "ULTRAHIGH", "size" : 40, "resourceIds" : [ "{RESOURCE_ID}" ] }, "privateIp" : "192.168.0.122", "resourceId" : "{RESOURCE_ID}" } ], "publicKibanaResp" : { "eipSize" : 10, "publicKibanaIp" : "100.95.152.28", "elbWhiteListResp" : null, "bandwidthResourceId" : "18bec13f-5cc1-4631-867f-33505d15be12" }, "elbWhiteList" : { "whiteList" : "", "enableWhiteList" : false }, "updated" : "2023-10-09T02:07:13", "name" : "css-8bc5", "publicIp" : "100.85.222.202", "created" : "2023-10-09T02:07:13", "id" : "{CLUSTER_ID}", "status" : "200", "endpoint" : "192.168.0.122:9200", "vpcId" : "{VPC_ID}", "subnetId" : "{SUBNET_ID}", "securityGroupId" : "{SECURITY_GROUP_ID}", "bandwidthResourceId" : "{BANDWIDTH_RESOURCE_ID}", "bandwidthSize" : 3, "httpsEnable" : true, "authorityEnable" : true, "diskEncrypted" : false, "backupAvailable" : false, "actionProgress" : { }, "actions" : [ ], "enterpriseProjectId" : "0", "tags" : [ ], "period" : true, "supportVpcep" : true }
SDK代码示例
SDK代码示例如下。
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.css.v1.region.CssRegion; import com.huaweicloud.sdk.css.v1.*; import com.huaweicloud.sdk.css.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); CssClient client = CssClient.newBuilder() .withCredential(auth) .withRegion(CssRegion.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 huaweicloudsdkcss.v1.region.css_region import CssRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcss.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 = CssClient.new_builder() \ .with_credentials(credentials) \ .with_region(CssRegion.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 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" css "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/css/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/css/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/css/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 := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := css.NewCssClient( css.CssClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ShowClusterDetailRequest{} request.ClusterId = "{cluster_id}" response, err := client.ShowClusterDetail(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
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.css.v1.region.CssRegion; import com.huaweicloud.sdk.css.v1.*; import com.huaweicloud.sdk.css.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); CssClient client = CssClient.newBuilder() .withCredential(auth) .withRegion(CssRegion.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 huaweicloudsdkcss.v1.region.css_region import CssRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcss.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 = CssClient.new_builder() \ .with_credentials(credentials) \ .with_region(CssRegion.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 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" css "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/css/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/css/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/css/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 := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := css.NewCssClient( css.CssClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ShowClusterDetailRequest{} request.ClusterId = "{cluster_id}" response, err := client.ShowClusterDetail(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
请求已成功。 |
400 |
非法请求。 建议直接修改该请求,不要重试该请求。 |
404 |
所请求的资源不存在。 建议直接修改该请求,不要重试该请求。 |
错误码
请参见错误码。