Sorry that doesn't retrieve the IP address. It doesn't look like there's a rest endpoint to get all slave's IPs in one call. Looks like you'll need to build that list by making multiple REST requests. I think that's easy enough if you use the library i referenced. You can probably just use the get_nodes() method to retrieve all the slave names and then iterate over the slaves and call the get_node_config() method to retrieve the ip address for each node. Hope that helps.
On Friday, August 7, 2015 at 8:30:37 AM UTC-7, Khai Do wrote: > > It's http://host/computer/api/json or you can use one of the libraries > like python-jenkins and there's a get_nodes() method that will also > retrieve that info. > > > On Tuesday, August 4, 2015 at 6:12:46 PM UTC-7, Eric Wang wrote: >> >> I second this question! >> >> On Friday, April 3, 2015 at 5:09:23 AM UTC-7, preeti k wrote: >>> >>> How can the hostname and ip information of all the slave nodes be >>> retrieved using Jenkins Python Rest API? >>> >>> The only way I have got the host name is by hitting the URL >>> http://<jenkins url>/computer/<slave node>/config.xml. >>> >>> But how do I get the list of all hostnames in one go in Python? >>> >>> -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/aef070d3-34a8-4fb3-8abc-d1a4d3b76f1d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
