mirror of
https://github.com/Fishwaldo/rundeck-api-java-client.git
synced 2025-07-06 04:58:26 +00:00
Add node and step criteria for execution output for api v10
This commit is contained in:
parent
aba9f8de2b
commit
8e59972a79
1 changed files with 114 additions and 6 deletions
|
@ -3265,11 +3265,119 @@ public class RundeckClient implements Serializable {
|
|||
public RundeckOutput getJobExecutionOutput(Long executionId, int offset, int lastlines, long lastmod, int maxlines)
|
||||
throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException {
|
||||
AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!");
|
||||
return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/output.xml").param("offset", offset)
|
||||
.param("lastlines", lastlines)
|
||||
.param("lastmod", lastmod)
|
||||
.param("maxlines", maxlines),
|
||||
new OutputParser("result/output", createOutputEntryParser()));
|
||||
return new ApiCall(this).get(new ApiPathBuilder(
|
||||
"/execution/", executionId.toString(),
|
||||
"/output")
|
||||
.param("offset", offset)
|
||||
.param("lastlines", lastlines)
|
||||
.param("lastmod", lastmod)
|
||||
.param("maxlines", maxlines),
|
||||
new OutputParser("result/output", createOutputEntryParser()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the execution output of the given execution on the specified node
|
||||
*
|
||||
* @param executionId identifier of the execution - mandatory
|
||||
* @param nodeName name of the node
|
||||
* @param offset byte offset to read from in the file. 0 indicates the beginning.
|
||||
* @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will
|
||||
* override the offset value and return only the specified number of lines at the end of the
|
||||
* log.
|
||||
* @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the
|
||||
* specified date OR if more data is available at the given offset
|
||||
* @param maxlines maximum number of lines to retrieve forward from the specified offset.
|
||||
*
|
||||
* @return {@link RundeckOutput}
|
||||
*
|
||||
* @throws RundeckApiException in case of error when calling the API (non-existent job with this ID)
|
||||
* @throws RundeckApiLoginException if the login fails (in case of login-based authentication)
|
||||
* @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication)
|
||||
* @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace)
|
||||
*/
|
||||
public RundeckOutput getJobExecutionOutputForNode(Long executionId, String nodeName, int offset, int lastlines,
|
||||
long lastmod, int maxlines)
|
||||
throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException {
|
||||
AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!");
|
||||
AssertUtil.notNull(nodeName, "nodeName is mandatory to get the output of a job execution!");
|
||||
return new ApiCall(this).get(new ApiPathBuilder(
|
||||
"/execution/", executionId.toString(),
|
||||
"/output/node/", nodeName )
|
||||
.param("offset", offset)
|
||||
.param("lastlines", lastlines)
|
||||
.param("lastmod", lastmod)
|
||||
.param("maxlines", maxlines),
|
||||
new OutputParser("result/output", createOutputEntryParser()));
|
||||
}
|
||||
/**
|
||||
* Get the execution output of the given execution for the specified step
|
||||
*
|
||||
* @param executionId identifier of the execution - mandatory
|
||||
* @param stepCtx identifier for the step
|
||||
* @param offset byte offset to read from in the file. 0 indicates the beginning.
|
||||
* @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will
|
||||
* override the offset value and return only the specified number of lines at the end of the
|
||||
* log.
|
||||
* @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the
|
||||
* specified date OR if more data is available at the given offset
|
||||
* @param maxlines maximum number of lines to retrieve forward from the specified offset.
|
||||
*
|
||||
* @return {@link RundeckOutput}
|
||||
*
|
||||
* @throws RundeckApiException in case of error when calling the API (non-existent job with this ID)
|
||||
* @throws RundeckApiLoginException if the login fails (in case of login-based authentication)
|
||||
* @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication)
|
||||
* @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace)
|
||||
*/
|
||||
public RundeckOutput getJobExecutionOutputForStep(Long executionId, String stepCtx, int offset, int lastlines,
|
||||
long lastmod, int maxlines)
|
||||
throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException {
|
||||
AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!");
|
||||
AssertUtil.notNull(stepCtx, "stepCtx is mandatory to get the output of a job execution!");
|
||||
return new ApiCall(this).get(new ApiPathBuilder(
|
||||
"/execution/", executionId.toString(),
|
||||
"/output/step/", stepCtx)
|
||||
.param("offset", offset)
|
||||
.param("lastlines", lastlines)
|
||||
.param("lastmod", lastmod)
|
||||
.param("maxlines", maxlines),
|
||||
new OutputParser("result/output", createOutputEntryParser()));
|
||||
}
|
||||
/**
|
||||
* Get the execution output of the given execution for the specified step
|
||||
*
|
||||
* @param executionId identifier of the execution - mandatory
|
||||
* @param stepCtx identifier for the step
|
||||
* @param offset byte offset to read from in the file. 0 indicates the beginning.
|
||||
* @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will
|
||||
* override the offset value and return only the specified number of lines at the end of the
|
||||
* log.
|
||||
* @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the
|
||||
* specified date OR if more data is available at the given offset
|
||||
* @param maxlines maximum number of lines to retrieve forward from the specified offset.
|
||||
*
|
||||
* @return {@link RundeckOutput}
|
||||
*
|
||||
* @throws RundeckApiException in case of error when calling the API (non-existent job with this ID)
|
||||
* @throws RundeckApiLoginException if the login fails (in case of login-based authentication)
|
||||
* @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication)
|
||||
* @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace)
|
||||
*/
|
||||
public RundeckOutput getJobExecutionOutputForNodeAndStep(Long executionId, String nodeName, String stepCtx, int offset, int lastlines,
|
||||
long lastmod, int maxlines)
|
||||
throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException {
|
||||
AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!");
|
||||
AssertUtil.notNull(nodeName, "nodeName is mandatory to get the output of a job execution!");
|
||||
AssertUtil.notNull(stepCtx, "stepCtx is mandatory to get the output of a job execution!");
|
||||
return new ApiCall(this).get(new ApiPathBuilder(
|
||||
"/execution/", executionId.toString(),
|
||||
"/output/node/", nodeName,
|
||||
"/step/", stepCtx)
|
||||
.param("offset", offset)
|
||||
.param("lastlines", lastlines)
|
||||
.param("lastmod", lastmod)
|
||||
.param("maxlines", maxlines),
|
||||
new OutputParser("result/output", createOutputEntryParser()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -3289,7 +3397,7 @@ public class RundeckClient implements Serializable {
|
|||
public RundeckOutput getJobExecutionOutput(Long executionId, int offset, long lastmod, int maxlines)
|
||||
throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException {
|
||||
AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!");
|
||||
return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/output.xml").param("offset", offset)
|
||||
return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/output").param("offset", offset)
|
||||
.param("lastmod", lastmod)
|
||||
.param("maxlines", maxlines),
|
||||
new OutputParser("result/output", createOutputEntryParser()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue