-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.263.3
Using the API, one can browse a computer (node), but the exported list of executors is fairly useless:
https://<server>/computer/<computer>/api/json
{"_class":"hudson.slaves.SlaveComputer", ... ,"executors":[{},{},{},{},{}], ..}
Using the tree API, one can get a tiny bit more detail (the number of each executor, and whether it's idle):
https://<server>/computer/<computer>/api/json?tree=executors[number,idle,currentExecutable[project[name]]]
{{{"_class":"hudson.slaves.SlaveComputer","executors":[
{"currentExecutable":null,"idle":true,"number":2},
{"currentExecutable":null,"idle":true,"number":3},
{"currentExecutable":null,"idle":true,"number":0},
{"currentExecutable":null,"idle":true,"number":4},{"currentExecutable":
{"_class":"hudson.model.FreeStyleBuild"},"idle":false,"number":1}]}}}
In this case, one can see that one of the executors is busy, but not what it's doing (except that it's running a FreeStyleBuild). I've been unable to access any more information about that build using the API (e.g. the project name or build number).
That information is accessible via the ajaxExecutors endpoint, but using that programmatically requires parsing the HTML. Otherwise one would probably need to create a plugin to expose this information.
It seems that it should be easy to export this information using the API, by marking a few properties as @Exported, and I have created a PR (untested) to demonstrate the changes that I think would be required (https://github.com/qris/jenkins/tree/export_executor_project).
I'm creating this issue as suggested by the Github merge request template.