Is there a way to access the body response from the ONTAP REST API using the NetApp modules? My use case is needing to log evidence that a command completed the task with the desired results ( not just the OK from the Ansible task) . My workaround is to run the REST Info module and gather what I need but would like to have a 1:1 relationship from task to evidence output file.
#Access return_records when using Ansible/REST API
1 messages · Page 1 of 1 (latest)
I think the way your doing it today is probably the the best way to do it today. Our module trust that if the API dosn't return an error one of 2 thing happened
- if it a Synchronous call the object has been created
- if it a asynchronous call we get a job, the ansible module will then wait on the job until the Job returns complete or an error
One way you might be able to get some of this information is by enabling trace_apis
https://github.com/ansible-collections/netapp.ontap/wiki/Debugging
This will create a file /tmp/ontap_apis.log which every API call the modules issue and the responce from the system.