terminateJobs

Terminates up to 50 jobs in a job queue. This is a bulk version of TerminateJob. 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.

Samples

// This example terminates the jobs with the specified job IDs.
val resp = batchClient.terminateJobs {
    jobs = listOf<String>(
        "61e743ed-35e4-48da-b2de-5c8333821c84",
        "b3d0f26e-6d3a-4a5b-9c2e-7f4a1b2c3d4e"
    )
    reason = "Terminating jobs."
}