terminateJob
inline suspend fun BatchClient.terminateJob(crossinline block: TerminateJobRequest.Builder.() -> Unit): TerminateJobResponse
Terminates a job in a job queue. 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.
Samples
fun main() {
//sampleStart
// This example terminates a job with the specified job ID.
val resp = batchClient.terminateJob {
reason = "Terminating job."
jobId = "61e743ed-35e4-48da-b2de-5c8333821c84"
}
//sampleEnd
}