

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# listClusters
<a name="list-clusters"></a>

检索现有集群的列表。

**Topics**
+ [请求语法](#list-clusters-request)
+ [请求正文](#list-clusters-request-body)
+ [响应语法](#list-clusters-response)
+ [响应正文](#list-clusters-response-body)
+ [示例](#list-clusters-example)

## 请求语法
<a name="list-clusters-request"></a>

```
GET /v3/clusters
{
  "clusterStatus": "string",
  "nextToken": "string",
  "region": "string"
}
```

## 请求正文
<a name="list-clusters-request-body"></a>

**clusterStatus**  
按集群状态筛选。默认为所有集群。  
类型：字符串  
有效值：`CREATE_IN_PROGRESS | CREATE_FAILED | CREATE_COMPLETE | DELETE_IN_PROGRESS | DELETE_FAILED | UPDATE_IN_PROGRESS | UPDATE_COMPLETE | UPDATE_FAILED`  
必需：否

**nextToken**  
用于获取下一组结果的令牌。  
类型：字符串  
必需：否

**region**  
集 Amazon Web Services 区域 群中的。  
类型：字符串  
必需：否

## 响应语法
<a name="list-clusters-response"></a>

```
{
  "nextToken": "string",
  "clusters": [
    {
      "clusterName": "string",
      "region": "string",
      "version": "string",
      "cloudformationStackArn": "string",
      "cloudformationStackStatus": "CREATE_IN_PROGRESS",
      "clusterStatus": "CREATE_IN_PROGRESS",
      "scheduler": {
        "type": "string",
        "metadata": {
          "name": "string",
          "version": "string"
        }
      }
    }
  ]
}
```

## 响应正文
<a name="list-clusters-response-body"></a>

**clusters**    
**cloudformationStackArn**  
主 CloudFormation 堆栈的亚马逊资源名称 (ARN)。  
类型：字符串  
**cloudformationStackStatus**  
堆 CloudFormation 栈状态。  
类型：字符串  
有效值：`CREATE_IN_PROGRESS | CREATE_FAILED | CREATE_COMPLETE | ROLLBACK_IN_PROGRESS | ROLLBACK_FAILED | ROLLBACK_COMPLETE | DELETE_IN_PROGRESS | DELETE_FAILED | DELETE_COMPLETE | UPDATE_IN_PROGRESS | UPDATE_COMPLETE_CLEANUP_IN_PROGRESS | UPDATE_COMPLETE | UPDATE_ROLLBACK_IN_PROGRESS | UPDATE_ROLLBACK_FAILED | UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS | UPDATE_ROLLBACK_COMPLETE`  
**clusterName**  
集群的名称。  
类型：字符串  
**clusterStatus**  
集群状态。  
类型：字符串  
有效值：`CREATE_IN_PROGRESS | CREATE_FAILED | CREATE_COMPLETE | DELETE_IN_PROGRESS | DELETE_FAILED | DELETE_COMPLETE | UPDATE_IN_PROGRESS | UPDATE_COMPLETE | UPDATE_FAILED`  
**scheduler**    
**metadata**  
调度器元数据。    
**名称**  
调度器的名称。  
类型：字符串  
**version**  
调度器版本。  
类型：字符串  
**type**  
调度器的类型。  
类型：字符串  
**区域**  
 Amazon Web Services 区域 在其中创建集群。  
类型：字符串  
**version**  
用于创建集群的 Amazon ParallelCluster 版本。  
类型：字符串

**nextToken**  
用于检索下一组结果的令牌，没有更多结果时为 `null`。  
类型：字符串

## 示例
<a name="list-clusters-example"></a>

------
#### [ Python ]

**请求**

```
$ list_clusters()
```

**200 响应**

```
{
  'clusters': 
   [
      {
        'cloudformation_stack_arn': 'arn:aws:cloudformation:us-east-1:123456789012:stack/cluster_name_3x/16b49540-aee5-11ec-8e18-0ac1d712b241',
        'cloudformation_stack_status': 'CREATE_COMPLETE',
        'cluster_name': 'cluster_name_3x',
        'cluster_status': 'CREATE_COMPLETE',
        'region': 'us-east-1',
        'version': '3.2.1'
      },
      ...
   ]
}
```

------