Cancels a job in an AWS Batch job queue. Jobs that are in the
SUBMITTED
, PENDING
, or RUNNABLE
state are cancelled. Jobs that
have progressed to STARTING
or RUNNING
are not cancelled (but the
API operation still succeeds, even if no job is cancelled); these jobs
must be terminated with the TerminateJob operation.
batch_cancel_job(jobId, reason)
[required] The AWS Batch job ID of the job to cancel.
[required] A message to attach to the job that explains the reason for canceling it. This message is returned by future DescribeJobs operations on the job. This message is also recorded in the AWS Batch activity logs.
svc$cancel_job( jobId = "string", reason = "string" )
# NOT RUN {
# This example cancels a job with the specified job ID.
# }
# NOT RUN {
svc$cancel_job(
jobId = "1d828f65-7a4d-42e8-996d-3b900ed59dc4",
reason = "Cancelling job."
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab