org.rundeck.api
Class RundeckClient

java.lang.Object
  extended by org.rundeck.api.RundeckClient
All Implemented Interfaces:
Serializable

public class RundeckClient
extends Object
implements Serializable

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);
 

Author:
Vincent Behar
See Also:
Serialized Form

Field Summary
static String API_ENDPOINT
          End-point of the API
static int API_VERSION
          Version of the API supported
 
Constructor Summary
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.
 
Method Summary
 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(FileType format, String jobId)
          Export the definition of a single job, identified by the given ID
 InputStream exportJob(String format, String jobId)
          Export the definition of a single job, identified by the given ID
 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)
 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)
 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)
 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 exportJobToFile(String filename, 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)
 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, 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
 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
 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, 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<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<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, 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(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(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
 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
 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, 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)
          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 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, 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)
          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, 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, String scriptFilename)
          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 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, 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)
          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 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, 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, 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.
 void testAuth()
          Test the authentication on the RunDeck instance.
 void testCredentials()
          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)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

API_VERSION

public static final transient int API_VERSION
Version of the API supported

See Also:
Constant Field Values

API_ENDPOINT

public static final transient String API_ENDPOINT
End-point of the API

See Also:
Constant Field Values
Constructor Detail

RundeckClient

public RundeckClient(String url,
                     String login,
                     String password)
              throws IllegalArgumentException
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)

RundeckClient

public RundeckClient(String url,
                     String token)
              throws IllegalArgumentException
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)
Method Detail

ping

public void ping()
          throws RundeckApiException
Try to "ping" the RunDeck instance to see if it is alive

Throws:
RundeckApiException - if the ping fails

testAuth

public void testAuth()
              throws RundeckApiException.RundeckApiLoginException,
                     RundeckApiException.RundeckApiTokenException
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)

testCredentials

@Deprecated
public void testCredentials()
                     throws RundeckApiException.RundeckApiLoginException,
                            RundeckApiException.RundeckApiTokenException
Deprecated. Use testAuth()

Throws:
RundeckApiException.RundeckApiLoginException
RundeckApiException.RundeckApiTokenException
See Also:
testAuth()

getProjects

public List<RundeckProject> getProjects()
                                 throws RundeckApiException,
                                        RundeckApiException.RundeckApiLoginException,
                                        RundeckApiException.RundeckApiTokenException
List all projects

Returns:
a List of RundeckProject : 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)

getProject

public RundeckProject getProject(String projectName)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
Get the definition of a single project, identified by the given name

Parameters:
projectName - name of the project - mandatory
Returns:
a RundeckProject instance - 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 projectName is blank (null, empty or whitespace)

getJobs

public List<RundeckJob> getJobs()
                         throws RundeckApiException,
                                RundeckApiException.RundeckApiLoginException,
                                RundeckApiException.RundeckApiTokenException
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)

getJobs

public List<RundeckJob> getJobs(String project)
                         throws RundeckApiException,
                                RundeckApiException.RundeckApiLoginException,
                                RundeckApiException.RundeckApiTokenException,
                                IllegalArgumentException
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...)

getJobs

public List<RundeckJob> getJobs(String project,
                                String jobFilter,
                                String groupPath,
                                String... jobIds)
                         throws RundeckApiException,
                                RundeckApiException.RundeckApiLoginException,
                                RundeckApiException.RundeckApiTokenException,
                                IllegalArgumentException
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:
getJobs(String)

exportJobsToFile

public void exportJobsToFile(String filename,
                             String format,
                             String project)
                      throws RundeckApiException,
                             RundeckApiException.RundeckApiLoginException,
                             RundeckApiException.RundeckApiTokenException,
                             IllegalArgumentException,
                             IOException
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:
exportJobsToFile(String, FileType, String, String, String, String...), exportJobs(String, String)

exportJobsToFile

public void exportJobsToFile(String filename,
                             FileType format,
                             String project)
                      throws RundeckApiException,
                             RundeckApiException.RundeckApiLoginException,
                             RundeckApiException.RundeckApiTokenException,
                             IllegalArgumentException,
                             IOException
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:
exportJobsToFile(String, FileType, String, String, String, String...), exportJobs(FileType, String)

exportJobsToFile

public void exportJobsToFile(String filename,
                             String format,
                             String project,
                             String jobFilter,
                             String groupPath,
                             String... jobIds)
                      throws RundeckApiException,
                             RundeckApiException.RundeckApiLoginException,
                             RundeckApiException.RundeckApiTokenException,
                             IllegalArgumentException,
                             IOException
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...)

exportJobsToFile

public void exportJobsToFile(String filename,
                             FileType format,
                             String project,
                             String jobFilter,
                             String groupPath,
                             String... jobIds)
                      throws RundeckApiException,
                             RundeckApiException.RundeckApiLoginException,
                             RundeckApiException.RundeckApiTokenException,
                             IllegalArgumentException,
                             IOException
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...)

exportJobs

public InputStream exportJobs(String format,
                              String project)
                       throws RundeckApiException,
                              RundeckApiException.RundeckApiLoginException,
                              RundeckApiException.RundeckApiTokenException,
                              IllegalArgumentException
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:
exportJobs(FileType, String, String, String, String...), exportJobsToFile(String, String, String)

exportJobs

public InputStream exportJobs(FileType format,
                              String project)
                       throws RundeckApiException,
                              RundeckApiException.RundeckApiLoginException,
                              RundeckApiException.RundeckApiTokenException,
                              IllegalArgumentException
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:
exportJobs(FileType, String, String, String, String...), exportJobsToFile(String, FileType, String)

exportJobs

public InputStream exportJobs(String format,
                              String project,
                              String jobFilter,
                              String groupPath,
                              String... jobIds)
                       throws RundeckApiException,
                              RundeckApiException.RundeckApiLoginException,
                              RundeckApiException.RundeckApiTokenException,
                              IllegalArgumentException
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...)

exportJobs

public InputStream exportJobs(FileType format,
                              String project,
                              String jobFilter,
                              String groupPath,
                              String... jobIds)
                       throws RundeckApiException,
                              RundeckApiException.RundeckApiLoginException,
                              RundeckApiException.RundeckApiTokenException,
                              IllegalArgumentException
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...)

exportJobToFile

public void exportJobToFile(String filename,
                            String format,
                            String jobId)
                     throws RundeckApiException,
                            RundeckApiException.RundeckApiLoginException,
                            RundeckApiException.RundeckApiTokenException,
                            IllegalArgumentException,
                            IOException
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
See Also:
exportJobToFile(String, FileType, String), exportJob(String, String), getJob(String)

exportJobToFile

public void exportJobToFile(String filename,
                            FileType format,
                            String jobId)
                     throws RundeckApiException,
                            RundeckApiException.RundeckApiLoginException,
                            RundeckApiException.RundeckApiTokenException,
                            IllegalArgumentException,
                            IOException
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
See Also:
exportJob(FileType, String), getJob(String)

exportJob

public InputStream exportJob(String format,
                             String jobId)
                      throws RundeckApiException,
                             RundeckApiException.RundeckApiLoginException,
                             RundeckApiException.RundeckApiTokenException,
                             IllegalArgumentException
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
See Also:
exportJobToFile(String, String, String), getJob(String)

exportJob

public InputStream exportJob(FileType format,
                             String jobId)
                      throws RundeckApiException,
                             RundeckApiException.RundeckApiLoginException,
                             RundeckApiException.RundeckApiTokenException,
                             IllegalArgumentException
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
See Also:
exportJobToFile(String, FileType, String), getJob(String)

importJobs

public RundeckJobsImportResult importJobs(String filename,
                                          String fileType)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException,
                                          IOException
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:
a RundeckJobsImportResult instance - 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)
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
See Also:
importJobs(InputStream, String), importJobs(String, FileType, RundeckJobsImportMethod)

importJobs

public RundeckJobsImportResult importJobs(String filename,
                                          FileType fileType)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException,
                                          IOException
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:
a RundeckJobsImportResult instance - 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)
IllegalArgumentException - if the filename is blank (null, empty or whitespace), or the fileType is null
IOException - if we failed to read the file
See Also:
importJobs(InputStream, FileType), importJobs(String, FileType, RundeckJobsImportMethod)

importJobs

public RundeckJobsImportResult importJobs(String filename,
                                          String fileType,
                                          String importBehavior)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException,
                                          IOException
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:
a RundeckJobsImportResult instance - 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)
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
See Also:
importJobs(InputStream, String, String), importJobs(String, FileType, RundeckJobsImportMethod)

importJobs

public RundeckJobsImportResult importJobs(String filename,
                                          FileType fileType,
                                          RundeckJobsImportMethod importBehavior)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException,
                                          IOException
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:
a RundeckJobsImportResult instance - 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)
IllegalArgumentException - if the filename is blank (null, empty or whitespace), or the fileType is null
IOException - if we failed to read the file
See Also:
importJobs(InputStream, FileType, RundeckJobsImportMethod)

importJobs

public RundeckJobsImportResult importJobs(InputStream stream,
                                          String fileType)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException
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:
a RundeckJobsImportResult instance - 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)
IllegalArgumentException - if the stream is null, or the fileType is blank (null, empty or whitespace) or invalid
See Also:
importJobs(String, String), importJobs(InputStream, FileType, RundeckJobsImportMethod)

importJobs

public RundeckJobsImportResult importJobs(InputStream stream,
                                          FileType fileType)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException
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:
a RundeckJobsImportResult instance - 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)
IllegalArgumentException - if the stream or fileType is null
See Also:
importJobs(String, FileType), importJobs(InputStream, FileType, RundeckJobsImportMethod)

importJobs

public RundeckJobsImportResult importJobs(InputStream stream,
                                          String fileType,
                                          String importBehavior)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException
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:
a RundeckJobsImportResult instance - 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)
IllegalArgumentException - if the stream is null, or the fileType is blank (null, empty or whitespace), or the fileType or behavior is not valid
See Also:
importJobs(String, String, String), importJobs(InputStream, FileType, RundeckJobsImportMethod)

importJobs

public RundeckJobsImportResult importJobs(InputStream stream,
                                          FileType fileType,
                                          RundeckJobsImportMethod importBehavior)
                                   throws RundeckApiException,
                                          RundeckApiException.RundeckApiLoginException,
                                          RundeckApiException.RundeckApiTokenException,
                                          IllegalArgumentException
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:
a RundeckJobsImportResult instance - 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)
IllegalArgumentException - if the stream or fileType is null
See Also:
importJobs(String, FileType, RundeckJobsImportMethod)

findJob

public RundeckJob findJob(String project,
                          String groupPath,
                          String name)
                   throws RundeckApiException,
                          RundeckApiException.RundeckApiLoginException,
                          RundeckApiException.RundeckApiTokenException,
                          IllegalArgumentException
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:
a RundeckJob instance - null if not found
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:
getJob(String)

getJob

public RundeckJob getJob(String jobId)
                  throws RundeckApiException,
                         RundeckApiException.RundeckApiLoginException,
                         RundeckApiException.RundeckApiTokenException,
                         IllegalArgumentException
Get the definition of a single job, identified by the given ID

Parameters:
jobId - identifier of the job - mandatory
Returns:
a RundeckJob instance - 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)
See Also:
findJob(String, String, String), exportJob(String, String)

deleteJob

public String deleteJob(String jobId)
                 throws RundeckApiException,
                        RundeckApiException.RundeckApiLoginException,
                        RundeckApiException.RundeckApiTokenException,
                        IllegalArgumentException
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)

triggerJob

public RundeckExecution triggerJob(String jobId)
                            throws RundeckApiException,
                                   RundeckApiException.RundeckApiLoginException,
                                   RundeckApiException.RundeckApiTokenException,
                                   IllegalArgumentException
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)
See Also:
triggerJob(String, Properties, Properties), runJob(String)

triggerJob

public RundeckExecution triggerJob(String jobId,
                                   Properties options)
                            throws RundeckApiException,
                                   RundeckApiException.RundeckApiLoginException,
                                   RundeckApiException.RundeckApiTokenException,
                                   IllegalArgumentException
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)
See Also:
triggerJob(String, Properties, Properties), runJob(String, Properties)

triggerJob

public RundeckExecution triggerJob(String jobId,
                                   Properties options,
                                   Properties nodeFilters)
                            throws RundeckApiException,
                                   RundeckApiException.RundeckApiLoginException,
                                   RundeckApiException.RundeckApiTokenException,
                                   IllegalArgumentException
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)
See Also:
triggerJob(String), runJob(String, Properties, Properties)

runJob

public RundeckExecution runJob(String jobId)
                        throws RundeckApiException,
                               RundeckApiException.RundeckApiLoginException,
                               RundeckApiException.RundeckApiTokenException,
                               IllegalArgumentException
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)
See Also:
triggerJob(String), runJob(String, Properties, Properties, long, TimeUnit)

runJob

public RundeckExecution runJob(String jobId,
                               Properties options)
                        throws RundeckApiException,
                               RundeckApiException.RundeckApiLoginException,
                               RundeckApiException.RundeckApiTokenException,
                               IllegalArgumentException
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)
See Also:
triggerJob(String, Properties), runJob(String, Properties, Properties, long, TimeUnit)

runJob

public RundeckExecution runJob(String jobId,
                               Properties options,
                               Properties nodeFilters)
                        throws RundeckApiException,
                               RundeckApiException.RundeckApiLoginException,
                               RundeckApiException.RundeckApiTokenException,
                               IllegalArgumentException
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)
See Also:
triggerJob(String, Properties, Properties), runJob(String, Properties, Properties, long, TimeUnit)

runJob

public RundeckExecution runJob(String jobId,
                               Properties options,
                               long poolingInterval,
                               TimeUnit poolingUnit)
                        throws RundeckApiException,
                               RundeckApiException.RundeckApiLoginException,
                               RundeckApiException.RundeckApiTokenException,
                               IllegalArgumentException
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)
See Also:
triggerJob(String, Properties), runJob(String, Properties, Properties, long, TimeUnit)

runJob

public RundeckExecution runJob(String jobId,
                               Properties options,
                               Properties nodeFilters,
                               long poolingInterval,
                               TimeUnit poolingUnit)
                        throws RundeckApiException,
                               RundeckApiException.RundeckApiLoginException,
                               RundeckApiException.RundeckApiTokenException,
                               IllegalArgumentException
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)
See Also:
triggerJob(String, Properties), runJob(String, Properties, Properties, long, TimeUnit)

triggerAdhocCommand

public RundeckExecution triggerAdhocCommand(String project,
                                            String command)
                                     throws RundeckApiException,
                                            RundeckApiException.RundeckApiLoginException,
                                            RundeckApiException.RundeckApiTokenException,
                                            IllegalArgumentException
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)
See Also:
triggerAdhocCommand(String, String, Properties, Integer, Boolean), runAdhocCommand(String, String)

triggerAdhocCommand

public RundeckExecution triggerAdhocCommand(String project,
                                            String command,
                                            Properties nodeFilters)
                                     throws RundeckApiException,
                                            RundeckApiException.RundeckApiLoginException,
                                            RundeckApiException.RundeckApiTokenException,
                                            IllegalArgumentException
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)
See Also:
triggerAdhocCommand(String, String, Properties, Integer, Boolean), runAdhocCommand(String, String, Properties)

triggerAdhocCommand

public RundeckExecution triggerAdhocCommand(String project,
                                            String command,
                                            Properties nodeFilters,
                                            Integer nodeThreadcount,
                                            Boolean nodeKeepgoing)
                                     throws RundeckApiException,
                                            RundeckApiException.RundeckApiLoginException,
                                            RundeckApiException.RundeckApiTokenException,
                                            IllegalArgumentException
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)
See Also:
triggerAdhocCommand(String, String), runAdhocCommand(String, String, Properties)

runAdhocCommand

public RundeckExecution runAdhocCommand(String project,
                                        String command)
                                 throws RundeckApiException,
                                        RundeckApiException.RundeckApiLoginException,
                                        RundeckApiException.RundeckApiTokenException,
                                        IllegalArgumentException
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)
See Also:
runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocCommand(String, String)

runAdhocCommand

public RundeckExecution runAdhocCommand(String project,
                                        String command,
                                        long poolingInterval,
                                        TimeUnit poolingUnit)
                                 throws RundeckApiException,
                                        RundeckApiException.RundeckApiLoginException,
                                        RundeckApiException.RundeckApiTokenException,
                                        IllegalArgumentException
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)
See Also:
runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocCommand(String, String)

runAdhocCommand

public RundeckExecution runAdhocCommand(String project,
                                        String command,
                                        Properties nodeFilters)
                                 throws RundeckApiException,
                                        RundeckApiException.RundeckApiLoginException,
                                        RundeckApiException.RundeckApiTokenException,
                                        IllegalArgumentException
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)
See Also:
runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocCommand(String, String, Properties)

runAdhocCommand

public RundeckExecution runAdhocCommand(String project,
                                        String command,
                                        Properties nodeFilters,
                                        long poolingInterval,
                                        TimeUnit poolingUnit)
                                 throws RundeckApiException,
                                        RundeckApiException.RundeckApiLoginException,
                                        RundeckApiException.RundeckApiTokenException,
                                        IllegalArgumentException
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)
See Also:
runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocCommand(String, String, Properties)

runAdhocCommand

public RundeckExecution runAdhocCommand(String project,
                                        String command,
                                        Properties nodeFilters,
                                        Integer nodeThreadcount,
                                        Boolean nodeKeepgoing)
                                 throws RundeckApiException,
                                        RundeckApiException.RundeckApiLoginException,
                                        RundeckApiException.RundeckApiTokenException,
                                        IllegalArgumentException
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)
See Also:
runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocCommand(String, String, Properties, Integer, Boolean)

runAdhocCommand

public RundeckExecution runAdhocCommand(String project,
                                        String command,
                                        Properties nodeFilters,
                                        Integer nodeThreadcount,
                                        Boolean nodeKeepgoing,
                                        long poolingInterval,
                                        TimeUnit poolingUnit)
                                 throws RundeckApiException,
                                        RundeckApiException.RundeckApiLoginException,
                                        RundeckApiException.RundeckApiTokenException,
                                        IllegalArgumentException
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)
See Also:
triggerAdhocCommand(String, String, Properties, Integer, Boolean)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           String scriptFilename)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException,
                                           IOException
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
See Also:
triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean), runAdhocScript(String, String)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           String scriptFilename,
                                           Properties options)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException,
                                           IOException
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
See Also:
triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean), runAdhocScript(String, String, Properties)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           String scriptFilename,
                                           Properties options,
                                           Properties nodeFilters)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException,
                                           IOException
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
See Also:
triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean), runAdhocScript(String, String, Properties, Properties)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           String scriptFilename,
                                           Properties options,
                                           Properties nodeFilters,
                                           Integer nodeThreadcount,
                                           Boolean nodeKeepgoing)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException,
                                           IOException
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
See Also:
triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean), runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           InputStream script)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException
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
See Also:
triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean), runAdhocScript(String, InputStream)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           InputStream script,
                                           Properties options)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException
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
See Also:
triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean), runAdhocScript(String, InputStream, Properties)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           InputStream script,
                                           Properties options,
                                           Properties nodeFilters)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException
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
See Also:
triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean), runAdhocScript(String, InputStream, Properties, Properties)

triggerAdhocScript

public RundeckExecution triggerAdhocScript(String project,
                                           InputStream script,
                                           Properties options,
                                           Properties nodeFilters,
                                           Integer nodeThreadcount,
                                           Boolean nodeKeepgoing)
                                    throws RundeckApiException,
                                           RundeckApiException.RundeckApiLoginException,
                                           RundeckApiException.RundeckApiTokenException,
                                           IllegalArgumentException
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
See Also:
triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean), runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename,
                                       Properties options)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename,
                                       Properties options,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename,
                                       Properties options,
                                       Properties nodeFilters)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String, Properties, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename,
                                       Properties options,
                                       Properties nodeFilters,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String, Properties, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename,
                                       Properties options,
                                       Properties nodeFilters,
                                       Integer nodeThreadcount,
                                       Boolean nodeKeepgoing)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       String scriptFilename,
                                       Properties options,
                                       Properties nodeFilters,
                                       Integer nodeThreadcount,
                                       Boolean nodeKeepgoing,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script,
                                       Properties options)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script,
                                       Properties options,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script,
                                       Properties options,
                                       Properties nodeFilters)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream, Properties, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script,
                                       Properties options,
                                       Properties nodeFilters,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream, Properties, Properties)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script,
                                       Properties options,
                                       Properties nodeFilters,
                                       Integer nodeThreadcount,
                                       Boolean nodeKeepgoing)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException,
                                       IOException
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
See Also:
runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean)

runAdhocScript

public RundeckExecution runAdhocScript(String project,
                                       InputStream script,
                                       Properties options,
                                       Properties nodeFilters,
                                       Integer nodeThreadcount,
                                       Boolean nodeKeepgoing,
                                       long poolingInterval,
                                       TimeUnit poolingUnit)
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException,
                                       IllegalArgumentException
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
See Also:
runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit), triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean)

getRunningExecutions

public List<RundeckExecution> getRunningExecutions()
                                            throws RundeckApiException,
                                                   RundeckApiException.RundeckApiLoginException,
                                                   RundeckApiException.RundeckApiTokenException
Get all running executions (for all projects)

Returns:
a List of RundeckExecution : 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)
See Also:
getRunningExecutions(String)

getRunningExecutions

public List<RundeckExecution> getRunningExecutions(String project)
                                            throws RundeckApiException,
                                                   RundeckApiException.RundeckApiLoginException,
                                                   RundeckApiException.RundeckApiTokenException,
                                                   IllegalArgumentException
Get the running executions for the given project

Parameters:
project - name of the project - mandatory
Returns:
a List of RundeckExecution : might be empty, but won't be null
Throws:
RundeckApiException - in case of error when calling the API (non-existent project with this name)
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:
getRunningExecutions()

getJobExecutions

public List<RundeckExecution> getJobExecutions(String jobId)
                                        throws RundeckApiException,
                                               RundeckApiException.RundeckApiLoginException,
                                               RundeckApiException.RundeckApiTokenException,
                                               IllegalArgumentException
Get the executions of the given job

Parameters:
jobId - identifier of the job - mandatory
Returns:
a List of RundeckExecution : might be empty, but 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)
See Also:
getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long)

getJobExecutions

public List<RundeckExecution> getJobExecutions(String jobId,
                                               String status)
                                        throws RundeckApiException,
                                               RundeckApiException.RundeckApiLoginException,
                                               RundeckApiException.RundeckApiTokenException,
                                               IllegalArgumentException
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:
a List of RundeckExecution : might be empty, but 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 executionStatus is invalid
See Also:
getJobExecutions(String, String, Long, Long)

getJobExecutions

public List<RundeckExecution> getJobExecutions(String jobId,
                                               RundeckExecution.ExecutionStatus status)
                                        throws RundeckApiException,
                                               RundeckApiException.RundeckApiLoginException,
                                               RundeckApiException.RundeckApiTokenException,
                                               IllegalArgumentException
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:
a List of RundeckExecution : might be empty, but 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)
See Also:
getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long)

getJobExecutions

public List<RundeckExecution> getJobExecutions(String jobId,
                                               String status,
                                               Long max,
                                               Long offset)
                                        throws RundeckApiException,
                                               RundeckApiException.RundeckApiLoginException,
                                               RundeckApiException.RundeckApiTokenException,
                                               IllegalArgumentException
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:
a List of RundeckExecution : might be empty, but 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 executionStatus is invalid
See Also:
getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long)

getJobExecutions

public List<RundeckExecution> getJobExecutions(String jobId,
                                               RundeckExecution.ExecutionStatus status,
                                               Long max,
                                               Long offset)
                                        throws RundeckApiException,
                                               RundeckApiException.RundeckApiLoginException,
                                               RundeckApiException.RundeckApiTokenException,
                                               IllegalArgumentException
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:
a List of RundeckExecution : might be empty, but 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)

getExecution

public RundeckExecution getExecution(Long executionId)
                              throws RundeckApiException,
                                     RundeckApiException.RundeckApiLoginException,
                                     RundeckApiException.RundeckApiTokenException,
                                     IllegalArgumentException
Get a single execution, identified by the given ID

Parameters:
executionId - identifier of the execution - mandatory
Returns:
a RundeckExecution instance - won't be null
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

abortExecution

public RundeckAbort abortExecution(Long executionId)
                            throws RundeckApiException,
                                   RundeckApiException.RundeckApiLoginException,
                                   RundeckApiException.RundeckApiTokenException,
                                   IllegalArgumentException
Abort an execution (identified by the given ID). The execution should be running...

Parameters:
executionId - identifier of the execution - mandatory
Returns:
a RundeckAbort instance - won't be null
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

getHistory

public RundeckHistory getHistory(String project)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
Get the (events) history for the given project

Parameters:
project - name of the project - mandatory
Returns:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 Long max,
                                 Long offset)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 String jobId,
                                 String reportId,
                                 String user)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 String jobId,
                                 String reportId,
                                 String user,
                                 Long max,
                                 Long offset)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 String recent)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 String recent,
                                 Long max,
                                 Long offset)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 Date begin,
                                 Date end)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 Date begin,
                                 Date end,
                                 Long max,
                                 Long offset)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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:
getHistory(String, String, String, String, String, Date, Date, Long, Long)

getHistory

public RundeckHistory getHistory(String project,
                                 String jobId,
                                 String reportId,
                                 String user,
                                 String recent,
                                 Date begin,
                                 Date end,
                                 Long max,
                                 Long offset)
                          throws RundeckApiException,
                                 RundeckApiException.RundeckApiLoginException,
                                 RundeckApiException.RundeckApiTokenException,
                                 IllegalArgumentException
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:
a RundeckHistory instance - 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)

getNodes

public List<RundeckNode> getNodes()
                           throws RundeckApiException,
                                  RundeckApiException.RundeckApiLoginException,
                                  RundeckApiException.RundeckApiTokenException
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)

getNodes

public List<RundeckNode> getNodes(String project)
                           throws RundeckApiException,
                                  RundeckApiException.RundeckApiLoginException,
                                  RundeckApiException.RundeckApiTokenException,
                                  IllegalArgumentException
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)
See Also:
getNodes(String, Properties)

getNodes

public List<RundeckNode> getNodes(String project,
                                  Properties nodeFilters)
                           throws RundeckApiException,
                                  RundeckApiException.RundeckApiLoginException,
                                  RundeckApiException.RundeckApiTokenException,
                                  IllegalArgumentException
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)

getNode

public RundeckNode getNode(String name,
                           String project)
                    throws RundeckApiException,
                           RundeckApiException.RundeckApiLoginException,
                           RundeckApiException.RundeckApiTokenException,
                           IllegalArgumentException
Get the definition of a single node

Parameters:
name - of the node - mandatory
project - name of the project - mandatory
Returns:
a RundeckNode instance - won't be null
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)

getSystemInfo

public RundeckSystemInfo getSystemInfo()
                                throws RundeckApiException,
                                       RundeckApiException.RundeckApiLoginException,
                                       RundeckApiException.RundeckApiTokenException
Get system informations about the RunDeck server

Returns:
a RundeckSystemInfo instance - 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)

getUrl

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

getToken

public String getToken()
Returns:
the auth-token used for authentication on the RunDeck instance (null if using login-based auth)

getLogin

public String getLogin()
Returns:
the login used for authentication on the RunDeck instance (null if using token-based auth)

getPassword

public String getPassword()
Returns:
the password used for authentication on the RunDeck instance (null if using token-based auth)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.