diff --git a/src/main/java/org/rundeck/api/RundeckClient.java b/src/main/java/org/rundeck/api/RundeckClient.java index c7daae3..25e15e9 100644 --- a/src/main/java/org/rundeck/api/RundeckClient.java +++ b/src/main/java/org/rundeck/api/RundeckClient.java @@ -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 getJobs() throws RundeckApiException, RundeckApiLoginException { + List jobs = new ArrayList(); + for (RundeckProject project : getProjects()) { + jobs.addAll(getJobs(project.getName())); + } + return jobs; + } + /** * List all jobs that belongs to the given project *