terminateServiceJobs

Terminates up to 50 service jobs in a job queue. This is a bulk version of TerminateServiceJob.

Batch reports the result for each service job individually in the response. Service jobs that were processed successfully are reported in the successful list. Service jobs that encountered errors are reported in the errors list. The response returns an HTTP status code of 200 even when some service jobs encountered errors, so check the errors list. Service jobs that can't be found are treated as successfully processed.

This operation requires batch:TerminateServiceJob permission for each service job in the request. There is no separate batch:TerminateServiceJobs IAM action. If a caller's IAM policy grants batch:TerminateServiceJob, they can use both the singular TerminateServiceJob and bulk TerminateServiceJobs operations.

Samples

// This example terminates the specified service jobs with a reason.
val resp = batchClient.terminateServiceJobs {
    jobs = listOf<String>(
        "a4d6c728-8ee8-4c65-8e2a-9a5e8f4b7c3d",
        "b3d0f26e-6d3a-4a5b-9c2e-7f4a1b2c3d4e"
    )
    reason = "Job terminated by user request"
}