jenkinsci / java-client-api

A Jenkins API client for Java
MIT License
901 stars 469 forks source link

List installed build tools #248

Open ThStock opened 7 years ago

ThStock commented 7 years ago

I manage a bunch of jenkins servers with the client api, and I want to check what build tools are already installed on each installation.

How can I list the contents of https://jenkins-installation-hostname/configureTools/ ?

JenkinsServer jenkins = new JenkinsServer(..);

JenkinsBuildTools tools = jenkins.getBuildTools();
List<JenkinsJdk> jdks = tools.getJdks();
List<JenkinsMaven> mavens = tools.getMavens();

Map<String, List<Map<String, String>>> pluginNameToPluginDetails = tools.getRaw();
// "maven" -> [ ("version" -> "3.3.9", "installAutomatic" -> "true", "install from apache" -> "3.3.9", ...),
//              ("version" -> "3.5.0", ..)]
// "java" ->   [ ("version" -> "8u131", ..),
//               ("version" -> "8u60", ..),
//               ("version" -> "7u80", ..),
//             ]
khmarbaise commented 7 years ago

If you like you can offer a patch...but of course it's a good idea for an enhancement...

ThStock commented 7 years ago

I'll offer a patch, if you can tell me the API page in jenkins where I can get the information.

khmarbaise commented 7 years ago

Unfortunately I can't cause I don't know it...

khmarbaise commented 6 years ago

After looking a little bit more in depth it looks like there is not API to get this information...I won't close it cause maybe we find another way to get this information...

ThStock commented 6 years ago

Do you think there is a chance to add this information to API? Do you know where to request it?

khmarbaise commented 6 years ago

If I find a way to get the information via REST API from Jenkins than yes....