0

I'm trying to build out some documentation on our Jenkins infrastructure in confluence and I'd like to be able to pull it in via REST api.

First of all, I'd like to be able to fetch in a list of agents. I found this answer but the output doesn't contain the info I'm after:

  • Name
  • Labels
  • IP Address
  • Online status
  • Operating system

I'd also like to pull a list of plugins. The call detailed in this thread just returned an array of empty objects. Resolved by adding ?depth=1 to the end.

  • Name
  • Short description
  • Version
  • Upgradable (nice to have, not important)

Do such an api endpoints exist?

Alistair Hardy
  • 397
  • 1
  • 4
  • 16
  • The solution in the [referenced answer](https://stackoverflow.com/questions/72431129/get-from-jenkins-list-of-nodes-by-label-by-rest-api) gives you all the info you want - the example there shows data only for master node, for other nodes all details you want are there. The [following answer](https://stackoverflow.com/questions/9815273/how-to-get-a-list-of-installed-jenkins-plugins-with-name-and-version-pair?rq=2) will give you ways to get the plugin list using something like: `https://JENKINS_DOMAIN/pluginManager/api/json?depth=1` – Noam Helmer Jun 01 '23 at 14:32
  • Adding the depth=1 resolved the plugin one. However the `/computer/api/json` call doesn't give any address details. – Alistair Hardy Jun 02 '23 at 08:21
  • I guess you are referring to the *host* information? if so you can get it from querying `https://JENKINS_DOMAIN/computer/NODE_NAME/config.xml` – Noam Helmer Jun 04 '23 at 09:26
  • If your node is off-line, the query cannot return all the data. – Ian W Jun 05 '23 at 09:02
  • Also, you ask two unrelated questions, so make two posts pls. – Ian W Jun 05 '23 at 09:04

0 Answers0