本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
資源:任務佇列封鎖事件
每當 AWS Batch 偵測到任務處於 RUNNABLE
狀態,因而封鎖佇列時,都會在 Amazon CloudWatch Events 中建立事件。如需支援的封鎖佇列原因的詳細資訊,請參閱 任務卡在 RUNNABLE 狀態。DescribeJobs
API 動作中的 statusReason
欄位也提供相同的原因。
範例 任務狀態變更事件
任務狀態變更事件會以下列格式交付。detail
區段類似於AWS Batch API參考 中從DescribeJobsAPI操作傳回的JobDetail物件。如需參數的詳細資訊 EventBridge,請參閱 Amazon EventBridge 使用者指南 中的事件和事件模式。
{
"version": "0",
"id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
"detail-type": "Batch 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:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
"arn:aws:batch:us-east-1:123456789012:job-queue/PexjEHappyPathCanary2JobQueue"
],
"detail": {
"jobArn": "arn:aws:batch:us-east-1:123456789012:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
"jobName": "event-test",
"jobId": "4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
"jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/PexjEHappyPathCanary2JobQueue",
"status": "RUNNABLE",
"statusReason": "blocked-reason
"
"attempts": [],
"createdAt": 1641944200058,
"retryStrategy": {
"attempts": 2,
"evaluateOnExit": []
},
"dependsOn": [],
"jobDefinition": "arn:aws:batch:us-east-1:123456789012:job-definition/first-run-job-definition:1",
"parameters": {},
"container": {
"image": "137112412989.dkr.ecr.us-east-1.amazonaws.com/amazonlinux:latest",
"command": [
"sleep",
"600"
],
"volumes": [],
"environment": [],
"mountPoints": [],
"ulimits": [],
"networkInterfaces": [],
"resourceRequirements": [
{
"value": "2",
"type": "VCPU"
}, {
"value": "256",
"type": "MEMORY"
}
],
"secrets": []
},
"tags": {
"resourceArn": "arn:aws:batch:us-east-1:123456789012:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8"
},
"propagateTags": false,
"platformCapabilities": []
}
}