listJobs

inline suspend fun BatchClient.listJobs(crossinline block: ListJobsRequest.Builder.() -> Unit): ListJobsResponse

Returns a list of Batch jobs.

You must specify only one of the following items:

  • A job queue ID to return a list of jobs in that job queue

  • A multi-node parallel job ID to return a list of nodes for that job

  • An array job ID to return a list of the children for that job

You can filter the results by job status with the jobStatus parameter. If you don't specify a status, only RUNNING jobs are returned.

Samples


fun main() { 
   //sampleStart 
   // This example lists the running jobs in the HighPriority job queue.
val resp = batchClient.listJobs {
    jobQueue = "HighPriority"
} 
   //sampleEnd
}

fun main() { 
   //sampleStart 
   // This example lists jobs in the HighPriority job queue that are in the SUBMITTED job status.
val resp = batchClient.listJobs {
    jobQueue = "HighPriority"
    jobStatus = JobStatus.fromValue("SUBMITTED")
} 
   //sampleEnd
}