

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 服務任務佇列封鎖事件
<a name="batch-service-job-queue-blocked-events"></a>

每當 AWS Batch 偵測到封鎖的佇列時，都會在 Amazon CloudWatch Events 中建立事件。封鎖佇列的原因可在 [https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html) API 動作的 `statusReason` 欄位中取得。

**Example 服務任務佇列封鎖事件**  
服務任務佇列封鎖事件會以下列格式交付。`detail` 區段類似 API *AWS Batch 參考*中 [DescribeServiceJob](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html) API 操作傳回的回應。如需有關 EventBridge 參數的詳細資訊，請參閱 *Amazon EventBridge 使用者指南*中的[事件和事件模式](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)。  
事件 中不包含 `tags`和 `serviceRequestPayload` 欄位`detail`。

```
{
  "version": "0",
  "id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
  "detail-type": "Batch Service Job Queue Blocked",
  "source": "aws.batch",
  "account": "{{123456789012}}",
  "time": "2022-01-11T23:36:40Z",
  "region": "{{us-east-1}}",
  "resources": [
    "arn:aws:batch:{{us-east-1}}:{{123456789012}}:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8"
  ],
  "detail": {
    "attempts": [],
    "createdAt": 1641944200058,
    "jobArn": "arn:aws:batch:{{us-east-1}}:{{123456789012}}:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
    "jobId": "6271dfdf-d8a7-41b1-a4d2-55a2224f5375",
    "jobName": "event-test",
    "jobQueue": "arn:aws:batch:{{us-east-1}}:{{123456789012}}:job-queue/HappyPathJobQueue",
    "serviceJobType": "SAGEMAKER_TRAINING",
    "status": "RUNNABLE",
    "statusReason": "{{blocked-reason}}",
    "timeoutConfig": {
      "attemptDurationSeconds": 60
    }
  }
}
```