'Ansible Tower/AWX - get pending hosts

I have a playbook that that runs maintenance on multiple hosts. I am using the AWX API to monitor the status of the job. The same script will cancel the job after a given timeout.

Question: How can I get a listing of hosts that are still running as I would like to generate an incident/alert that will include the slow servers prior to terminating the job. Note: I tried using "/api/v2/jobs/{id}/job_host_summaries/" which is used to List Job Host Summaries for a Job. This however is only updated once the job is complete. Any one have a quick way to get a list of hosts that are still running?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source