From 57115708f2275adbfb0b097446633591ab88a7ff Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Wed, 6 Jul 2011 11:27:49 +0200 Subject: [PATCH] add method for getting all running executions --- src/main/java/org/rundeck/api/RundeckClient.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/org/rundeck/api/RundeckClient.java b/src/main/java/org/rundeck/api/RundeckClient.java index 2628a9a..b5dc1e1 100644 --- a/src/main/java/org/rundeck/api/RundeckClient.java +++ b/src/main/java/org/rundeck/api/RundeckClient.java @@ -547,6 +547,21 @@ public class RundeckClient implements Serializable { * Executions */ + /** + * Get all running executions (for all projects) + * + * @return a {@link List} of {@link RundeckExecution} : 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 getRunningExecutions() throws RundeckApiException, RundeckApiLoginException { + List executions = new ArrayList(); + for (RundeckProject project : getProjects()) { + executions.addAll(getRunningExecutions(project.getName())); + } + return executions; + } + /** * Get the running executions for the given project *