stdout missing from AWX API

1,406 views
Skip to first unread message

Piotr M

unread,
Sep 29, 2017, 1:48:02 AM9/29/17
to AWX Project
Hello

I am trying to get the stdout from the web interface API (I know it is possible to see the stdout on the web API output  on the commercial tower )
The job is fine and went trough with full display , however on the API  I only have the message : 


Job Stdout

GET /api/v2/jobs/623/stdout/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: text/plain ;utf-8
Vary: Accept
X-API-Node: awx
X-API-Time: 0.015s

 stdout capture is missing


When I go to the job link via API :

http://my_awx_machine/api/v1/jobs/623/stdout/?format=txt_download
Or:
http://my_awx_machine/api/v2/jobs/623/stdout/?format=txt_download

I only can see the message:

{"detail":"Not found."}


Does anyone have any idea why this feature does not work in AWX ?
I was looking into settings and I could not find anything related.


Kid Regards
Piotr








Matthew Jones

unread,
Sep 29, 2017, 7:50:20 AM9/29/17
to Piotr M, AWX Project
Unfortunately this is a side effect of our current container layout and it's something that we'll be fixing in the coming weeks. The stdout itself is stored on the awx_task container but you are making requests on the awx_web container. We'll just need to make sure the stdout is available in both places. In the meantime you can see the output on the job detail page and you can also get the event level detail at /api/v2/jobs/623/job_events

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/98cf6c32-bc53-44c8-8b2d-de0361c43063%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Jones
Principal Software Engineer
Ansible Tower

Piotr Mozdzynski

unread,
Sep 29, 2017, 8:11:15 AM9/29/17
to Matthew Jones, AWX Project
Hello Mathew

Thank you for your quick response.

Yes I know about the other link you posted , however we need a pure ansi/txt/json/html stdout download as on my sample above , due to fact we want to integrate AWX with the external post from jenkins (via  tower-cli ). 
Our python scrip on Jenkins need to be able to read the full stdout otherwise we cannot know if the job is completed of failed and the job on Jenkins dashboard will never be completed.
I will wait for the fix or will try to de-containerize the AWX and run on the same machine.

Kind Regards
Piotr





Matthew Jones

unread,
Sep 29, 2017, 8:16:08 AM9/29/17
to Piotr Mozdzynski, AWX Project
What are you using to trigger that? You can certainly get the status of the job itself from the api at /api/v2/jobs/n/


Alan Rominger

unread,
Sep 29, 2017, 8:35:24 AM9/29/17
to Matthew Jones, Piotr Mozdzynski, AWX Project
tower-cli has code to re-construct stdout from the job_events stdout. This is what we use for the monitor and stdout commands. Since you're already using it, this might be a shortcut to your objective without waiting on other fixes.

Alan

Piotr Mozdzynski

unread,
Sep 29, 2017, 9:05:10 AM9/29/17
to Matthew Jones, AWX Project
I was using python scrip to get the job output :

def _get_tower_job_url(job_id, config, output_format):
    """
    Returns the url
    """
    host = config.get('general', 'host')
    return 'https://{0}/api/v1/jobs/{1}/stdout/?format={2}'.format(host,
                                                                   job_id,
                                                                   output_format)


I will try to adjust the scrip and will let you know the results.





--
You received this message because you are subscribed to a topic in the Google Groups "AWX Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/awx-project/POJvaHEZL7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to awx-project+unsubscribe@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.

Piotr Mozdzynski

unread,
Sep 29, 2017, 9:43:23 AM9/29/17
to Alan Rominger, Matthew Jones, AWX Project
Hi Alan. Thank you , this is probably better idea.
the API in current state can only display 2 formats: api or json.
We wanted that output in html or ansi ( what was possible to display from tower stdout )

Reply all
Reply to author
Forward
0 new messages