本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
每當現有 (先前提交的) 任務變更狀態時,就會建立事件。如需 AWS Batch 任務狀態的詳細資訊,請參閱 任務狀態。
注意
事件不會為初始任務提交建立。
範例 任務狀態變更事件
任務狀態變更事件會以下列格式交付。detail
本節類似從 AWS Batch API 參考中的 DescribeJobs API 操作傳回的 JobDetail 物件。如需有關 EventBridge 參數的詳細資訊,請參閱 Amazon EventBridge 使用者指南中的事件和事件模式。
{
"version": "0",
"id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
"detail-type": "Batch Job State Change",
"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"
],
"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",
"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": []
}
}