diff --git a/src/main/java/org/rundeck/api/RundeckClient.java b/src/main/java/org/rundeck/api/RundeckClient.java index 3e99303..2628a9a 100644 --- a/src/main/java/org/rundeck/api/RundeckClient.java +++ b/src/main/java/org/rundeck/api/RundeckClient.java @@ -547,6 +547,22 @@ public class RundeckClient implements Serializable { * Executions */ + /** + * Get the running executions for the given project + * + * @param project name of the project - mandatory + * @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 (non-existent project with this name) + * @throws RundeckApiLoginException if the login failed + * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) + */ + public List getRunningExecutions(String project) throws RundeckApiException, + RundeckApiLoginException, IllegalArgumentException { + AssertUtil.notBlank(project, "project is mandatory to trigger an ad-hoc command !"); + return new ApiCall(this).get("/executions/running?project=" + project, + new ExecutionsParser("result/executions/execution")); + } + /** * Get the executions of the given job *