def _get_task_statuses(task_ids):
 response = client.describe_tasks(tasks=task_ids)
 if (response['failures'] != []):
  raise Exception('There were some failures:\n{0}'.format(response['failures']))
 status_code = response['ResponseMetadata']['HTTPStatusCode']
 if (status_code != 200):
  msg = 'Task status request received status code {0}:\n{1}'
  raise Exception(msg.format(status_code, response))
 return [t['lastStatus'] for t in response['tasks']]

def _get_task_statuses ( task_ids ) : response = client . describe_tasks ( tasks = task_ids ) if ( response [ 'failures' ] != [ ] ) : raise Exception ( 'There were some failures:\n{0}' . format ( response [ 'failures' ] ) ) status_code = response [ 'ResponseMetadata' ] [ 'HTTPStatusCode' ] if ( status_code != 200 ) : msg = 'Task status request received status code {0}:\n{1}' raise Exception ( msg . format ( status_code , response ) ) return [ t [ 'lastStatus' ] for t in response [ 'tasks' ] ]
retrieve task statuses from ecs api returns list of {running|pending|stopped} for each id in task_ids .