Terminates up to 50 jobs in a job queue¶
Description¶
Terminates up to 50 jobs in a job queue. This is a bulk version of terminate_job. Jobs that are in the STARTING or RUNNING state are terminated, which causes them to transition to FAILED. Jobs that have not progressed to the STARTING state are cancelled.
Batch reports the result for each job individually in the response. Jobs that were processed successfully are reported in the successful list. Jobs that encountered errors are reported in the errors list. The response returns an HTTP status code of 200 even when some jobs encountered errors, so check the errors list. Jobs that can't be found are treated as successfully processed.
This operation requires batch:TerminateJob permission for each job in the request. There is no separate batch:TerminateJobs IAM action. If a caller's IAM policy grants batch:TerminateJob, they can use both the singular terminate_job and bulk terminate_jobs operations.
Usage¶
Arguments¶
jobs
[required] An array of up to 50 Batch job IDs of the jobs to terminate.
reason
[required] A message to attach to the job that explains the reason for terminating it. This message is returned by future describe_jobs operations on the job. It is also recorded in the Batch activity logs.
This parameter has a limit of 1024 characters.
Value¶
A list with the following syntax:
list(
successful = list(
"string"
),
errors = list(
list(
job = "string",
code = "string",
message = "string"
)
)
)