views:

45

answers:

3

Is there a way to find it programatically? I need this as part of an automated run; So this would be very helpful if there is an existing remote API call which can give this.

+1  A: 

Look at http://hudson:8080/computer/

sbi
Thanks. I saw that. I can parse it and get it as part of my automated run. But wanted to know if there is more specific API for this.
Aviator
@Aviator: Look at [openjey's answer](http://stackoverflow.com/questions/3202270/list-of-slaves-connected-to-master-hudson/3303637#3303637). I kept this open in a browser windows because I seemed to remember that there is an API, but never got around digging for that info. Now openjey has answered that.
sbi
A: 

What do you need it for? Hudson handles the assignment of the jobs to nodes and archiving the artifacts on the master. Your downstream job can access the artifacts through the last successful build link or through a parameter that contains the build number of the upstream job. You will need a parametrized trigger plugin for this.

Peter Schuetze
+2  A: 

You don't need to parse the HTML - most of the Hudson pages can be turned into API calls by adding URL suffix, e.g.

Make GET calls to:

http://hudson:8080/computer/api/json

switch the json for xml or python if you prefer over json

if you use just the api suffix, you'll get a short generic help page on the api

Good, `+1`! I thought there was something like this, but never got around searching for it.
sbi
Thanks a lot!!!
Aviator