mirror of
https://github.com/Fishwaldo/rundeck-api-java-client.git
synced 2025-07-12 16:09:05 +00:00
new feature : abort an execution
This commit is contained in:
parent
59748a2481
commit
d6b6ec3405
6 changed files with 239 additions and 0 deletions
|
@ -22,10 +22,12 @@ import java.util.Properties;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.rundeck.api.RundeckApiException.RundeckApiLoginException;
|
||||
import org.rundeck.api.domain.RundeckAbort;
|
||||
import org.rundeck.api.domain.RundeckExecution;
|
||||
import org.rundeck.api.domain.RundeckJob;
|
||||
import org.rundeck.api.domain.RundeckProject;
|
||||
import org.rundeck.api.domain.RundeckExecution.ExecutionStatus;
|
||||
import org.rundeck.api.parser.AbortParser;
|
||||
import org.rundeck.api.parser.ExecutionParser;
|
||||
import org.rundeck.api.parser.ExecutionsParser;
|
||||
import org.rundeck.api.parser.JobParser;
|
||||
|
@ -655,6 +657,22 @@ public class RundeckClient implements Serializable {
|
|||
new ExecutionParser("result/executions/execution"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Abort an execution (identified by the given ID). The execution should be running...
|
||||
*
|
||||
* @param executionId identifier of the execution - mandatory
|
||||
* @return a {@link RundeckAbort} instance - won't be null
|
||||
* @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID)
|
||||
* @throws RundeckApiLoginException if the login failed
|
||||
* @throws IllegalArgumentException if the executionId is null
|
||||
*/
|
||||
public RundeckAbort abortExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException,
|
||||
IllegalArgumentException {
|
||||
AssertUtil.notNull(executionId, "executionId is mandatory to abort an execution !");
|
||||
return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/abort"),
|
||||
new AbortParser("result/abort"));
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue