public class

RundeckClient

extends Object
implements Serializable
java.lang.Object
   ↳ org.rundeck.api.RundeckClient

Class Overview

Main entry point to talk to a RunDeck instance.
You have 2 methods for authentication : login-based or token-based. If you want to use the first, you need to provide both a "login" and a "password". Otherwise, just provide a "token" (also called "auth-token"). See the RunDeck documentation for generating such a token.

Usage :

 // using login-based authentication :
 RundeckClient rundeck = new RundeckClient("http://localhost:4440", "admin", "admin");
 // or for a token-based authentication :
 RundeckClient rundeck = new RundeckClient("http://localhost:4440", "PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD");
 
 List<RundeckProject> projects = rundeck.getProjects();
 
 RundeckJob job = rundeck.findJob("my-project", "main-group/sub-group", "job-name");
 RundeckExecution execution = rundeck.triggerJob(job.getId(),
                                                 new OptionsBuilder().addOption("version", "1.2.0").toProperties());
 
 List<RundeckExecution> runningExecutions = rundeck.getRunningExecutions("my-project");
 
 rundeck.exportJobsToFile("/tmp/jobs.xml", FileType.XML, "my-project");
 rundeck.importJobs("/tmp/jobs.xml", FileType.XML);
 

Summary

Constants
String API_ENDPOINT End-point of the API
int API_VERSION Version of the API supported
Public Constructors
RundeckClient(String url, String token)
Instantiate a new RundeckClient for the RunDeck instance at the given url, using token-based authentication.
RundeckClient(String url, String login, String password)
Instantiate a new RundeckClient for the RunDeck instance at the given url, using login-based authentication.
Public Methods
RundeckAbort abortExecution(Long executionId)
Abort an execution (identified by the given ID).
String deleteJob(String jobId)
Delete a single job, identified by the given ID
boolean equals(Object obj)
InputStream exportJob(String format, String jobId)
Export the definition of a single job, identified by the given ID
InputStream exportJob(FileType format, String jobId)
Export the definition of a single job, identified by the given ID
void exportJobToFile(String filename, String format, String jobId)
Export the definition of a single job (identified by the given ID)
void exportJobToFile(String filename, FileType format, String jobId)
Export the definition of a single job (identified by the given ID)
InputStream exportJobs(String format, String project)
Export the definitions of all jobs that belongs to the given project
InputStream exportJobs(String format, String project, String jobFilter, String groupPath, String... jobIds)
Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)
InputStream exportJobs(FileType format, String project)
Export the definitions of all jobs that belongs to the given project
InputStream exportJobs(FileType format, String project, String jobFilter, String groupPath, String... jobIds)
Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)
void exportJobsToFile(String filename, String format, String project)
Export the definitions of all jobs that belongs to the given project
void exportJobsToFile(String filename, String format, String project, String jobFilter, String groupPath, String... jobIds)
Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)
void exportJobsToFile(String filename, FileType format, String project)
Export the definitions of all jobs that belongs to the given project
void exportJobsToFile(String filename, FileType format, String project, String jobFilter, String groupPath, String... jobIds)
Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)
RundeckJob findJob(String project, String groupPath, String name)
Find a job, identified by its project, group and name.
RundeckExecution getExecution(Long executionId)
Get a single execution, identified by the given ID
RundeckHistory getHistory(String project)
Get the (events) history for the given project
RundeckHistory getHistory(String project, Long max, Long offset)
Get the (events) history for the given project
RundeckHistory getHistory(String project, String recent)
Get the (events) history for the given project
RundeckHistory getHistory(String project, String recent, Long max, Long offset)
Get the (events) history for the given project
RundeckHistory getHistory(String project, String jobId, String reportId, String user)
Get the (events) history for the given project
RundeckHistory getHistory(String project, String jobId, String reportId, String user, Long max, Long offset)
Get the (events) history for the given project
RundeckHistory getHistory(String project, String jobId, String reportId, String user, String recent, Date begin, Date end, Long max, Long offset)
Get the (events) history for the given project
RundeckHistory getHistory(String project, Date begin, Date end)
Get the (events) history for the given project
RundeckHistory getHistory(String project, Date begin, Date end, Long max, Long offset)
Get the (events) history for the given project
RundeckJob getJob(String jobId)
Get the definition of a single job, identified by the given ID
List<RundeckExecution> getJobExecutions(String jobId)
Get the executions of the given job
List<RundeckExecution> getJobExecutions(String jobId, String status)
Get the executions of the given job
List<RundeckExecution> getJobExecutions(String jobId, String status, Long max, Long offset)
Get the executions of the given job
List<RundeckExecution> getJobExecutions(String jobId, RundeckExecution.ExecutionStatus status)
Get the executions of the given job
List<RundeckExecution> getJobExecutions(String jobId, RundeckExecution.ExecutionStatus status, Long max, Long offset)
Get the executions of the given job
List<RundeckJob> getJobs()
List all jobs (for all projects)
List<RundeckJob> getJobs(String project)
List all jobs that belongs to the given project
List<RundeckJob> getJobs(String project, String jobFilter, String groupPath, String... jobIds)
List the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)
String getLogin()
RundeckNode getNode(String name, String project)
Get the definition of a single node
List<RundeckNode> getNodes()
List all nodes (for all projects)
List<RundeckNode> getNodes(String project)
List all nodes that belongs to the given project
List<RundeckNode> getNodes(String project, Properties nodeFilters)
List nodes that belongs to the given project
String getPassword()
RundeckProject getProject(String projectName)
Get the definition of a single project, identified by the given name
List<RundeckProject> getProjects()
List all projects
List<RundeckExecution> getRunningExecutions()
Get all running executions (for all projects)
List<RundeckExecution> getRunningExecutions(String project)
Get the running executions for the given project
RundeckSystemInfo getSystemInfo()
Get system informations about the RunDeck server
String getToken()
String getUrl()
int hashCode()
RundeckJobsImportResult importJobs(InputStream stream, String fileType)
Import the definitions of jobs, from the given input stream
RundeckJobsImportResult importJobs(InputStream stream, String fileType, String importBehavior)
Import the definitions of jobs, from the given input stream, using the given behavior
RundeckJobsImportResult importJobs(InputStream stream, FileType fileType)
Import the definitions of jobs, from the given input stream
RundeckJobsImportResult importJobs(InputStream stream, FileType fileType, RundeckJobsImportMethod importBehavior)
Import the definitions of jobs, from the given input stream, using the given behavior
RundeckJobsImportResult importJobs(String filename, String fileType)
Import the definitions of jobs, from the given file
RundeckJobsImportResult importJobs(String filename, String fileType, String importBehavior)
Import the definitions of jobs, from the given file, using the given behavior
RundeckJobsImportResult importJobs(String filename, FileType fileType)
Import the definitions of jobs, from the given file
RundeckJobsImportResult importJobs(String filename, FileType fileType, RundeckJobsImportMethod importBehavior)
Import the definitions of jobs, from the given file, using the given behavior
void ping()
Try to "ping" the RunDeck instance to see if it is alive
RundeckExecution runAdhocCommand(String project, String command)
Run an ad-hoc command, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters)
Run an ad-hoc command, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)
Run an ad-hoc command, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc command, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc command, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocCommand(String project, String command, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc command, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script, Properties options)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script, Properties options, Properties nodeFilters)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script, Properties options, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script, Properties options, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, InputStream script, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, Properties nodeFilters)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runAdhocScript(String project, String scriptFilename, long poolingInterval, TimeUnit poolingUnit)
Run an ad-hoc script, and wait until its execution is finished (or aborted) to return.
RundeckExecution runJob(String jobId)
Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return.
RundeckExecution runJob(String jobId, Properties options)
Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return.
RundeckExecution runJob(String jobId, Properties options, Properties nodeFilters)
Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return.
RundeckExecution runJob(String jobId, Properties options, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)
Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return.
RundeckExecution runJob(String jobId, Properties options, long poolingInterval, TimeUnit poolingUnit)
Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return.
void testAuth()
Test the authentication on the RunDeck instance.
void testCredentials()
This method is deprecated. Use testAuth()
String toString()
RundeckExecution triggerAdhocCommand(String project, String command)
Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocCommand(String project, String command, Properties nodeFilters)
Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocCommand(String project, String command, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)
Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, InputStream script)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options, Properties nodeFilters)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, String scriptFilename)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options, Properties nodeFilters)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)
Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution).
RundeckExecution triggerJob(String jobId)
Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the end of the job execution)
RundeckExecution triggerJob(String jobId, Properties options)
Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the end of the job execution)
RundeckExecution triggerJob(String jobId, Properties options, Properties nodeFilters)
Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the end of the job execution)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String API_ENDPOINT

End-point of the API

Constant Value: "/api/2"

public static final int API_VERSION

Version of the API supported

Constant Value: 2 (0x00000002)

Public Constructors

public RundeckClient (String url, String token)

Instantiate a new RundeckClient for the RunDeck instance at the given url, using token-based authentication.

Parameters
url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc)
token to use for authentication on the RunDeck instance
Throws
IllegalArgumentException if the url or token is blank (null, empty or whitespace)

public RundeckClient (String url, String login, String password)

Instantiate a new RundeckClient for the RunDeck instance at the given url, using login-based authentication.

Parameters
url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc)
login to use for authentication on the RunDeck instance
password to use for authentication on the RunDeck instance
Throws
IllegalArgumentException if the url, login or password is blank (null, empty or whitespace)

Public Methods

public RundeckAbort abortExecution (Long executionId)

Abort an execution (identified by the given ID). The execution should be running...

Parameters
executionId identifier of the execution - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent execution with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the executionId is null

public String deleteJob (String jobId)

Delete a single job, identified by the given ID

Parameters
jobId identifier of the job - mandatory
Returns
  • the success message (note that in case of error, you'll get an exception)
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public boolean equals (Object obj)

public InputStream exportJob (String format, String jobId)

Export the definition of a single job, identified by the given ID

Parameters
format of the export. See FileType - mandatory
jobId identifier of the job - mandatory
Returns
  • an InputStream instance, not linked to any network resources - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the format or jobId is blank (null, empty or whitespace), or the format is invalid

public InputStream exportJob (FileType format, String jobId)

Export the definition of a single job, identified by the given ID

Parameters
format of the export. See FileType - mandatory
jobId identifier of the job - mandatory
Returns
  • an InputStream instance, not linked to any network resources - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the format is null

public void exportJobToFile (String filename, String format, String jobId)

Export the definition of a single job (identified by the given ID)

Parameters
filename path of the file where the content should be saved - mandatory
format of the export. See FileType - mandatory
jobId identifier of the job - mandatory
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename, format or jobId is blank (null, empty or whitespace), or the format is invalid
IOException if we failed to write to the file

public void exportJobToFile (String filename, FileType format, String jobId)

Export the definition of a single job (identified by the given ID)

Parameters
filename path of the file where the content should be saved - mandatory
format of the export. See FileType - mandatory
jobId identifier of the job - mandatory
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename or jobId is blank (null, empty or whitespace), or the format is null
IOException if we failed to write to the file

public InputStream exportJobs (String format, String project)

Export the definitions of all jobs that belongs to the given project

Parameters
format of the export. See FileType - mandatory
project name of the project - mandatory
Returns
  • an InputStream instance, not linked to any network resources - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is invalid
See Also

public InputStream exportJobs (String format, String project, String jobFilter, String groupPath, String... jobIds)

Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)

Parameters
format of the export. See FileType - mandatory
project name of the project - mandatory
jobFilter a filter for the job Name - optional
groupPath a group or partial group path to include all jobs within that group path - optional
jobIds a list of Job IDs to include - optional
Returns
  • an InputStream instance, not linked to any network resources - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is invalid
See Also
  • #exportJobs(FileType, String, String, String, String...)
  • #exportJobsToFile(String, String, String, String, String, String...)

public InputStream exportJobs (FileType format, String project)

Export the definitions of all jobs that belongs to the given project

Parameters
format of the export. See FileType - mandatory
project name of the project - mandatory
Returns
  • an InputStream instance, not linked to any network resources - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null
See Also

public InputStream exportJobs (FileType format, String project, String jobFilter, String groupPath, String... jobIds)

Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)

Parameters
format of the export. See FileType - mandatory
project name of the project - mandatory
jobFilter a filter for the job Name - optional
groupPath a group or partial group path to include all jobs within that group path - optional
jobIds a list of Job IDs to include - optional
Returns
  • an InputStream instance, not linked to any network resources - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null
See Also
  • #exportJobsToFile(String, FileType, String, String, String, String...)

public void exportJobsToFile (String filename, String format, String project)

Export the definitions of all jobs that belongs to the given project

Parameters
filename path of the file where the content should be saved - mandatory
format of the export. See FileType - mandatory
project name of the project - mandatory
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is invalid
IOException if we failed to write to the file
See Also

public void exportJobsToFile (String filename, String format, String project, String jobFilter, String groupPath, String... jobIds)

Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)

Parameters
filename path of the file where the content should be saved - mandatory
format of the export. See FileType - mandatory
project name of the project - mandatory
jobFilter a filter for the job Name - optional
groupPath a group or partial group path to include all jobs within that group path - optional
jobIds a list of Job IDs to include - optional
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename, format or project is blank (null, empty or whitespace), or the format is invalid
IOException if we failed to write to the file
See Also
  • #exportJobsToFile(String, FileType, String, String, String, String...)
  • #exportJobs(FileType, String, String, String, String...)

public void exportJobsToFile (String filename, FileType format, String project)

Export the definitions of all jobs that belongs to the given project

Parameters
filename path of the file where the content should be saved - mandatory
format of the export. See FileType - mandatory
project name of the project - mandatory
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null
IOException if we failed to write to the file
See Also

public void exportJobsToFile (String filename, FileType format, String project, String jobFilter, String groupPath, String... jobIds)

Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)

Parameters
filename path of the file where the content should be saved - mandatory
format of the export. See FileType - mandatory
project name of the project - mandatory
jobFilter a filter for the job Name - optional
groupPath a group or partial group path to include all jobs within that group path - optional
jobIds a list of Job IDs to include - optional
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename or project is blank (null, empty or whitespace), or the format is null
IOException if we failed to write to the file
See Also
  • #exportJobs(FileType, String, String, String, String...)

public RundeckJob findJob (String project, String groupPath, String name)

Find a job, identified by its project, group and name. Note that the groupPath is optional, as a job does not need to belong to a group (either pass null, or an empty string).

Parameters
project name of the project - mandatory
groupPath group to which the job belongs (if it belongs to a group) - optional
name of the job to find - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or the name is blank (null, empty or whitespace)
See Also

public RundeckExecution getExecution (Long executionId)

Get a single execution, identified by the given ID

Parameters
executionId identifier of the execution - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent execution with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the executionId is null

public RundeckHistory getHistory (String project)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, Long max, Long offset)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
max number of results to return - optional (default to 20)
offset the 0-indexed offset for the first result to return - optional (default to O)
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, String recent)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 weeks), "5d" (= last 5 days), etc. Optional.
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, String recent, Long max, Long offset)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 weeks), "5d" (= last 5 days), etc. Optional.
max number of results to return - optional (default to 20)
offset the 0-indexed offset for the first result to return - optional (default to O)
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, String jobId, String reportId, String user)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
jobId include only events matching the given job ID - optional
reportId include only events matching the given report ID - optional
user include only events created by the given user - optional
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, String jobId, String reportId, String user, Long max, Long offset)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
jobId include only events matching the given job ID - optional
reportId include only events matching the given report ID - optional
user include only events created by the given user - optional
max number of results to return - optional (default to 20)
offset the 0-indexed offset for the first result to return - optional (default to O)
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, String jobId, String reportId, String user, String recent, Date begin, Date end, Long max, Long offset)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
jobId include only events matching the given job ID - optional
reportId include only events matching the given report ID - optional
user include only events created by the given user - optional
recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 weeks), "5d" (= last 5 days), etc. Optional.
begin date for the earlier events to retrieve - optional
end date for the latest events to retrieve - optional
max number of results to return - optional (default to 20)
offset the 0-indexed offset for the first result to return - optional (default to O)
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, Date begin, Date end)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
begin date for the earlier events to retrieve - optional
end date for the latest events to retrieve - optional
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckHistory getHistory (String project, Date begin, Date end, Long max, Long offset)

Get the (events) history for the given project

Parameters
project name of the project - mandatory
begin date for the earlier events to retrieve - optional
end date for the latest events to retrieve - optional
max number of results to return - optional (default to 20)
offset the 0-indexed offset for the first result to return - optional (default to O)
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckJob getJob (String jobId)

Get the definition of a single job, identified by the given ID

Parameters
jobId identifier of the job - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public List<RundeckExecution> getJobExecutions (String jobId)

Get the executions of the given job

Parameters
jobId identifier of the job - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public List<RundeckExecution> getJobExecutions (String jobId, String status)

Get the executions of the given job

Parameters
jobId identifier of the job - mandatory
status of the executions, see RundeckExecution.ExecutionStatus - optional (null for all)
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is invalid

public List<RundeckExecution> getJobExecutions (String jobId, String status, Long max, Long offset)

Get the executions of the given job

Parameters
jobId identifier of the job - mandatory
status of the executions, see RundeckExecution.ExecutionStatus - optional (null for all)
max number of results to return - optional (null for all)
offset the 0-indexed offset for the first result to return - optional
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is invalid

public List<RundeckExecution> getJobExecutions (String jobId, RundeckExecution.ExecutionStatus status)

Get the executions of the given job

Parameters
jobId identifier of the job - mandatory
status of the executions, see RundeckExecution.ExecutionStatus - optional (null for all)
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public List<RundeckExecution> getJobExecutions (String jobId, RundeckExecution.ExecutionStatus status, Long max, Long offset)

Get the executions of the given job

Parameters
jobId identifier of the job - mandatory
status of the executions, see RundeckExecution.ExecutionStatus - optional (null for all)
max number of results to return - optional (null for all)
offset the 0-indexed offset for the first result to return - optional
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public List<RundeckJob> getJobs ()

List all jobs (for all projects)

Returns
  • a List of RundeckJob : might be empty, but won't be null
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)

public List<RundeckJob> getJobs (String project)

List all jobs that belongs to the given project

Parameters
project name of the project - mandatory
Returns
  • a List of RundeckJob : might be empty, but won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)
See Also
  • #getJobs(String, String, String, String...)

public List<RundeckJob> getJobs (String project, String jobFilter, String groupPath, String... jobIds)

List the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds)

Parameters
project name of the project - mandatory
jobFilter a filter for the job Name - optional
groupPath a group or partial group path to include all jobs within that group path - optional
jobIds a list of Job IDs to include - optional
Returns
  • a List of RundeckJob : might be empty, but won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)
See Also

public String getLogin ()

Returns
  • the login used for authentication on the RunDeck instance (null if using token-based auth)

public RundeckNode getNode (String name, String project)

Get the definition of a single node

Parameters
name of the node - mandatory
project name of the project - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent name or project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the name or project is blank (null, empty or whitespace)

public List<RundeckNode> getNodes ()

List all nodes (for all projects)

Returns
  • a List of RundeckNode : might be empty, but won't be null
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)

public List<RundeckNode> getNodes (String project)

List all nodes that belongs to the given project

Parameters
project name of the project - mandatory
Returns
  • a List of RundeckNode : might be empty, but won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public List<RundeckNode> getNodes (String project, Properties nodeFilters)

List nodes that belongs to the given project

Parameters
project name of the project - mandatory
nodeFilters for filtering the nodes - optional. See NodeFiltersBuilder
Returns
  • a List of RundeckNode : might be empty, but won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public String getPassword ()

Returns
  • the password used for authentication on the RunDeck instance (null if using token-based auth)

public RundeckProject getProject (String projectName)

Get the definition of a single project, identified by the given name

Parameters
projectName name of the project - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the projectName is blank (null, empty or whitespace)

public List<RundeckProject> getProjects ()

List all projects

Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)

public List<RundeckExecution> getRunningExecutions ()

Get all running executions (for all projects)

Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)

public List<RundeckExecution> getRunningExecutions (String project)

Get the running executions for the given project

Parameters
project name of the project - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace)

public RundeckSystemInfo getSystemInfo ()

Get system informations about the RunDeck server

Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)

public String getToken ()

Returns
  • the auth-token used for authentication on the RunDeck instance (null if using login-based auth)

public String getUrl ()

Returns
  • the URL of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc)

public int hashCode ()

public RundeckJobsImportResult importJobs (InputStream stream, String fileType)

Import the definitions of jobs, from the given input stream

Parameters
stream inputStream for reading the definitions - mandatory
fileType type of the file. See FileType - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the stream is null, or the fileType is blank (null, empty or whitespace) or invalid

public RundeckJobsImportResult importJobs (InputStream stream, String fileType, String importBehavior)

Import the definitions of jobs, from the given input stream, using the given behavior

Parameters
stream inputStream for reading the definitions - mandatory
fileType type of the file. See FileType - mandatory
importBehavior see RundeckJobsImportMethod
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the stream is null, or the fileType is blank (null, empty or whitespace), or the fileType or behavior is not valid

public RundeckJobsImportResult importJobs (InputStream stream, FileType fileType)

Import the definitions of jobs, from the given input stream

Parameters
stream inputStream for reading the definitions - mandatory
fileType type of the file. See FileType - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the stream or fileType is null

public RundeckJobsImportResult importJobs (InputStream stream, FileType fileType, RundeckJobsImportMethod importBehavior)

Import the definitions of jobs, from the given input stream, using the given behavior

Parameters
stream inputStream for reading the definitions - mandatory
fileType type of the file. See FileType - mandatory
importBehavior see RundeckJobsImportMethod
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the stream or fileType is null

public RundeckJobsImportResult importJobs (String filename, String fileType)

Import the definitions of jobs, from the given file

Parameters
filename of the file containing the jobs definitions - mandatory
fileType type of the file. See FileType - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename or fileType is blank (null, empty or whitespace), or the fileType is invalid
IOException if we failed to read the file

public RundeckJobsImportResult importJobs (String filename, String fileType, String importBehavior)

Import the definitions of jobs, from the given file, using the given behavior

Parameters
filename of the file containing the jobs definitions - mandatory
fileType type of the file. See FileType - mandatory
importBehavior see RundeckJobsImportMethod
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename or fileType is blank (null, empty or whitespace), or the fileType or behavior is not valid
IOException if we failed to read the file

public RundeckJobsImportResult importJobs (String filename, FileType fileType)

Import the definitions of jobs, from the given file

Parameters
filename of the file containing the jobs definitions - mandatory
fileType type of the file. See FileType - mandatory
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename is blank (null, empty or whitespace), or the fileType is null
IOException if we failed to read the file

public RundeckJobsImportResult importJobs (String filename, FileType fileType, RundeckJobsImportMethod importBehavior)

Import the definitions of jobs, from the given file, using the given behavior

Parameters
filename of the file containing the jobs definitions - mandatory
fileType type of the file. See FileType - mandatory
importBehavior see RundeckJobsImportMethod
Returns
Throws
RundeckApiException in case of error when calling the API
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the filename is blank (null, empty or whitespace), or the fileType is null
IOException if we failed to read the file

public void ping ()

Try to "ping" the RunDeck instance to see if it is alive

Throws
RundeckApiException if the ping fails

public RundeckExecution runAdhocCommand (String project, String command)

Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The command will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
command to be executed - mandatory
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution runAdhocCommand (String project, String command, Properties nodeFilters)

Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
command to be executed - mandatory
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution runAdhocCommand (String project, String command, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)

Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
command to be executed - mandatory
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution runAdhocCommand (String project, String command, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
command to be executed - mandatory
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution runAdhocCommand (String project, String command, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
command to be executed - mandatory
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution runAdhocCommand (String project, String command, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The command will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
command to be executed - mandatory
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution runAdhocScript (String project, InputStream script)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, InputStream script, Properties options)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, InputStream script, Properties options, Properties nodeFilters)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, InputStream script, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, InputStream script, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, InputStream script, Properties options, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, InputStream script, Properties options, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, InputStream script, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename, Properties options)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename, Properties options, Properties nodeFilters)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename, Properties options, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the script will be executed. See NodeFiltersBuilder
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename, Properties options, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runAdhocScript (String project, String scriptFilename, long poolingInterval, TimeUnit poolingUnit)

Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution runJob (String jobId)

Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running.

Parameters
jobId identifier of the job - mandatory
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public RundeckExecution runJob (String jobId, Properties options)

Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running.

Parameters
jobId identifier of the job - mandatory
options of the job - optional. See OptionsBuilder.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public RundeckExecution runJob (String jobId, Properties options, Properties nodeFilters)

Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still running.

Parameters
jobId identifier of the job - mandatory
options of the job - optional. See OptionsBuilder.
nodeFilters for overriding the nodes on which the job will be executed - optional. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public RundeckExecution runJob (String jobId, Properties options, Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit)

Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running.

Parameters
jobId identifier of the job - mandatory
options of the job - optional. See OptionsBuilder.
nodeFilters for overriding the nodes on which the job will be executed - optional. See NodeFiltersBuilder
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public RundeckExecution runJob (String jobId, Properties options, long poolingInterval, TimeUnit poolingUnit)

Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is finished (or aborted) or is still running.

Parameters
jobId identifier of the job - mandatory
options of the job - optional. See OptionsBuilder.
poolingInterval for checking the status of the execution. Must be > 0.
poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds.
Returns
  • a RundeckExecution instance for the (finished/aborted) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public void testAuth ()

Test the authentication on the RunDeck instance.

Throws
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)

public void testCredentials ()

public String toString ()

public RundeckExecution triggerAdhocCommand (String project, String command)

Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). The command will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
command to be executed - mandatory
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution triggerAdhocCommand (String project, String command, Properties nodeFilters)

Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). The command will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
command to be executed - mandatory
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution triggerAdhocCommand (String project, String command, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)

Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). The command will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
command to be executed - mandatory
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or command is blank (null, empty or whitespace)

public RundeckExecution triggerAdhocScript (String project, InputStream script)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null

public RundeckExecution triggerAdhocScript (String project, InputStream script, Properties options)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null

public RundeckExecution triggerAdhocScript (String project, InputStream script, Properties options, Properties nodeFilters)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null

public RundeckExecution triggerAdhocScript (String project, InputStream script, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
script inputStream for reading the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null

public RundeckExecution triggerAdhocScript (String project, String scriptFilename)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution triggerAdhocScript (String project, String scriptFilename, Properties options)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will not be dispatched to nodes, but be executed on the RunDeck server.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution triggerAdhocScript (String project, String scriptFilename, Properties options, Properties nodeFilters)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution triggerAdhocScript (String project, String scriptFilename, Properties options, Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing)

Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter.

Parameters
project name of the project - mandatory
scriptFilename filename of the script to be executed - mandatory
options of the script - optional. See OptionsBuilder.
nodeFilters for selecting nodes on which the command will be executed. See NodeFiltersBuilder
nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional
nodeKeepgoing if true, continue executing on other nodes even if some fail - optional
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent project with this name)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace)
IOException if we failed to read the file

public RundeckExecution triggerJob (String jobId)

Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the end of the job execution)

Parameters
jobId identifier of the job - mandatory
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public RundeckExecution triggerJob (String jobId, Properties options)

Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the end of the job execution)

Parameters
jobId identifier of the job - mandatory
options of the job - optional. See OptionsBuilder.
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)

public RundeckExecution triggerJob (String jobId, Properties options, Properties nodeFilters)

Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the end of the job execution)

Parameters
jobId identifier of the job - mandatory
options of the job - optional. See OptionsBuilder.
nodeFilters for overriding the nodes on which the job will be executed - optional. See NodeFiltersBuilder
Returns
  • a RundeckExecution instance for the newly created (and running) execution - won't be null
Throws
RundeckApiException in case of error when calling the API (non-existent job with this ID)
RundeckApiException.RundeckApiLoginException if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException if the token is invalid (in case of token-based authentication)
IllegalArgumentException if the jobId is blank (null, empty or whitespace)