Open dazza-codes opened 3 years ago
See options for https://awscli.amazonaws.com/v2/documentation/api/latest/reference/batch/list-jobs.html
import boto3 client = boto3.client('batch') queue = 'project-queue-prod' query_runnable = client.list_jobs(jobQueue=queue, jobStatus='RUNNABLE') next_token = query_runnable.get('nextToken') job_list = query_runnable['jobSummaryList'] while next_token: query_runnable = client.list_jobs(jobQueue=queue, jobStatus='RUNNABLE', nextToken=next_token) next_token = query_runnable.get('nextToken') job_list.extend(query_runnable['jobSummaryList']) job_names = [r['jobName'] for r in job_list]
See options for https://awscli.amazonaws.com/v2/documentation/api/latest/reference/batch/list-jobs.html