查询集群详情
功能介绍
该接口用于查询并显示单个集群详情,可以得到集群数据搜索类型、节点对象列表、网络信息、集群名称、集群ID、集群状态等,以便客户检查创建的集群是否符合预期。客户也可以通过登录华为云官网,进入CSS服务,在集群的基本信息页面,可以获取集群的内网访问地址、公网访问地址、版本、节点等信息。
调用方法
请参见如何调用API。
URI
GET /v1.0/{project_id}/clusters/{cluster_id}
请求参数
无
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
datastore |
ClusterDetailDatastore object |
参数解释: 集群数据搜索引擎类型。 取值范围: 不涉及 |
instances |
Array of ClusterDetailInstances objects |
参数解释: 节点对象列表。 取值范围: 不涉及 |
publicKibanaResp |
publicKibanaRespBody object |
参数解释: 公网访问信息,包括IP地址、白名单、宽带信息等。 取值范围:
|
elbWhiteList |
elbWhiteListResp object |
参数解释: Elb公网访问控制信息。 取值范围: 不涉及 |
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,即虚拟私有云ID。 取值范围: 不涉及 |
subnetId |
String |
参数解释: 集群当前的子网。此子网用于新增节点,包括扩容、添加独立Master/Client节点、开启终端节点服务,新增节点将通过当前子网申请IP并绑定。 取值范围: 不涉及 |
securityGroupId |
String |
参数解释: 安全组ID。 取值范围: 不涉及 |
vpcepIp |
String |
参数解释: 终端节点IP。 取值范围: 不涉及 |
vpcepIpv6Address |
String |
参数解释: 终端节点IPv6。 取值范围: 不涉及 |
bandwidthSize |
Integer |
参数解释: 公网带宽大小,单位:Mbit/s。 取值范围: 不涉及 |
httpsEnable |
Boolean |
参数解释: 通信加密状态。 取值范围:
|
diskEncrypted |
Boolean |
参数解释: 磁盘是否加密。 取值范围:
|
authorityEnable |
Boolean |
参数解释: 集群是否开启安全模式认证。 取值范围:
|
backupAvailable |
Boolean |
参数解释: 是否开启快照。 取值范围:
|
actionProgress |
Object |
参数解释: 集群行为进度,显示创建或扩容进度的百分比。 取值范围: 不涉及 |
actions |
Array of strings |
参数解释: 集群当前正在进行的任务列表。 取值范围:
|
enterpriseProjectId |
String |
参数解释: 集群所属的企业项目ID。如果集群所属用户没有开通企业项目,则不会返回该参数。 取值范围: 不涉及 |
tags |
Array of ClusterDetailTags objects |
参数解释: 集群标签。 取值范围: 不涉及 |
failedReason |
ClusterDetailFailedReasons object |
参数解释: 集群变更任务的失败原因。如果集群处于正常状态,则不返回该参数。 取值范围: 不涉及 |
period |
Boolean |
参数解释: 是否为包周期集群。 取值范围:
|
bandwidthResourceId |
String |
参数解释: 公网访问的资源ID。 取值范围: 不涉及 |
ipv6Endpoint |
String |
参数解释: 集群内网访问IPv6地址和端口号。 取值范围: 不涉及 |
supportVpcep |
Boolean |
参数解释: 当前集群是否支持开启终端节点服务。 取值范围:
|
cmkId |
String |
参数解释: 当前集群使用的磁盘加密密钥ID。 取值范围: 不涉及 |
orderId |
String |
参数解释: 包周期集群的订单号。 取值范围: 不涉及 |
currentSubnetIds |
String |
参数解释: 集群当前所有节点用到的子网,如果存在多个(最多支持两个),使用英文逗号隔开。 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
type |
String |
参数解释: 引擎类型。 取值范围:
|
version |
String |
参数解释: 集群引擎版本号。详细请参考CSS使用前必读中支持的版本。 取值范围: 不涉及 |
subVersion |
String |
参数解释: 集群发布版本号。 取值范围: 不涉及 |
isEosCluster |
Boolean |
参数解释: 表示集群发布版本是否EOS。 取值范围:
|
supportSecuritymode |
Boolean |
'参数解释: 集群认证是否支持安全模式。 取值范围:
|
参数 |
参数类型 |
描述 |
---|---|---|
status |
String |
参数解释: 节点状态值。 取值范围:
|
resourceId |
String |
参数解释: 该实例对应的计费资源ID。 取值范围: 不涉及 |
type |
String |
参数解释: 当前节点类型。 取值范围:
|
id |
String |
参数解释: 实例ID。 取值范围: 不涉及 |
name |
String |
参数解释: 实例名字。 取值范围: 不涉及 |
specCode |
String |
参数解释: 节点规格名称。 取值范围: 不涉及 |
azCode |
String |
参数解释: 节点所属可用区信息。 取值范围: 不涉及 |
ip |
String |
参数解释: 实例IP信息。 取值范围: 不涉及 |
volume |
ShowClusterVolumeRsp object |
参数解释: 实例磁盘信息。 取值范围: 不涉及 |
subnetId |
String |
参数解释: 当前节点所属子网ID。 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
type |
String |
参数解释: 实例磁盘类型。 取值范围:
|
size |
Integer |
参数解释: 实例磁盘大小。 取值范围: 不涉及 |
resourceIds |
Array of strings |
参数解释: 该实例拥有的磁盘对应的计费资源ID。 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
eipSize |
Integer |
参数解释: Kibana公网访问或Dashboards公网访问的带宽大小,单位:Mbit/s。 取值范围: 不涉及 |
elbWhiteListResp |
kibanaElbWhiteListResp object |
参数解释: kibana公网访问或Dashboards公网访问控制信息。 取值范围: 不涉及 |
publicKibanaIp |
String |
参数解释: kibana访问或Dashboards访问IP地址。 取值范围: 不涉及 |
bandwidthResourceId |
String |
参数解释: 当前kibana公网或Dashboards对应的资源ID。 取值范围: 不涉及 |
参数 |
参数类型 |
描述 |
---|---|---|
enableWhiteList |
Boolean |
参数解释: 是否开启kibana访问或Dashboards访问控制白名单。 取值范围:
|
whiteList |
String |
参数解释: kibana公网访问或Dashboards公网访问白名单。 取值范围: IP地址。 |
参数 |
参数类型 |
描述 |
---|---|---|
enableWhiteList |
Boolean |
参数解释: 是否开启Elb公网访问控制。设置访问白名单,表示只允许白名单列表中的IP地址访问集群;不设置白名单,所有的IP地址都可以访问集群。 取值范围:
|
whiteList |
String |
参数解释: Elb公网访问白名单。 取值范围: IP地址。 |
请求示例
查询集群详细信息。
GET https://{Endpoint}/v1.0/{project_id}/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}" ] }, "ip": "192.168.0.122", "resourceId": "{RESOURCE_ID}", "subnetId": "{SUBNET_ID}" // 该节点实际使用的子网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}", // 集群使用的VPC ID "subnetId": "{SUBNET_ID}", // 集群所有节点instances正在使用的子网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, "currentSubnetIds":"{SUBNET_ID}" // 集群的默认子网ID,将用在集群节点扩容、创建终端节点等需要选择子网创建新IP地址的场景 }
SDK代码示例
SDK代码示例如下。
Java
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()); } } } |
Python
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) |
Go
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 |
所请求的资源不存在。 建议直接修改该请求,不要重试该请求。 |
错误码
请参见错误码。