
# 查询边缘集群列表
#### 功能介绍
应用服务器可调用此接口查询边缘集群列表。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IoTEdge/doc?api=ListClustersV3)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### URI
GET /v3/{project_id}/clusters
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                        |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID。获取方法请参见 [获取项目ID](https://support.huaweicloud.com/api-iotedge/iotedge_api_0032.html)。 |
   
表2Query参数 
| 参数           | 是否必选 | 参数类型             | 描述                        |
|:---|:---|:---|:---|
| cluster_name | 否    | String           | 边缘集群名称                    |
| state        | 否    | String           | 边缘集群状态                    |
| cluster_ids  | 否    | Array of strings | 边缘集群ID列表                  |
| limit        | 否    | Integer          | 每页记录数，默认值为10，取值区间为1-1000。 |
| offset       | 否    | Integer          | 查询的起始位置，取值范围为非负整数，默认为0。   |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                         |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务 [获取IAM用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)接口获取，接口返回的响应消息头中"X-Subject-Token"就是需要获取的用户Token。简要的获取方法样例请参见 [Token认证](https://support.huaweicloud.com/api-iothub/iot_06_v5_0091.html#section0)。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数        | 参数类型                                                                                                                                               | 描述    |
|:---|:---|:---|
| count     | Integer                                                                                                                                            | 总记录数  |
| page_info | [PageInfoDTO] object                                             | 分页信息  |
| clusters  | Array of [QueryClusterBriefResponseDTO] objects | 每页记录数 |
   
 表5PageInfoDTO 
| 参数     | 参数类型    | 描述    |
|:---|:---|:---|
| offset | Integer | 页码    |
| limit  | Integer | 每页记录数 |
   
 表6QueryClusterBriefResponseDTO 
| 参数             | 参数类型    | 描述       |
|:---|:---|:---|
| cluster_id     | String  | 集群ID     |
| cluster_name   | String  | 集群名称     |
| description    | String  | 集群描述     |
| version        | String  | 边缘集群版本   |
| state          | String  | 边缘集群状态   |
| is_upgradeable | Boolean | 是否可升级    |
| cluster_type   | String  | 集群类型     |
| cluster_addr   | String  | 集群地址     |
| create_time    | String  | 创建时间     |
| update_time    | String  | 最后一次修改时间 |
   
#### 请求示例
```
GET https://{endpoint}/v2/{project_id}/clusters
```
#### 响应示例
**状态码：200**
OK
```
{
  "count" : 1000000,
  "page_info" : {
    "offset" : 1000000,
    "limit" : 1000
  },
  "clusters" : [ {
    "cluster_id" : "123343534",
    "cluster_name" : "test-cluster",
    "description" : "this is a test cluster",
    "version" : "string",
    "state" : "string",
    "is_upgradeable" : true,
    "cluster_type" : "IoTEdge",
    "create_time" : "string",
    "update_time" : "string"
  } ]
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 400 | BAD REQUEST           |
| 401 | Unauthorized          |
| 403 | FORBIDDEN             |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-iotedge/ErrorCode.html)。
