Search code examples
hudsonjenkinsslave

List of Slaves connected to master - Hudson


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.


Solution

  • 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 either XML or Python if you prefer these over JSON.

    If you use just the API suffix, you'll get a short generic help page on the API.