

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

# getClusterStack活动
<a name="get-cluster-stack-events"></a>

检索与集群的堆栈关联的事件。

**注意**  
从 3.6.0 版开始， Amazon ParallelCluster 使用嵌套堆栈来创建与队列和计算资源关联的资源。`GetClusterStackEvents` API 和 `pcluster get-cluster-stack-events` 命令仅返回集群主堆栈事件。您可以在 CloudFormation 控制台中查看集群堆栈事件，包括与队列和计算资源相关的事件。

**Topics**
+ [请求语法](#get-cluster-stack-events-request)
+ [请求正文](#get-cluster-stack-events-request-body)
+ [响应语法](#get-cluster-stack-events-response)
+ [响应正文](#get-cluster-stack-events-response-body)
+ [示例](#get-cluster-stack-events-example)

## 请求语法
<a name="get-cluster-stack-events-request"></a>

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

## 请求正文
<a name="get-cluster-stack-events-request-body"></a>

**clusterName**  
集群的名称。  
类型：字符串。  
必需：是

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

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

## 响应语法
<a name="get-cluster-stack-events-response"></a>

```
{
  "nextToken": "string",
  "events": [
    {
      "stackId": "string",
      "eventId": "string",
      "stackName": "string",
      "logicalResourceId": "string",
      "physicalResourceId": "string",
      "resourceType": "string",
      "timestamp": "2019-08-24T14:15:22Z",
      "resourceStatus": "CREATE_IN_PROGRESS",
      "resourceStatusReason": "string",
      "resourceProperties": "string",
      "clientRequestToken": "string"
    }
  ]
}
```

## 响应正文
<a name="get-cluster-stack-events-response-body"></a>

**events**  
筛选的事件的列表。    
**clientRequestToken**  
传递给生成此事件的操作的令牌。  
类型：字符串  
**eventId**  
此事件的唯一 ID。  
类型：字符串  
**logicalResourceId**  
模板中指定资源的逻辑名称。  
类型：字符串  
**physicalResourceId**  
与资源的物理实例关联的名称或唯一标识符。  
类型：字符串  
**resourceProperties**  
用于创建资源的属性的 BLOB。  
类型：字符串  
**resourceStatus**  
资源状态。  
类型：字符串  
有效值：`CREATE_IN_PROGRESS | CREATE_FAILED | CREATE_COMPLETE | DELETE_IN_PROGRESS | DELETE_FAILED | DELETE_COMPLETE | DELETE_SKIPPED | UPDATE_IN_PROGRESS | UPDATE_FAILED | UPDATE_COMPLETE | IMPORT_FAILED | IMPORT_COMPLETE | IMPORT_IN_PROGRESS | IMPORT_ROLLBACK_IN_PROGRESS | IMPORT_ROLLBACK_FAILED | IMPORT_ROLLBACK_COMPLETE`  
**resourceStatusReason**  
与资源关联的成功或失败消息。  
类型：字符串  
**resourceType**  
资源的类型。  
类型：字符串  
**stackId**  
堆栈实例的唯一 ID 名称。  
类型：字符串  
**stackName**  
与堆栈关联的名称。  
类型：字符串  
**timestamp**  
上次更新状态的时间。  
类型：日期时间

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

## 示例
<a name="get-cluster-stack-events-example"></a>

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

**请求**

```
$ get_cluster_stack_events({{cluster_name_3x}})
```

**200 响应**

```
{
  "events": [
    {
      "event_id": "590b3820-b081-11ec-985e-0a7af5751497",
      "logical_resource_id": "cluster_name_3x",
      "physical_resource_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/cluster_name_3x/11a59710-b080-11ec-b8bd-129def1380e9",
      "resource_status": "CREATE_COMPLETE",
      "resource_type": "AWS::CloudFormation::Stack",
      "stack_id": "arn:aws:cloudformation:us-east-1:123456789012:stack/cluster_name_3x/11a59710-b080-11ec-b8bd-129def1380e9",
      "stack_name": "cluster_name_3x",
      "timestamp": datetime.datetime(2022, 3, 30, 23, 30, 13, 268000, tzinfo=tzlocal())
    },
    ...
  ]
}
```

------