mirror of
https://github.com/Fishwaldo/rundeck-api-java-client.git
synced 2025-07-12 16:09:05 +00:00
add a new getJobs() method to get all jobs
This commit is contained in:
parent
77274e1d8a
commit
fe5f42fa14
1 changed files with 16 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package org.rundeck.api;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -102,6 +103,21 @@ public class RundeckClient implements Serializable {
|
|||
* Jobs
|
||||
*/
|
||||
|
||||
/**
|
||||
* List all jobs (for all projects)
|
||||
*
|
||||
* @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null
|
||||
* @throws RundeckApiException in case of error when calling the API
|
||||
* @throws RundeckApiLoginException if the login failed
|
||||
*/
|
||||
public List<RundeckJob> getJobs() throws RundeckApiException, RundeckApiLoginException {
|
||||
List<RundeckJob> jobs = new ArrayList<RundeckJob>();
|
||||
for (RundeckProject project : getProjects()) {
|
||||
jobs.addAll(getJobs(project.getName()));
|
||||
}
|
||||
return jobs;
|
||||
}
|
||||
|
||||
/**
|
||||
* List all jobs that belongs to the given project
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue