Cancels a job in an Batch job queue¶
Description¶
Cancels a job in an Batch job queue. Jobs that are in a SUBMITTED, PENDING, or RUNNABLE state are cancelled and the job status is updated to FAILED.
A PENDING job is cancelled after all dependency jobs are completed. Therefore, it might take longer than expected to cancel a job in PENDING status.
When you try to cancel an array parent job in PENDING, Batch attempts to cancel all child jobs. The array parent job is cancelled when all child jobs are completed.
Jobs that progressed to the STARTING or RUNNING state aren't cancelled. However, the API operation still succeeds, even if no job is cancelled. These jobs must be terminated with the terminate_job or terminate_jobs operation.
Usage¶
Arguments¶
-
jobId[required] The Batch job ID of the job to cancel.
-
reason[required] A message to attach to the job that explains the reason for cancelling it. This message is returned by future
describe_jobsoperations on the job. It is also recorded in the Batch activity logs.This parameter has a limit of 1024 characters.
Value¶
An empty list.