
# 查询集群详情 - ShowClusterDetail
#### 功能介绍
查询集群详情接口。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-dataartsstudio/making_request.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-dataartsstudio/abcd.html)。
- 如果使用身份策略授权，当前API调用无需身份策略权限。
 
#### URI
GET /v1.1/{project_id}/clusters/{cluster_id}
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                    |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID，获取方法请参见[项目ID和账号ID](https://support.huaweicloud.com/api-dataartsstudio/projectid_accountid.html)。 |
| cluster_id | 是    | String | 集群ID，获取方法请参见[获取集群列表](https://support.huaweicloud.com/api-dataartsstudio/ListClusters.html)。           |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                       |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token，使用[Token认证](https://support.huaweicloud.com/api-dataartsstudio/dataartsstudio_02_0010.html)时必选。通过调用IAM服务的"获取用户Token"接口获取响应消息头中X-Subject-Token的值。 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数                       | 参数类型                                                                                         | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|
| publicEndpoint           | String                                                                                       | 集群绑定的EIP。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| instances                | Array of [ClusterDetailInstance] objects | 集群的节点信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| security_group_id        | String                                                                                       | 安全组ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| subnet_id                | String                                                                                       | 子网ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| vpc_id                   | String                                                                                       | 虚拟私有云ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| customerConfig           | [CustomerConfig] object                         | 用户配置信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| datastore                | [Datastore] object                                   | cdm信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| isAutoOff                | Boolean                                                                                      | 自动关机。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| publicEndpointDomainName | String                                                                                       | 集群绑定的EIP域名。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| bakExpectedStartTime     | String                                                                                       | 开始时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| bakKeepDay               | Integer                                                                                      | 保留时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| maintainWindow           | [maintainWindow] object                         | 维护窗口。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| recentEvent              | Integer                                                                                      | 事件数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| flavorName               | String                                                                                       | 规格名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| azName                   | String                                                                                       | az名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| endpointDomainName       | String                                                                                       | 对端域名。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| publicEndpointStatus     | [publicEndpointStatus] object             | EIP状态信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| isScheduleBootOff        | Boolean                                                                                      | 选择是否启用定时开关机功能。定时开关机功能和自动关机功能不可同时开启。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| namespace                | String                                                                                       | 命名空间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| eipId                    | String                                                                                       | 弹性ip ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| failedReasons            | [FailedReasons] object                           | 失败原因。集群处于正常状态时不返回。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| dbuser                   | String                                                                                       | 数据库用户。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| links                    | Array of [ClusterLinks] objects                   | 集群连接信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| clusterMode              | String                                                                                       | 集群模式。当前为固定值sharding（分片集群）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| task                     | [ClusterTask] object                               | 任务信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| created                  | String                                                                                       | 集群创建时间，格式为ISO8601：YYYY-MM-DDThh:mm:ssZ。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| statusDetail             | String                                                                                       | 集群状态描述： - Normal：正常。   - ReadOnly：只读。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| config_status            | String                                                                                       | 集群配置状态： - In-Sync：配置已同步。   - Applying：配置中。   - Sync-Failure：配置失败。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| actionProgress           | [ActionProgress] object                         | 集群操作进度，任务信息，由key、value组成。key值为正在进行的任务，value值为正在进行任务的进度。示例如 "action_progress":{"SNAPSHOTTING":"16%"}。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| name                     | String                                                                                       | 集群名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| id                       | String                                                                                       | 集群ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| isFrozen                 | String                                                                                       | 集群是否冻结： - 0：否。   - 1：是。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| actions                  | Array of strings                                                                             | 集群配置状态： - In-Sync：配置已同步。   - Applying：配置中。   - Sync-Failure：配置失败。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| updated                  | String                                                                                       | 集群更新时间，格式为 ISO8601：YYYY-MM-DDThh:mm:ssZ。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| status                   | String                                                                                       | 集群状态： - 100：创建中。   - 200：正常。   - 300：失败。   - 303：创建失败。   - 800：冻结。   - 900：已关机。   - 910：正在关机。   - 920：正在开机。    |
   
 表4ClusterDetailInstance 
| 参数            | 参数类型                                                                       | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|
| flavor        | [flavor] object                       | 节点的虚拟机规格（查询集群列表时返回值为null）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| volume        | [volume] object                       | 节点的磁盘信息（查询集群列表时返回值为null）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| status        | String                                                                     | 节点状态： - 100：创建中。   - 200：正常。   - 300：失败。   - 303：创建失败。   - 400：已删除。   - 800：冻结。    |
| actions       | Array of strings                                                           | 节点操作状态列表： - REBOOTING：重启中。   - RESTORING：恢复中。   - REBOOT_FAILURE：重启失败。                                                                                                                                                                                                                                                                                                                                                                                                                |
| type          | String                                                                     | 节点类型，只支持一种类型"cdm"。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| id            | String                                                                     | 节点的虚拟机ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| name          | String                                                                     | 节点的虚拟机名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| isFrozen      | String                                                                     | 节点是否冻结： - 0：否。   - 1：是。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| components    | String                                                                     | 集群组件列表。已废弃，该字段固定为空值。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| config_status | String                                                                     | 节点配置状态（查询集群列表时为null）： - In-Sync：配置已同步。   - Applying：配置中。   - Sync-Failure：配置失败。                                                                                                                                                                                                                                                                                                                                                                                                       |
| role          | String                                                                     | 实例角色。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| group         | String                                                                     | 分组。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| links         | Array of [ClusterLinks] objects | 链接信息（查询集群列表时返回值为null）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| paramsGroupId | String                                                                     | 组件分组ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| publicIp      | String                                                                     | 公网ip。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| manageIp      | String                                                                     | 管理ip。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| trafficIp     | String                                                                     | 流量ip。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| shard_id      | String                                                                     | 分片ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| manage_fix_ip | String                                                                     | 管理修复ip。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| private_ip    | String                                                                     | 私有ip。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| internal_ip   | String                                                                     | 内部ip。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| resource      | Array of [Resource] objects         | 资源信息（查询集群列表时返回值为null）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   
 表5flavor 
| 参数    | 参数类型                                                                       | 描述          |
|:---|:---|:---|
| id    | String                                                                     | 节点虚拟机的规格ID。 |
| links | Array of [ClusterLinks] objects | 链接信息。       |
   
 表6volume 
| 参数   | 参数类型   | 描述                                  |
|:---|:---|:---|
| type | String | 节点的磁盘类型，只支持本地磁盘，实际返回为空值或LOCAL_DISK。 |
| size | Long   | 节点磁盘大小，单位G。                         |
   
 表7Resource 
| 参数            | 参数类型   | 描述                 |
|:---|:---|:---|
| resource_id   | String | 资源ID。              |
| resource_type | String | 资源类型。当前为固定值server。 |
   
 表8CustomerConfig 
| 参数              | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|
| failureRemind   | String | 失败提醒。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| clusterName     | String | 集群类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| serviceProvider | String | 服务提供。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| localDisk       | String | 是否本地磁盘。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ssl             | String | 是否使用ssl。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| createFrom      | String | 创建来源。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| resourceId      | String | 资源ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| flavorType      | String | 规格类型，常见规格类型如下： - cdm.large：8核CPU、16G内存。   - cdm.xlarge：16核CPU、32G内存。   - cdm.4xlarge：64核CPU、128G内存。    |
| workSpaceId     | String | 工作空间ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| trial           | String | 是否是试用集群： - true：是试用集群。   - false：不是试用集群。                                                                                                                                                                                                |
   
 表9Datastore 
| 参数      | 参数类型   | 描述                 |
|:---|:---|:---|
| type    | String | 类型，一般为cdm。         |
| version | String | 集群版本。如"2.9.3.300"。 |
   
 表10maintainWindow 
| 参数        | 参数类型   | 描述    |
|:---|:---|:---|
| day       | String | 周几。   |
| startTime | String | 开始时间。 |
| endTime   | String | 结束时间。 |
   
 表11publicEndpointStatus 
| 参数           | 参数类型   | 描述             |
|:---|:---|:---|
| status       | String | EIP状态，实际返回为空值。 |
| errorMessage | String | 错误信息。          |
   
 表12FailedReasons 
| 参数            | 参数类型                                                               | 描述        |
|:---|:---|:---|
| CREATE_FAILED | [CREATE_FAILED] object | 集群创建失败原因。 |
   
 表13CREATE_FAILED 
| 参数        | 参数类型   | 描述    |
|:---|:---|:---|
| errorCode | String | 错误码。  |
| errorMsg  | String | 失败原因。 |
   
 表14ClusterLinks 
| 参数   | 参数类型   | 描述    |
|:---|:---|:---|
| rel  | String | 关系。   |
| href | String | 链接地址。 |
   
 表15ClusterTask 
| 参数          | 参数类型   | 描述    |
|:---|:---|:---|
| description | String | 任务描述。 |
| id          | String | 任务ID。 |
| name        | String | 任务名称。 |
   
 表16ActionProgress 
| 参数           | 参数类型   | 描述             |
|:---|:---|:---|
| CREATING     | String | 创建集群进度，例如：29%。 |
| GROWING      | String | 扩容集群进度，例如：29%。 |
| RESTORING    | String | 恢复集群进度，例如：29%。 |
| SNAPSHOTTING | String | 集群快照进度，例如：29%。 |
| REPAIRING    | String | 修复集群进度，例如：29%。 |
   
#### 请求示例
```
GET /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters/bae65496-643e-47ca-84af-948672de7eeb
```
#### 响应示例
**状态码：200**
OK。
```
{
  "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代码示例
SDK代码示例如下。
- [Java]
  ```
  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());
          }
      }
  }
  ```
- [Python]
  ```
  # 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)
  ```
- [Go]
  ```
  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)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/CDM/sdk?api=ShowClusterDetail)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK。                   |
| 400 | 请求错误。                 |
| 401 | 鉴权失败。                 |
| 403 | 没有操作权限。               |
| 404 | 找不到资源。                |
| 500 | 服务内部错误，具体返回错误码请参考错误码。 |
| 503 | 服务不可用。                |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-dataartsstudio/ErrorCode.html)。
