/** * {@inheritDoc} */ @Override public <R extends BaseModel, D> R post(String path, D data, Class<R> cls) throws IOException { return post(path, data, cls, null, true); }
/** * {@inheritDoc} */ @Override public String post_xml(String path, String xml_data) throws IOException { return post_xml(path, xml_data, true); }
/** * The ComputerSet class will give informations like * {@link ComputerSet#getBusyExecutors()} or the * {@link ComputerSet#getTotalExecutors()}. * * @return {@link ComputerSet} * @throws IOException in case of an error. */ public ComputerSet getComputerSet() throws IOException { return client.get("computer/?depth=2", ComputerSet.class); }
/** * Create a new Jenkins server reference given only the server address * * @param serverUri address of jenkins server (ex. http://localhost:8080/jenkins) */ public JenkinsServer(URI serverUri) { this(new JenkinsHttpClient(serverUri)); }
public JobWithDetails details() throws IOException { return client.get(url, JobWithDetails.class); }
/** * {@inheritDoc} */ @Override public String post_text(String path, String textData, boolean crumbFlag) throws IOException { return post_text(path, textData, ContentType.DEFAULT_TEXT, crumbFlag); }
/** * Closes underlying resources. * Closed instances should no longer be used * Closing an already closed instance has no side effects */ @Override public void close() { client.close(); }
/** * Create a new Jenkins server reference given the address and credentials * * @param serverUri address of jenkins server (ex. http://localhost:8080/jenkins) * @param username username to use when connecting * @param passwordOrToken password (not recommended) or token (recommended) */ public JenkinsServer(URI serverUri, String username, String passwordOrToken) { this(new JenkinsHttpClient(serverUri, username, passwordOrToken)); }
/** * {@inheritDoc} */ @Override public void post(String path, boolean crumbFlag) throws IOException { post(path, null, null,null, crumbFlag); }
public BuildWithDetails details() throws IOException { return client.get(url, BuildWithDetails.class); }
/** * This will give you back the {@link PluginManager}. * * @return {@link PluginManager} * @throws IOException in case of a failure. */ public PluginManager getPluginManager() throws IOException { return client.get("pluginManager/?depth=2", PluginManager.class); }
/** * Create a new Jenkins server reference given only the server address * * @param serverUri address of jenkins server (ex. * http://localhost:8080/jenkins) */ public JenkinsServer(URI serverUri) { this(new JenkinsHttpClient(serverUri)); }
/** * {@inheritDoc} */ @Override public <R extends BaseModel, D> R post(String path, D data, Class<R> cls, boolean crumbFlag) throws IOException { return post(path, data, cls, null, crumbFlag); }
/** * * @return The information from Jenkins. In cases the build has never run * {@link #BUILD_HAS_NEVER_RUN} will be returned. * @throws IOException * in case of an error. */ public BuildWithDetails details() throws IOException { return client.get(url, BuildWithDetails.class); }
/** * Create a new Jenkins server reference given the address and credentials * * @param serverUri address of jenkins server (ex. * http://localhost:8080/jenkins) * @param username username to use when connecting * @param passwordOrToken password (not recommended) or token (recommended) */ public JenkinsServer(URI serverUri, String username, String passwordOrToken) { this(new JenkinsHttpClient(serverUri, username, passwordOrToken)); }
/** * Perform POST request that takes no parameters and returns no response * * @param path * path to request * @throws IOException * , HttpResponseException */ public void post(String path) throws IOException, HttpResponseException { post(path, null, null); }
public Queue getQueue() throws IOException { // TODO: Check if using depth=1 is a good idea? return client.get("queue/?depth=1", Queue.class); }
/** * {@inheritDoc} */ @Override public void post(String path) throws IOException { post(path, null, null, null, false); }
/** * Trigger a build without parameters */ public void build() throws IOException { client.post(url + "build"); }
private void stopPost() throws HttpResponseException, IOException{ client.post(url + "stop"); } }