com.chavaillaz.client.jenkins.api.PluginApi Maven / Gradle / Ivy
package com.chavaillaz.client.jenkins.api;
import java.util.concurrent.CompletableFuture;
import java.util.function.UnaryOperator;
import com.chavaillaz.client.jenkins.domain.plugin.Plugins;
public interface PluginApi {
UnaryOperator XML_PLUGIN_INSTALLATION = id -> " ";
String URL_PLUGINS = "pluginManager/api/json?depth={0}";
String URL_PLUGINS_INSTALLATION = "pluginManager/installNecessaryPlugins";
/**
* Gets the list of plugins with their dependencies and with all their fields.
*
* @return A {@link CompletableFuture} with the plugins
*/
default CompletableFuture getPlugins() {
return getPlugins(2);
}
/**
* Gets the list of plugins.
*
* @param depth The depth level to return
* @return A {@link CompletableFuture} with the plugins
*/
CompletableFuture getPlugins(Integer depth);
/**
* Installs a new plugin.
*
* @param pluginId The plugin identifier
* @return A {@link CompletableFuture} without content
*/
CompletableFuture installPlugin(String pluginId);
}