diff --git a/apidocs/assets/navtree_data.js b/apidocs/assets/navtree_data.js index a076481..7d6ebe1 100644 --- a/apidocs/assets/navtree_data.js +++ b/apidocs/assets/navtree_data.js @@ -1,5 +1,6 @@ var NAVTREE_DATA = -[ [ "org.rundeck.api", "org/rundeck/api/package-summary.html", [ [ "Description", "org/rundeck/api/package-descr.html", null, "" ], [ "Classes", null, [ [ "NodeFiltersBuilder", "org/rundeck/api/NodeFiltersBuilder.html", null, "" ], [ "OptionsBuilder", "org/rundeck/api/OptionsBuilder.html", null, "" ], [ "RundeckClient", "org/rundeck/api/RundeckClient.html", null, "" ], [ "RundeckClientBuilder", "org/rundeck/api/RundeckClientBuilder.html", null, "" ] ] +[ [ "org.rundeck.api", "org/rundeck/api/package-summary.html", [ [ "Description", "org/rundeck/api/package-descr.html", null, "" ], [ "Interfaces", null, [ [ "RunAdhoc", "org/rundeck/api/RunAdhoc.html", null, "" ], [ "RunAdhocCommand", "org/rundeck/api/RunAdhocCommand.html", null, "" ], [ "RunAdhocScript", "org/rundeck/api/RunAdhocScript.html", null, "" ], [ "RunJob", "org/rundeck/api/RunJob.html", null, "" ], [ "RundeckJobsImport", "org/rundeck/api/RundeckJobsImport.html", null, "" ] ] +, "" ], [ "Classes", null, [ [ "DefaultJobsImport", "org/rundeck/api/DefaultJobsImport.html", null, "" ], [ "NodeFiltersBuilder", "org/rundeck/api/NodeFiltersBuilder.html", null, "" ], [ "OptionsBuilder", "org/rundeck/api/OptionsBuilder.html", null, "" ], [ "RunAdhocCommandBuilder", "org/rundeck/api/RunAdhocCommandBuilder.html", null, "" ], [ "RunAdhocScriptBuilder", "org/rundeck/api/RunAdhocScriptBuilder.html", null, "" ], [ "RunJobBuilder", "org/rundeck/api/RunJobBuilder.html", null, "" ], [ "RundeckClient", "org/rundeck/api/RundeckClient.html", null, "" ], [ "RundeckClientBuilder", "org/rundeck/api/RundeckClientBuilder.html", null, "" ], [ "RundeckJobsImportBuilder", "org/rundeck/api/RundeckJobsImportBuilder.html", null, "" ] ] , "" ], [ "Enums", null, [ [ "FileType", "org/rundeck/api/FileType.html", null, "" ], [ "RundeckClient.Version", "org/rundeck/api/RundeckClient.Version.html", null, "" ] ] , "" ], [ "Exceptions", null, [ [ "RundeckApiException", "org/rundeck/api/RundeckApiException.html", null, "" ], [ "RundeckApiException.RundeckApiAuthException", "org/rundeck/api/RundeckApiException.RundeckApiAuthException.html", null, "" ], [ "RundeckApiException.RundeckApiLoginException", "org/rundeck/api/RundeckApiException.RundeckApiLoginException.html", null, "" ], [ "RundeckApiException.RundeckApiTokenException", "org/rundeck/api/RundeckApiException.RundeckApiTokenException.html", null, "" ] ] , "" ] ] diff --git a/apidocs/proof-read.txt b/apidocs/proof-read.txt index ba96d54..ad559bb 100644 --- a/apidocs/proof-read.txt +++ b/apidocs/proof-read.txt @@ -24,8 +24,64 @@ javadoc proofread file: ./proof-read.txt

See the documentation of the RundeckClient class (main entry point of the API).

+=== org/rundeck/api/RunJobBuilder.html === + Job run request builder +CONSTRUCTOR: RunJobBuilder +METHOD: build +METHOD: builder +METHOD: setAsUser +METHOD: setJobId +METHOD: setNodeFilters +METHOD: setOptions + + +=== org/rundeck/api/RunJob.html === + Job run request +METHOD: getAsUser + Specify a user name to run the job as, must have 'runAs' permission +METHOD: getJobId + Identifier of the job - mandatory +METHOD: getNodeFilters + Node filters for overriding the nodes on which the job will be executed - optional. See + {@link ... NodeFiltersBuilder} +METHOD: getOptions + Options of the job - optional. See + {@link ... OptionsBuilder} + . + + +=== org/rundeck/api/RundeckJobsImportBuilder.html === + Builds a + {@link ... RundeckJobsImport} + +CONSTRUCTOR: RundeckJobsImportBuilder +CONSTRUCTOR: RundeckJobsImportBuilder +METHOD: build +METHOD: builder + Create a new builder +METHOD: builder + Create a builder initialized with an existing + {@link ... RundeckJobsImport} +METHOD: setFileType +METHOD: setJobsImportMethod +METHOD: setProject +METHOD: setStream + + +=== org/rundeck/api/RundeckJobsImport.html === + Request to import a set of Job definitions +METHOD: getFileType + Return the file type +METHOD: getImportMethod + Return the import behavior +METHOD: getProject + Return the project name +METHOD: getStream + Return the input stream + + === org/rundeck/api/RundeckClientBuilder.html === - Builder to create a + Builder to build a {@link ... RundeckClient} , you must specify a url, and at least one of (login, password), token, or sessionId. @@ -47,10 +103,53 @@ METHOD: version === org/rundeck/api/RundeckClient.html === - Main entry point to talk to a RunDeck instance.
+ Main entry point to talk to a RunDeck instance. +

+ Deprecation Warning: These methods which take multiple arguments are deprecated in + favor of single argument versions, and associated Builder classes to generate them. + These methods will be removed in version 10 of this library: +

+

+

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.
+ documentation for generating such a token.


Usage :
@@ -59,15 +158,15 @@ METHOD: version 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); @@ -76,6 +175,7 @@ FIELD: API_ENDPOINT End-point of the API FIELD: API_VERSION Version of the API supported +FIELD: JOBS_IMPORT CONSTRUCTOR: RundeckClient CONSTRUCTOR: RundeckClient Instantiate a new @@ -85,10 +185,12 @@ CONSTRUCTOR: RundeckClient CONSTRUCTOR: RundeckClient Instantiate a new {@link ... RundeckClient} - for the RunDeck instance at the given url, + for the RunDeck instance at the given url, using token-based or session-based authentication. Either token or sessionID must be valid METHOD: abortExecution Abort an execution (identified by the given ID). The execution should be running... +METHOD: abortExecution + Abort an execution (identified by the given ID). The execution should be running... METHOD: builder Create a builder for RundeckClient METHOD: deleteJob @@ -219,6 +321,10 @@ METHOD: importJobs Import the definitions of jobs, from the given file METHOD: importJobs Import the definitions of jobs, from the given file, using the given behavior +METHOD: importJobs + Import the definitions of jobs, from the given input stream, using the given behavior +METHOD: importJobs + Import the definitions of jobs, from the given input stream, using the given behavior METHOD: ping Try to "ping" the RunDeck instance to see if it is alive METHOD: runAdhocCommand @@ -243,11 +349,25 @@ METHOD: runAdhocCommand 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. +METHOD: runAdhocCommand + 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. METHOD: runAdhocCommand 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. +METHOD: runAdhocCommand + 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. +METHOD: runAdhocCommand + 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. METHOD: runAdhocScript 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 @@ -274,6 +394,11 @@ METHOD: runAdhocScript 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. +METHOD: runAdhocScript + 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. METHOD: runAdhocScript 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 @@ -320,6 +445,20 @@ METHOD: runAdhocScript 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. +METHOD: runAdhocScript + 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. +METHOD: runAdhocScript + Run an ad-hoc script read from a file, 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. +METHOD: runAdhocScript + 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. METHOD: runJob 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 @@ -340,6 +479,18 @@ METHOD: runJob 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. +METHOD: runJob + 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. +METHOD: runJob + 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. +METHOD: runJob + 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. METHOD: testAuth Test the authentication on the RunDeck instance. METHOD: testCredentials @@ -353,9 +504,18 @@ METHOD: triggerAdhocCommand METHOD: triggerAdhocCommand 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. +METHOD: triggerAdhocCommand + 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. +METHOD: triggerAdhocCommand + 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. METHOD: triggerAdhocScript 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. +METHOD: triggerAdhocScript + 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. METHOD: triggerAdhocScript 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. @@ -365,9 +525,15 @@ METHOD: triggerAdhocScript METHOD: triggerAdhocScript 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. +METHOD: triggerAdhocScript + 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. METHOD: triggerAdhocScript 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. +METHOD: triggerAdhocScript + 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. METHOD: triggerAdhocScript 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. @@ -377,6 +543,21 @@ METHOD: triggerAdhocScript METHOD: triggerAdhocScript 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. +METHOD: triggerAdhocScript + 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. +METHOD: triggerAdhocScript + 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. +METHOD: triggerAdhocScript + Trigger the execution of an ad-hoc script read from a file, and return immediately (without waiting the end of + the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +METHOD: triggerJob + Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the + end of the job execution) +METHOD: triggerJob + Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the + end of the job execution) METHOD: triggerJob Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the end of the job execution) @@ -392,6 +573,8 @@ METHOD: triggerJob Supported version numbers ENUM: V5 ENUM: V6 +ENUM: V7 +ENUM: V8 METHOD: getVersionNumber METHOD: valueOf METHOD: values @@ -421,6 +604,78 @@ CONSTRUCTOR: RundeckApiException.RundeckApiTokenException CONSTRUCTOR: RundeckApiException.RundeckApiTokenException +=== org/rundeck/api/RunAdhocScriptBuilder.html === + A builder to build a + {@link ... RunAdhocScript} + , use the + {@link ... builder()} + to build a builder, then + {@link ... build()} + to build an RunAdhocScript +CONSTRUCTOR: RunAdhocScriptBuilder +METHOD: build +METHOD: builder + Create a new builder +METHOD: builder + Create a builder initialized with an existing + {@link ... RunAdhocScript} +METHOD: setArgString +METHOD: setAsUser +METHOD: setInterpreterArgsQuoted +METHOD: setNodeFilters +METHOD: setNodeKeepgoing +METHOD: setNodeThreadcount +METHOD: setProject +METHOD: setScript +METHOD: setScriptInterpreter + + +=== org/rundeck/api/RunAdhocScript.html === + An adhoc script to be executed by Rundeck +METHOD: getArgString + Arguments to the script +METHOD: getInterpreterArgsQuoted + If true, quote the script filepath and args to the script interpreter. +METHOD: getScript + InputStream for reading the script to be executed - mandatory +METHOD: getScriptInterpreter + Command string to invoke the script with arguments + + +=== org/rundeck/api/RunAdhocCommandBuilder.html === + Builder for adhoc command request +CONSTRUCTOR: RunAdhocCommandBuilder +METHOD: build +METHOD: builder +METHOD: setAsUser +METHOD: setCommand +METHOD: setNodeFilters +METHOD: setNodeKeepgoing +METHOD: setNodeThreadcount +METHOD: setProject + + +=== org/rundeck/api/RunAdhocCommand.html === + A command to execute +METHOD: getCommand + Command to executed + + +=== org/rundeck/api/RunAdhoc.html === + Super interface for adhoc executions +METHOD: getAsUser + Specify a user name to run the job as, must have 'runAs' permission +METHOD: getNodeFilters + Filters for selecting nodes on which the command will be executed. See + {@link ... NodeFiltersBuilder} +METHOD: getNodeKeepgoing + if true, continue executing on other nodes even if some fail - optional +METHOD: getNodeThreadcount + Thread count to use (for parallelizing when running on multiple nodes) - optional +METHOD: getProject + Project name, required + + === org/rundeck/api/OptionsBuilder.html === Builder for job options CONSTRUCTOR: OptionsBuilder @@ -485,6 +740,19 @@ METHOD: valueOf METHOD: values +=== org/rundeck/api/DefaultJobsImport.html === + $INTERFACE is ... User: greg Date: 8/6/13 Time: 10:18 AM +CONSTRUCTOR: DefaultJobsImport +METHOD: getFileType +METHOD: getImportMethod +METHOD: getProject +METHOD: getStream +METHOD: setFileType +METHOD: setImportMethod +METHOD: setProject +METHOD: setStream + + === org/rundeck/api/domain/RundeckSystemInfo.html === Represents the RunDeck system info CONSTRUCTOR: RundeckSystemInfo @@ -1019,7 +1287,7 @@ METHOD: parseXmlNode === org/rundeck/api/query/ExecutionQuery.html === - ExecutionQuery contains the query parameters for the /executions api, create one with the + ExecutionQuery contains the query parameters for the /executions api, build one with the {@link ... ExecutionQuery.Builder} class, e.g. using the diff --git a/apidocs/reference/classes.html b/apidocs/reference/classes.html index 13a3fd5..8e636a0 100644 --- a/apidocs/reference/classes.html +++ b/apidocs/reference/classes.html @@ -253,6 +253,12 @@ + DefaultJobsImport + $INTERFACE is ...  + + + + DeleteParser DeleteParser is ...  @@ -279,7 +285,7 @@ ExecutionQuery - ExecutionQuery contains the query parameters for the /executions api, create one with the ExecutionQuery.Builder class, e.g.  + ExecutionQuery contains the query parameters for the /executions api, build one with the ExecutionQuery.Builder class, e.g.  @@ -444,141 +450,191 @@ + RunAdhoc + Super interface for adhoc executions +  + + + + + RunAdhocCommand + A command to execute +  + + + + + RunAdhocCommandBuilder + Builder for adhoc command request +  + + + + + RunAdhocScript + An adhoc script to be executed by Rundeck +  + + + + + RunAdhocScriptBuilder + A builder to build a RunAdhocScript, use the builder() to build a builder, then build() + to build an RunAdhocScript +  + + + + RundeckAbort Represents an abort of a RundeckExecution  - + RundeckAbort.AbortStatus The status of an abort   - + RundeckApiException A generic (unchecked) exception when using the RunDeck API  - + RundeckApiException.RundeckApiAuthException Specific authentication-related error (either login or token).  - + RundeckApiException.RundeckApiLoginException Specific authentication-related error (in case of login-based authentication)   - + RundeckApiException.RundeckApiTokenException Specific authentication-related error (in case of token-based authentication)   - + RundeckClient Main entry point to talk to a RunDeck instance.  - + RundeckClient.Version Supported version numbers   - + RundeckClientBuilder - Builder to create a RundeckClient, you must specify a url, and at least one of (login, password), token, or + Builder to build a RundeckClient, you must specify a url, and at least one of (login, password), token, or sessionId.  - + RundeckEvent Represents a RunDeck event  - + RundeckEvent.EventStatus The status of an event   - + RundeckEvent.NodeSummary Summary for nodes   - + RundeckExecution Represents a RunDeck execution, usually triggered by an API call.  - + RundeckExecution.ExecutionStatus The status of an execution   - + RundeckHistory Represents a portion of the RunDeck (events) history  - + RundeckJob Represents a RunDeck job  - + RundeckJobDelete RundeckJobDelete represents a result of a job delete request.  - + RundeckJobDeleteBulk RundeckJobDeleteBulk represents the result of a bulk job delete request and contains a list of RundeckJobDelete objects.  + + RundeckJobsImport + Request to import a set of Job definitions +  + + + + RundeckJobsImportBuilder + Builds a RundeckJobsImport +  + + + + RundeckJobsImportMethod The behavior when importing jobs (which may already exist).  - + RundeckJobsImportResult Result of importing some jobs into RunDeck  - + RundeckNode Represents a RunDeck node (server on which RunDeck can execute jobs and commands)  - + RundeckOutput Represents a RunDeck output @@ -586,7 +642,7 @@ - + RundeckOutputEntry Represents a RunDeck output entry @@ -594,24 +650,38 @@ - + RundeckOutputEntry.RundeckLogLevel   - + RundeckProject Represents a RunDeck project  - + RundeckSystemInfo Represents the RunDeck system info  + + RunJob + Job run request +  + + + + + RunJobBuilder + Job run request builder +  + + + diff --git a/apidocs/reference/current.xml b/apidocs/reference/current.xml index 9c54234..c2a8790 100644 --- a/apidocs/reference/current.xml +++ b/apidocs/reference/current.xml @@ -1,6 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1845,7 +2552,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -1870,7 +2577,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -1893,7 +2600,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -1918,7 +2625,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -1943,7 +2650,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -1970,7 +2677,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -1995,7 +2702,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2015,6 +2722,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2058,7 +2811,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2083,7 +2836,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2112,7 +2865,42 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" + visibility="public" +> + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2145,7 +2933,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2174,7 +2962,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2194,7 +2982,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2226,7 +3060,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2253,7 +3087,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2282,7 +3116,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2315,7 +3149,44 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" + visibility="public" +> + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2350,7 +3221,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2383,7 +3254,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2414,7 +3285,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2443,7 +3314,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2468,7 +3339,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2495,7 +3366,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2524,7 +3395,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2557,7 +3428,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2594,7 +3465,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2627,7 +3498,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2658,7 +3529,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2680,7 +3551,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2708,7 +3656,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2731,7 +3679,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2756,7 +3704,38 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" + visibility="public" +> + + + + + + + + + + + + + + + + + + + + + + @@ -2785,7 +3764,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2805,6 +3784,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2865,7 +3890,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2890,7 +3915,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2912,7 +3937,38 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2942,7 +4019,40 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" + visibility="public" +> + + + + + + + + + + + + + + + + + + + + + + + + @@ -2967,7 +4077,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -2994,7 +4104,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -3025,7 +4135,40 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" + visibility="public" +> + + + + + + + + + + + + + + + + + + + + + + + + @@ -3050,7 +4193,42 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" + visibility="public" +> + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3077,7 +4255,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -3106,7 +4284,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -3132,7 +4310,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3160,7 +4419,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -3183,7 +4442,7 @@ synchronized="false" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -3201,6 +4460,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apidocs/reference/hierarchy.html b/apidocs/reference/hierarchy.html index 910be1f..68e93c2 100644 --- a/apidocs/reference/hierarchy.html +++ b/apidocs/reference/hierarchy.html @@ -229,6 +229,26 @@ + + + + + DefaultJobsImport + + + + + + RundeckJobsImport +    + +   + + + + + + @@ -261,6 +281,54 @@ + + + + + RunAdhocCommandBuilder + + + + +   + + + + + + + + + + + RunAdhocScriptBuilder + + + + +   + + + + + + + + + + + RunJobBuilder + + + + +   + + + + + + @@ -297,6 +365,22 @@ + + + + + RundeckJobsImportBuilder + + + + +   + + + + + + diff --git a/apidocs/reference/lists.js b/apidocs/reference/lists.js index 94c80ba..49fa336 100644 --- a/apidocs/reference/lists.js +++ b/apidocs/reference/lists.js @@ -1,61 +1,71 @@ var DATA = [ { id:0, label:"org.rundeck.api", link:"org/rundeck/api/package-summary.html", type:"package" }, - { id:1, label:"org.rundeck.api.FileType", link:"org/rundeck/api/FileType.html", type:"class" }, - { id:2, label:"org.rundeck.api.NodeFiltersBuilder", link:"org/rundeck/api/NodeFiltersBuilder.html", type:"class" }, - { id:3, label:"org.rundeck.api.OptionsBuilder", link:"org/rundeck/api/OptionsBuilder.html", type:"class" }, - { id:4, label:"org.rundeck.api.RundeckApiException", link:"org/rundeck/api/RundeckApiException.html", type:"class" }, - { id:5, label:"org.rundeck.api.RundeckApiException.RundeckApiAuthException", link:"org/rundeck/api/RundeckApiException.RundeckApiAuthException.html", type:"class" }, - { id:6, label:"org.rundeck.api.RundeckApiException.RundeckApiLoginException", link:"org/rundeck/api/RundeckApiException.RundeckApiLoginException.html", type:"class" }, - { id:7, label:"org.rundeck.api.RundeckApiException.RundeckApiTokenException", link:"org/rundeck/api/RundeckApiException.RundeckApiTokenException.html", type:"class" }, - { id:8, label:"org.rundeck.api.RundeckClient", link:"org/rundeck/api/RundeckClient.html", type:"class" }, - { id:9, label:"org.rundeck.api.RundeckClient.Version", link:"org/rundeck/api/RundeckClient.Version.html", type:"class" }, - { id:10, label:"org.rundeck.api.RundeckClientBuilder", link:"org/rundeck/api/RundeckClientBuilder.html", type:"class" }, - { id:11, label:"org.rundeck.api.domain", link:"org/rundeck/api/domain/package-summary.html", type:"package" }, - { id:12, label:"org.rundeck.api.domain.RundeckAbort", link:"org/rundeck/api/domain/RundeckAbort.html", type:"class" }, - { id:13, label:"org.rundeck.api.domain.RundeckAbort.AbortStatus", link:"org/rundeck/api/domain/RundeckAbort.AbortStatus.html", type:"class" }, - { id:14, label:"org.rundeck.api.domain.RundeckEvent", link:"org/rundeck/api/domain/RundeckEvent.html", type:"class" }, - { id:15, label:"org.rundeck.api.domain.RundeckEvent.EventStatus", link:"org/rundeck/api/domain/RundeckEvent.EventStatus.html", type:"class" }, - { id:16, label:"org.rundeck.api.domain.RundeckEvent.NodeSummary", link:"org/rundeck/api/domain/RundeckEvent.NodeSummary.html", type:"class" }, - { id:17, label:"org.rundeck.api.domain.RundeckExecution", link:"org/rundeck/api/domain/RundeckExecution.html", type:"class" }, - { id:18, label:"org.rundeck.api.domain.RundeckExecution.ExecutionStatus", link:"org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html", type:"class" }, - { id:19, label:"org.rundeck.api.domain.RundeckHistory", link:"org/rundeck/api/domain/RundeckHistory.html", type:"class" }, - { id:20, label:"org.rundeck.api.domain.RundeckJob", link:"org/rundeck/api/domain/RundeckJob.html", type:"class" }, - { id:21, label:"org.rundeck.api.domain.RundeckJobDelete", link:"org/rundeck/api/domain/RundeckJobDelete.html", type:"class" }, - { id:22, label:"org.rundeck.api.domain.RundeckJobDeleteBulk", link:"org/rundeck/api/domain/RundeckJobDeleteBulk.html", type:"class" }, - { id:23, label:"org.rundeck.api.domain.RundeckJobsImportMethod", link:"org/rundeck/api/domain/RundeckJobsImportMethod.html", type:"class" }, - { id:24, label:"org.rundeck.api.domain.RundeckJobsImportResult", link:"org/rundeck/api/domain/RundeckJobsImportResult.html", type:"class" }, - { id:25, label:"org.rundeck.api.domain.RundeckNode", link:"org/rundeck/api/domain/RundeckNode.html", type:"class" }, - { id:26, label:"org.rundeck.api.domain.RundeckOutput", link:"org/rundeck/api/domain/RundeckOutput.html", type:"class" }, - { id:27, label:"org.rundeck.api.domain.RundeckOutputEntry", link:"org/rundeck/api/domain/RundeckOutputEntry.html", type:"class" }, - { id:28, label:"org.rundeck.api.domain.RundeckOutputEntry.RundeckLogLevel", link:"org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html", type:"class" }, - { id:29, label:"org.rundeck.api.domain.RundeckProject", link:"org/rundeck/api/domain/RundeckProject.html", type:"class" }, - { id:30, label:"org.rundeck.api.domain.RundeckSystemInfo", link:"org/rundeck/api/domain/RundeckSystemInfo.html", type:"class" }, - { id:31, label:"org.rundeck.api.parser", link:"org/rundeck/api/parser/package-summary.html", type:"package" }, - { id:32, label:"org.rundeck.api.parser.AbortParser", link:"org/rundeck/api/parser/AbortParser.html", type:"class" }, - { id:33, label:"org.rundeck.api.parser.BulkDeleteParser", link:"org/rundeck/api/parser/BulkDeleteParser.html", type:"class" }, - { id:34, label:"org.rundeck.api.parser.DeleteParser", link:"org/rundeck/api/parser/DeleteParser.html", type:"class" }, - { id:35, label:"org.rundeck.api.parser.EventParser", link:"org/rundeck/api/parser/EventParser.html", type:"class" }, - { id:36, label:"org.rundeck.api.parser.ExecutionParser", link:"org/rundeck/api/parser/ExecutionParser.html", type:"class" }, - { id:37, label:"org.rundeck.api.parser.HistoryParser", link:"org/rundeck/api/parser/HistoryParser.html", type:"class" }, - { id:38, label:"org.rundeck.api.parser.JobParser", link:"org/rundeck/api/parser/JobParser.html", type:"class" }, - { id:39, label:"org.rundeck.api.parser.JobsImportResultParser", link:"org/rundeck/api/parser/JobsImportResultParser.html", type:"class" }, - { id:40, label:"org.rundeck.api.parser.ListParser", link:"org/rundeck/api/parser/ListParser.html", type:"class" }, - { id:41, label:"org.rundeck.api.parser.NodeParser", link:"org/rundeck/api/parser/NodeParser.html", type:"class" }, - { id:42, label:"org.rundeck.api.parser.OutputEntryParser", link:"org/rundeck/api/parser/OutputEntryParser.html", type:"class" }, - { id:43, label:"org.rundeck.api.parser.OutputEntryParserV5", link:"org/rundeck/api/parser/OutputEntryParserV5.html", type:"class" }, - { id:44, label:"org.rundeck.api.parser.OutputParser", link:"org/rundeck/api/parser/OutputParser.html", type:"class" }, - { id:45, label:"org.rundeck.api.parser.PagedResultParser", link:"org/rundeck/api/parser/PagedResultParser.html", type:"class" }, - { id:46, label:"org.rundeck.api.parser.ParserHelper", link:"org/rundeck/api/parser/ParserHelper.html", type:"class" }, - { id:47, label:"org.rundeck.api.parser.ProjectParser", link:"org/rundeck/api/parser/ProjectParser.html", type:"class" }, - { id:48, label:"org.rundeck.api.parser.StringParser", link:"org/rundeck/api/parser/StringParser.html", type:"class" }, - { id:49, label:"org.rundeck.api.parser.SystemInfoParser", link:"org/rundeck/api/parser/SystemInfoParser.html", type:"class" }, - { id:50, label:"org.rundeck.api.parser.XmlNodeParser", link:"org/rundeck/api/parser/XmlNodeParser.html", type:"class" }, - { id:51, label:"org.rundeck.api.query", link:"org/rundeck/api/query/package-summary.html", type:"package" }, - { id:52, label:"org.rundeck.api.query.ExecutionQuery", link:"org/rundeck/api/query/ExecutionQuery.html", type:"class" }, - { id:53, label:"org.rundeck.api.query.ExecutionQuery.Builder", link:"org/rundeck/api/query/ExecutionQuery.Builder.html", type:"class" }, - { id:54, label:"org.rundeck.api.util", link:"org/rundeck/api/util/package-summary.html", type:"package" }, - { id:55, label:"org.rundeck.api.util.AssertUtil", link:"org/rundeck/api/util/AssertUtil.html", type:"class" }, - { id:56, label:"org.rundeck.api.util.PagedResults", link:"org/rundeck/api/util/PagedResults.html", type:"class" }, - { id:57, label:"org.rundeck.api.util.ParametersUtil", link:"org/rundeck/api/util/ParametersUtil.html", type:"class" } + { id:1, label:"org.rundeck.api.DefaultJobsImport", link:"org/rundeck/api/DefaultJobsImport.html", type:"class" }, + { id:2, label:"org.rundeck.api.FileType", link:"org/rundeck/api/FileType.html", type:"class" }, + { id:3, label:"org.rundeck.api.NodeFiltersBuilder", link:"org/rundeck/api/NodeFiltersBuilder.html", type:"class" }, + { id:4, label:"org.rundeck.api.OptionsBuilder", link:"org/rundeck/api/OptionsBuilder.html", type:"class" }, + { id:5, label:"org.rundeck.api.RunAdhoc", link:"org/rundeck/api/RunAdhoc.html", type:"class" }, + { id:6, label:"org.rundeck.api.RunAdhocCommand", link:"org/rundeck/api/RunAdhocCommand.html", type:"class" }, + { id:7, label:"org.rundeck.api.RunAdhocCommandBuilder", link:"org/rundeck/api/RunAdhocCommandBuilder.html", type:"class" }, + { id:8, label:"org.rundeck.api.RunAdhocScript", link:"org/rundeck/api/RunAdhocScript.html", type:"class" }, + { id:9, label:"org.rundeck.api.RunAdhocScriptBuilder", link:"org/rundeck/api/RunAdhocScriptBuilder.html", type:"class" }, + { id:10, label:"org.rundeck.api.RunJob", link:"org/rundeck/api/RunJob.html", type:"class" }, + { id:11, label:"org.rundeck.api.RunJobBuilder", link:"org/rundeck/api/RunJobBuilder.html", type:"class" }, + { id:12, label:"org.rundeck.api.RundeckApiException", link:"org/rundeck/api/RundeckApiException.html", type:"class" }, + { id:13, label:"org.rundeck.api.RundeckApiException.RundeckApiAuthException", link:"org/rundeck/api/RundeckApiException.RundeckApiAuthException.html", type:"class" }, + { id:14, label:"org.rundeck.api.RundeckApiException.RundeckApiLoginException", link:"org/rundeck/api/RundeckApiException.RundeckApiLoginException.html", type:"class" }, + { id:15, label:"org.rundeck.api.RundeckApiException.RundeckApiTokenException", link:"org/rundeck/api/RundeckApiException.RundeckApiTokenException.html", type:"class" }, + { id:16, label:"org.rundeck.api.RundeckClient", link:"org/rundeck/api/RundeckClient.html", type:"class" }, + { id:17, label:"org.rundeck.api.RundeckClient.Version", link:"org/rundeck/api/RundeckClient.Version.html", type:"class" }, + { id:18, label:"org.rundeck.api.RundeckClientBuilder", link:"org/rundeck/api/RundeckClientBuilder.html", type:"class" }, + { id:19, label:"org.rundeck.api.RundeckJobsImport", link:"org/rundeck/api/RundeckJobsImport.html", type:"class" }, + { id:20, label:"org.rundeck.api.RundeckJobsImportBuilder", link:"org/rundeck/api/RundeckJobsImportBuilder.html", type:"class" }, + { id:21, label:"org.rundeck.api.domain", link:"org/rundeck/api/domain/package-summary.html", type:"package" }, + { id:22, label:"org.rundeck.api.domain.RundeckAbort", link:"org/rundeck/api/domain/RundeckAbort.html", type:"class" }, + { id:23, label:"org.rundeck.api.domain.RundeckAbort.AbortStatus", link:"org/rundeck/api/domain/RundeckAbort.AbortStatus.html", type:"class" }, + { id:24, label:"org.rundeck.api.domain.RundeckEvent", link:"org/rundeck/api/domain/RundeckEvent.html", type:"class" }, + { id:25, label:"org.rundeck.api.domain.RundeckEvent.EventStatus", link:"org/rundeck/api/domain/RundeckEvent.EventStatus.html", type:"class" }, + { id:26, label:"org.rundeck.api.domain.RundeckEvent.NodeSummary", link:"org/rundeck/api/domain/RundeckEvent.NodeSummary.html", type:"class" }, + { id:27, label:"org.rundeck.api.domain.RundeckExecution", link:"org/rundeck/api/domain/RundeckExecution.html", type:"class" }, + { id:28, label:"org.rundeck.api.domain.RundeckExecution.ExecutionStatus", link:"org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html", type:"class" }, + { id:29, label:"org.rundeck.api.domain.RundeckHistory", link:"org/rundeck/api/domain/RundeckHistory.html", type:"class" }, + { id:30, label:"org.rundeck.api.domain.RundeckJob", link:"org/rundeck/api/domain/RundeckJob.html", type:"class" }, + { id:31, label:"org.rundeck.api.domain.RundeckJobDelete", link:"org/rundeck/api/domain/RundeckJobDelete.html", type:"class" }, + { id:32, label:"org.rundeck.api.domain.RundeckJobDeleteBulk", link:"org/rundeck/api/domain/RundeckJobDeleteBulk.html", type:"class" }, + { id:33, label:"org.rundeck.api.domain.RundeckJobsImportMethod", link:"org/rundeck/api/domain/RundeckJobsImportMethod.html", type:"class" }, + { id:34, label:"org.rundeck.api.domain.RundeckJobsImportResult", link:"org/rundeck/api/domain/RundeckJobsImportResult.html", type:"class" }, + { id:35, label:"org.rundeck.api.domain.RundeckNode", link:"org/rundeck/api/domain/RundeckNode.html", type:"class" }, + { id:36, label:"org.rundeck.api.domain.RundeckOutput", link:"org/rundeck/api/domain/RundeckOutput.html", type:"class" }, + { id:37, label:"org.rundeck.api.domain.RundeckOutputEntry", link:"org/rundeck/api/domain/RundeckOutputEntry.html", type:"class" }, + { id:38, label:"org.rundeck.api.domain.RundeckOutputEntry.RundeckLogLevel", link:"org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html", type:"class" }, + { id:39, label:"org.rundeck.api.domain.RundeckProject", link:"org/rundeck/api/domain/RundeckProject.html", type:"class" }, + { id:40, label:"org.rundeck.api.domain.RundeckSystemInfo", link:"org/rundeck/api/domain/RundeckSystemInfo.html", type:"class" }, + { id:41, label:"org.rundeck.api.parser", link:"org/rundeck/api/parser/package-summary.html", type:"package" }, + { id:42, label:"org.rundeck.api.parser.AbortParser", link:"org/rundeck/api/parser/AbortParser.html", type:"class" }, + { id:43, label:"org.rundeck.api.parser.BulkDeleteParser", link:"org/rundeck/api/parser/BulkDeleteParser.html", type:"class" }, + { id:44, label:"org.rundeck.api.parser.DeleteParser", link:"org/rundeck/api/parser/DeleteParser.html", type:"class" }, + { id:45, label:"org.rundeck.api.parser.EventParser", link:"org/rundeck/api/parser/EventParser.html", type:"class" }, + { id:46, label:"org.rundeck.api.parser.ExecutionParser", link:"org/rundeck/api/parser/ExecutionParser.html", type:"class" }, + { id:47, label:"org.rundeck.api.parser.HistoryParser", link:"org/rundeck/api/parser/HistoryParser.html", type:"class" }, + { id:48, label:"org.rundeck.api.parser.JobParser", link:"org/rundeck/api/parser/JobParser.html", type:"class" }, + { id:49, label:"org.rundeck.api.parser.JobsImportResultParser", link:"org/rundeck/api/parser/JobsImportResultParser.html", type:"class" }, + { id:50, label:"org.rundeck.api.parser.ListParser", link:"org/rundeck/api/parser/ListParser.html", type:"class" }, + { id:51, label:"org.rundeck.api.parser.NodeParser", link:"org/rundeck/api/parser/NodeParser.html", type:"class" }, + { id:52, label:"org.rundeck.api.parser.OutputEntryParser", link:"org/rundeck/api/parser/OutputEntryParser.html", type:"class" }, + { id:53, label:"org.rundeck.api.parser.OutputEntryParserV5", link:"org/rundeck/api/parser/OutputEntryParserV5.html", type:"class" }, + { id:54, label:"org.rundeck.api.parser.OutputParser", link:"org/rundeck/api/parser/OutputParser.html", type:"class" }, + { id:55, label:"org.rundeck.api.parser.PagedResultParser", link:"org/rundeck/api/parser/PagedResultParser.html", type:"class" }, + { id:56, label:"org.rundeck.api.parser.ParserHelper", link:"org/rundeck/api/parser/ParserHelper.html", type:"class" }, + { id:57, label:"org.rundeck.api.parser.ProjectParser", link:"org/rundeck/api/parser/ProjectParser.html", type:"class" }, + { id:58, label:"org.rundeck.api.parser.StringParser", link:"org/rundeck/api/parser/StringParser.html", type:"class" }, + { id:59, label:"org.rundeck.api.parser.SystemInfoParser", link:"org/rundeck/api/parser/SystemInfoParser.html", type:"class" }, + { id:60, label:"org.rundeck.api.parser.XmlNodeParser", link:"org/rundeck/api/parser/XmlNodeParser.html", type:"class" }, + { id:61, label:"org.rundeck.api.query", link:"org/rundeck/api/query/package-summary.html", type:"package" }, + { id:62, label:"org.rundeck.api.query.ExecutionQuery", link:"org/rundeck/api/query/ExecutionQuery.html", type:"class" }, + { id:63, label:"org.rundeck.api.query.ExecutionQuery.Builder", link:"org/rundeck/api/query/ExecutionQuery.Builder.html", type:"class" }, + { id:64, label:"org.rundeck.api.util", link:"org/rundeck/api/util/package-summary.html", type:"package" }, + { id:65, label:"org.rundeck.api.util.AssertUtil", link:"org/rundeck/api/util/AssertUtil.html", type:"class" }, + { id:66, label:"org.rundeck.api.util.PagedResults", link:"org/rundeck/api/util/PagedResults.html", type:"class" }, + { id:67, label:"org.rundeck.api.util.ParametersUtil", link:"org/rundeck/api/util/ParametersUtil.html", type:"class" } ]; diff --git a/apidocs/reference/org/rundeck/api/DefaultJobsImport.html b/apidocs/reference/org/rundeck/api/DefaultJobsImport.html new file mode 100644 index 0000000..9cf217c --- /dev/null +++ b/apidocs/reference/org/rundeck/api/DefaultJobsImport.html @@ -0,0 +1,1242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DefaultJobsImport + + +| RunDeck API - Java Client + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + + +
+ public + + + + class +

DefaultJobsImport

+ + + + + extends Object
+ + + + + + + implements + + RundeckJobsImport + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
java.lang.Object
   ↳org.rundeck.api.DefaultJobsImport
+ + + + + + + +
+ + +

Class Overview

+

$INTERFACE is ... User: greg Date: 8/6/13 Time: 10:18 AM +

+ + + + + +
+ + + + + + + + + + + + + + + + +
+ + +

Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Constructors
+ + + + + + + + DefaultJobsImport() + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ + + + + + FileType + + getFileType() + +
Return the file type
+ +
+ + + + + + RundeckJobsImportMethod + + getImportMethod() + +
Return the import behavior
+ +
+ + + + + + String + + getProject() + +
Return the project name
+ +
+ + + + + + InputStream + + getStream() + +
Return the input stream
+ +
+ + + + + + void + + setFileType(FileType fileType) + +
+ + + + + + void + + setImportMethod(RundeckJobsImportMethod importMethod) + +
+ + + + + + void + + setProject(String project) + +
+ + + + + + void + + setStream(InputStream stream) + +
+ + + + + + + + + + + + + + + + + + + + +
+ [Expand] +
Inherited Methods
+ +From class + + java.lang.Object + +
+ + +
+
+ +From interface + + org.rundeck.api.RundeckJobsImport + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Constructors

+ + + + + +
+

+ + public + + + + + + + DefaultJobsImport + () +

+
+
+ +
+ + + +
+
+ +

+ +
+
+ + + + + + + + + + + + + +

Public Methods

+ + + + + +
+

+ + public + + + + + FileType + + getFileType + () +

+
+
+ +
+ + + +
+
+ +

Return the file type

+ +
+
+ + + + +
+

+ + public + + + + + RundeckJobsImportMethod + + getImportMethod + () +

+
+
+ +
+ + + +
+
+ +

Return the import behavior

+ +
+
+ + + + +
+

+ + public + + + + + String + + getProject + () +

+
+
+ +
+ + + +
+
+ +

Return the project name

+ +
+
+ + + + +
+

+ + public + + + + + InputStream + + getStream + () +

+
+
+ +
+ + + +
+
+ +

Return the input stream

+ +
+
+ + + + +
+

+ + public + + + + + void + + setFileType + (FileType fileType) +

+
+
+ +
+ + + +
+
+ +

+ +
+
+ + + + +
+

+ + public + + + + + void + + setImportMethod + (RundeckJobsImportMethod importMethod) +

+
+
+ +
+ + + +
+
+ +

+ +
+
+ + + + +
+

+ + public + + + + + void + + setProject + (String project) +

+
+
+ +
+ + + +
+
+ +

+ +
+
+ + + + +
+

+ + public + + + + + void + + setStream + (InputStream stream) +

+
+
+ +
+ + + +
+
+ +

+ +
+
+ + + + + + + + + + + + + + +
+ +
+ +
+ + + + + diff --git a/apidocs/reference/org/rundeck/api/FileType.html b/apidocs/reference/org/rundeck/api/FileType.html index 6dab253..0bc1caa 100644 --- a/apidocs/reference/org/rundeck/api/FileType.html +++ b/apidocs/reference/org/rundeck/api/FileType.html @@ -158,13 +158,27 @@
    +
  • Interfaces

    + +
  • Classes

  • diff --git a/apidocs/reference/org/rundeck/api/NodeFiltersBuilder.html b/apidocs/reference/org/rundeck/api/NodeFiltersBuilder.html index ce564c4..543f65f 100644 --- a/apidocs/reference/org/rundeck/api/NodeFiltersBuilder.html +++ b/apidocs/reference/org/rundeck/api/NodeFiltersBuilder.html @@ -158,13 +158,27 @@
      +
    • Interfaces

      + +
    • Classes

    • diff --git a/apidocs/reference/org/rundeck/api/OptionsBuilder.html b/apidocs/reference/org/rundeck/api/OptionsBuilder.html index c400609..a0295d7 100644 --- a/apidocs/reference/org/rundeck/api/OptionsBuilder.html +++ b/apidocs/reference/org/rundeck/api/OptionsBuilder.html @@ -158,13 +158,27 @@

      Licenses

      LGPL: xom

      BSD style: Hamcrest Core

      Eclipse Public License - Version 1.0: Jetty :: Continuation, Jetty :: Http Utility, Jetty :: IO Utility, Jetty :: Server Core, Jetty :: Utilities

      Unknown: Groovy, dom4j, icu4j, jaxen, jdom, servlet-api, xalan, xercesImpl, xmlParserAPIs

      Apache License: HttpClient, HttpCore, HttpMime

      Apache Software License - Version 2.0: Jetty :: Continuation, Jetty :: Http Utility, Jetty :: IO Utility, Jetty :: Server Core, Jetty :: Utilities

      Common Public License Version 1.0: JUnit

      The Apache Software License, Version 2.0: Apache Log4j, Betamax - An HTTP stubbing proxy for testing JVM applications., Commons Codec, Commons IO, Commons Lang, Commons Logging, RunDeck API - Java Client, XML Commons External Components XML APIs

      Apache License Version 2.0: SnakeYAML

      Dependency File Details

      FilenameSizeEntriesClassesPackagesJDK RevDebugSealed
      betamax-1.0.jar160.45 kB685971.5debug-
      icu4j-2.6.1.jar2.34 MB75564861.2debug-
      commons-codec-1.4.jar56.80 kB473051.4debug-
      commons-io-2.1.jar159.33 kB12210461.5debug-
      commons-lang-2.6.jar277.56 kB155133101.3debug-
      commons-logging-1.1.1.jar59.26 kB422821.1debug-
      dom4j-1.6.1.jar306.54 kB208190141.3debug-
      servlet-api-2.5.jar102.65 kB684221.5debug-
      jaxen-1.1.1.jar221.60 kB236214171.2debug-
      jdom-1.0.jar149.66 kB877581.1debug-
      junit-4.10.jar247.23 kB290252311.5debug-
      log4j-1.2.16.jar470.25 kB346308201.1debug-
      httpclient-4.1.2.jar344.00 kB309273221.5debug-
      httpcore-4.1.2.jar176.95 kB185163101.3debug-
      httpmime-4.1.2.jar26.26 kB311521.5debug-
      groovy-all-1.8.4.jar5.86 MB3,8723,686961.5debug-
      jetty-continuation-7.5.1.v20110908.jar19.72 kB231111.5debug-
      jetty-http-7.5.1.v20110908.jar110.53 kB674941.5debug-
      jetty-io-7.5.1.v20110908.jar90.57 kB695531.5debug-
      jetty-server-7.5.1.v20110908.jar296.87 kB17513991.5debug-
      jetty-util-7.5.1.v20110908.jar208.08 kB14012081.5debug-
      hamcrest-core-1.1.jar74.85 kB542131.5debug-
      snakeyaml-1.9.jar259.59 kB238202191.5debug-
      xalan-2.6.0.jar3.00 MB1,6251,548501.1debug-
      xercesImpl-2.6.2.jar986.99 kB845784371.1release-
      xmlParserAPIs-2.6.2.jar121.80 kB238207171.1release-
      xml-apis-1.0.b2.jar106.76 kB217184171.2release-
      xom-1.0.jar106.32 kB1089661.2releasesealed
      TotalSizeEntriesClassesPackagesJDK RevDebugSealed
      2816.22 MB10,6209,6364321.5241
      compile: 16compile: 8.37 MBcompile: 5,210compile: 4,692compile: 229-compile: 12compile: 1
      test: 12test: 7.85 MBtest: 5,410test: 4,944test: 203-test: 12-

      Dependency Repository Locations

      Repo IDURLReleaseSnapshot
      sonatype-snapshotshttp://oss.sonatype.org/content/groups/jettyYesYes-
      apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes-
      sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes-
      sonatype-public-gridhttp://repository.sonatype.org/content/groups/sonatype-public-grid/YesYes-
      centralhttp://repo1.maven.org/maven2Yes--

      Repository locations for each of the Dependencies.

      Artifactsonatype-snapshotsapache.snapshotssonatype-nexus-snapshotssonatype-public-gridcentral
      com.github.robfletcher:betamax:jar:1.0---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      com.ibm.icu:icu4j:jar:2.6.1---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      commons-codec:commons-codec:jar:1.4---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      commons-io:commons-io:jar:2.1---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      commons-lang:commons-lang:jar:2.6---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      commons-logging:commons-logging:jar:1.1.1---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      dom4j:dom4j:jar:1.6.1---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      javax.servlet:servlet-api:jar:2.5---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      jaxen:jaxen:jar:1.1.1---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      jdom:jdom:jar:1.0---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      junit:junit:jar:4.10---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      log4j:log4j:jar:1.2.16---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.apache.httpcomponents:httpclient:jar:4.1.2---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.apache.httpcomponents:httpcore:jar:4.1.2---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.apache.httpcomponents:httpmime:jar:4.1.2---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.codehaus.groovy:groovy-all:jar:1.8.4---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.eclipse.jetty:jetty-continuation:jar:7.5.1.v20110908Found at http://oss.sonatype.org/content/groups/jetty--Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.eclipse.jetty:jetty-http:jar:7.5.1.v20110908Found at http://oss.sonatype.org/content/groups/jetty--Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.eclipse.jetty:jetty-io:jar:7.5.1.v20110908Found at http://oss.sonatype.org/content/groups/jetty--Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.eclipse.jetty:jetty-server:jar:7.5.1.v20110908Found at http://oss.sonatype.org/content/groups/jetty--Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.eclipse.jetty:jetty-util:jar:7.5.1.v20110908Found at http://oss.sonatype.org/content/groups/jetty--Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.hamcrest:hamcrest-core:jar:1.1---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      org.yaml:snakeyaml:jar:1.9---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      xalan:xalan:jar:2.6.0---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      xerces:xercesImpl:jar:2.6.2---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      xerces:xmlParserAPIs:jar:2.6.2---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      xml-apis:xml-apis:jar:1.0.b2---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      xom:xom:jar:1.0---Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
      Totalsonatype-snapshotsapache.snapshotssonatype-nexus-snapshotssonatype-public-gridcentral
      28 (compile: 16, test: 12)5002828
diff --git a/dependency-updates-report.html b/dependency-updates-report.html index 85ec7e1..c72484e 100644 --- a/dependency-updates-report.html +++ b/dependency-updates-report.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Dependency Updates Report
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • @@ -157,7 +157,7 @@
    -

    Overview

    This report summarizes newer versions that may be available for your project's various dependencies.

    # of dependencies using the latest version available2
    # of dependencies where the next version available is smaller than an incremental version update1
    # of dependencies where the next version available is an incremental version update5
    # of dependencies where the next version available is a minor version update1
    # of dependencies where the next version available is a major version update0

    Dependency Management

    This project does not declare any dependencies in a dependencyManagement section.

    Dependencies

    StatusGroup IdArtifact IdCurrent VersionScopeClassifierTypeNext VersionNext IncrementalNext MinorNext Major
    com.github.robfletcherbetamax1.0testjar
    commons-iocommons-io2.1compilejar2.2
    commons-langcommons-lang2.6compilejar
    dom4jdom4j1.6.1compilejar1.6.1-hudson-320040902.021138
    jaxenjaxen1.1.1compilejar1.1.3
    junitjunit4.10testjar4.11-beta-14.11
    org.apache.httpcomponentshttpclient4.1.2compilejar4.1.34.2
    org.apache.httpcomponentshttpmime4.1.2compilejar4.1.34.2
    org.codehaus.groovygroovy-all1.8.4testjar1.8.52.0.0-beta-12.0.0
    StatusGroup IdArtifact IdCurrent VersionScopeClassifierTypeNext VersionNext IncrementalNext MinorNext Major

    Dependency Updates

    com.github.robfletcher:betamax

    Status No newer versions available.
    Group Idcom.github.robfletcher
    Artifact Idbetamax
    Current Version1.0
    Scopetest
    Classifier
    Typejar

    commons-io:commons-io

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idcommons-io
    Artifact Idcommons-io
    Current Version2.1
    Scopecompile
    Classifier
    Typejar
    Newer versions2.2 Next Minor
    2.3
    2.4 Latest Minor

    commons-lang:commons-lang

    Status No newer versions available.
    Group Idcommons-lang
    Artifact Idcommons-lang
    Current Version2.6
    Scopecompile
    Classifier
    Typejar

    dom4j:dom4j

    Status There is at least one newer version available.
    Group Iddom4j
    Artifact Iddom4j
    Current Version1.6.1
    Scopecompile
    Classifier
    Typejar
    Newer versions1.6.1-hudson-3 Next Version
    1.6.1-patch
    20040902.021138 Next Major

    jaxen:jaxen

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idjaxen
    Artifact Idjaxen
    Current Version1.1.1
    Scopecompile
    Classifier
    Typejar
    Newer versions1.1.3 Next Incremental
    1.1.4 Latest Incremental

    junit:junit

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idjunit
    Artifact Idjunit
    Current Version4.10
    Scopetest
    Classifier
    Typejar
    Newer versions4.11-beta-1 Next Incremental
    4.11 Next Minor

    org.apache.httpcomponents:httpclient

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.httpcomponents
    Artifact Idhttpclient
    Current Version4.1.2
    Scopecompile
    Classifier
    Typejar
    Newer versions4.1.3 Next Incremental
    4.2-alpha1
    4.2-beta1 Latest Incremental
    4.2 Next Minor
    4.2.1
    4.2.1-atlassian-1
    4.2.1-atlassian-2
    4.2.2
    4.2.3
    4.3-alpha1 Latest Minor

    org.apache.httpcomponents:httpmime

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.httpcomponents
    Artifact Idhttpmime
    Current Version4.1.2
    Scopecompile
    Classifier
    Typejar
    Newer versions4.1.3 Next Incremental
    4.2-alpha1
    4.2-beta1 Latest Incremental
    4.2 Next Minor
    4.2.1
    4.2.1-atlassian-1
    4.2.1-atlassian-2
    4.2.2
    4.2.3
    4.3-alpha1 Latest Minor

    org.codehaus.groovy:groovy-all

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.codehaus.groovy
    Artifact Idgroovy-all
    Current Version1.8.4
    Scopetest
    Classifier
    Typejar
    Newer versions1.8.5 Next Incremental
    1.8.6
    1.8.7
    1.8.8
    1.8.9
    1.9.0-beta-1
    1.9.0-beta-2
    1.9.0-beta-3
    1.9.0-beta-4 Latest Incremental
    2.0.0-beta-1 Next Minor
    2.0.0-beta-2
    2.0.0-beta-3
    2.0.0-rc-1
    2.0.0-rc-2
    2.0.0-rc-3
    2.0.0-rc-4 Latest Minor
    2.0.0 Next Major
    2.0.1
    2.0.2
    2.0.3
    2.0.4
    2.0.5
    2.0.6
    2.0.7
    2.1.0-beta-1
    2.1.0-rc-1
    2.1.0-rc-2
    2.1.0-rc-3
    2.1.0
    2.1.1 Latest Major
    +

    Overview

    This report summarizes newer versions that may be available for your project's various dependencies.

    # of dependencies using the latest version available2
    # of dependencies where the next version available is smaller than an incremental version update1
    # of dependencies where the next version available is an incremental version update5
    # of dependencies where the next version available is a minor version update1
    # of dependencies where the next version available is a major version update0

    Dependency Management

    This project does not declare any dependencies in a dependencyManagement section.

    Dependencies

    StatusGroup IdArtifact IdCurrent VersionScopeClassifierTypeNext VersionNext IncrementalNext MinorNext Major
    com.github.robfletcherbetamax1.0testjar
    commons-iocommons-io2.1compilejar2.2
    commons-langcommons-lang2.6compilejar
    dom4jdom4j1.6.1compilejar1.6.1-hudson-320040902.021138
    jaxenjaxen1.1.1compilejar1.1.3
    junitjunit4.10testjar4.11-beta-14.11
    org.apache.httpcomponentshttpclient4.1.2compilejar4.1.34.2
    org.apache.httpcomponentshttpmime4.1.2compilejar4.1.34.2
    org.codehaus.groovygroovy-all1.8.4testjar1.8.52.0.0-beta-12.0.0
    StatusGroup IdArtifact IdCurrent VersionScopeClassifierTypeNext VersionNext IncrementalNext MinorNext Major

    Dependency Updates

    com.github.robfletcher:betamax

    Status No newer versions available.
    Group Idcom.github.robfletcher
    Artifact Idbetamax
    Current Version1.0
    Scopetest
    Classifier
    Typejar

    commons-io:commons-io

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idcommons-io
    Artifact Idcommons-io
    Current Version2.1
    Scopecompile
    Classifier
    Typejar
    Newer versions2.2 Next Minor
    2.3
    2.4 Latest Minor

    commons-lang:commons-lang

    Status No newer versions available.
    Group Idcommons-lang
    Artifact Idcommons-lang
    Current Version2.6
    Scopecompile
    Classifier
    Typejar

    dom4j:dom4j

    Status There is at least one newer version available.
    Group Iddom4j
    Artifact Iddom4j
    Current Version1.6.1
    Scopecompile
    Classifier
    Typejar
    Newer versions1.6.1-hudson-3 Next Version
    1.6.1-patch
    20040902.021138 Next Major

    jaxen:jaxen

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idjaxen
    Artifact Idjaxen
    Current Version1.1.1
    Scopecompile
    Classifier
    Typejar
    Newer versions1.1.3 Next Incremental
    1.1.4 Latest Incremental

    junit:junit

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idjunit
    Artifact Idjunit
    Current Version4.10
    Scopetest
    Classifier
    Typejar
    Newer versions4.11-beta-1 Next Incremental
    4.11 Next Minor

    org.apache.httpcomponents:httpclient

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.httpcomponents
    Artifact Idhttpclient
    Current Version4.1.2
    Scopecompile
    Classifier
    Typejar
    Newer versions4.1.3 Next Incremental
    4.2-alpha1
    4.2-beta1 Latest Incremental
    4.2 Next Minor
    4.2.1
    4.2.1-atlassian-1
    4.2.1-atlassian-2
    4.2.2
    4.2.3
    4.2.4
    4.2.5
    4.3-alpha1
    4.3-beta1
    4.3-beta2 Latest Minor

    org.apache.httpcomponents:httpmime

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.httpcomponents
    Artifact Idhttpmime
    Current Version4.1.2
    Scopecompile
    Classifier
    Typejar
    Newer versions4.1.3 Next Incremental
    4.2-alpha1
    4.2-beta1 Latest Incremental
    4.2 Next Minor
    4.2.1
    4.2.1-atlassian-1
    4.2.1-atlassian-2
    4.2.2
    4.2.3
    4.2.4
    4.2.5
    4.3-alpha1
    4.3-beta1
    4.3-beta2 Latest Minor

    org.codehaus.groovy:groovy-all

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.codehaus.groovy
    Artifact Idgroovy-all
    Current Version1.8.4
    Scopetest
    Classifier
    Typejar
    Newer versions1.8.5 Next Incremental
    1.8.6
    1.8.7
    1.8.8
    1.8.9
    1.9.0-beta-1
    1.9.0-beta-2
    1.9.0-beta-3
    1.9.0-beta-4 Latest Incremental
    2.0.0-beta-1 Next Minor
    2.0.0-beta-2
    2.0.0-beta-3
    2.0.0-rc-1
    2.0.0-rc-2
    2.0.0-rc-3
    2.0.0-rc-4 Latest Minor
    2.0.0 Next Major
    2.0.1
    2.0.2
    2.0.3
    2.0.4
    2.0.5
    2.0.6
    2.0.7
    2.0.8
    2.1.0-beta-1
    2.1.0-rc-1
    2.1.0-rc-2
    2.1.0-rc-3
    2.1.0
    2.1.1
    2.1.2
    2.1.3
    2.1.4
    2.1.5
    2.1.6
    2.2.0-beta-1 Latest Major
    diff --git a/distribution-management.html b/distribution-management.html index 5df3a1b..72e4a75 100644 --- a/distribution-management.html +++ b/distribution-management.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Project Distribution Management
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/download.html b/download.html index 896c6c0..b34b987 100644 --- a/download.html +++ b/download.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/faq.html b/faq.html index 11f03b9..46ae798 100644 --- a/faq.html +++ b/faq.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Frequently Asked Questions
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/findbugs.html b/findbugs.html index aeb2bc5..72abc86 100644 --- a/findbugs.html +++ b/findbugs.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • FindBugs Bug Detector Report
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • @@ -157,7 +157,7 @@
    -

    FindBugs Bug Detector Report

    The following document contains the results of FindBugs Report

    FindBugs Version is 1.3.9

    Threshold is medium

    Effort is min

    Summary

    ClassesBugsErrorsMissing Classes
    62200

    org.rundeck.api.query.ExecutionQuery

    BugCategoryDetailsLinePriority
    org.rundeck.api.query.ExecutionQuery.getBegin() may expose internal representation by returning ExecutionQuery.beginMALICIOUS_CODEEI_EXPOSE_REP139Medium
    org.rundeck.api.query.ExecutionQuery.getEnd() may expose internal representation by returning ExecutionQuery.endMALICIOUS_CODEEI_EXPOSE_REP143Medium
    +

    FindBugs Bug Detector Report

    The following document contains the results of FindBugs Report

    FindBugs Version is 1.3.9

    Threshold is medium

    Effort is min

    Summary

    ClassesBugsErrorsMissing Classes
    76200

    org.rundeck.api.query.ExecutionQuery

    BugCategoryDetailsLinePriority
    org.rundeck.api.query.ExecutionQuery.getBegin() may expose internal representation by returning ExecutionQuery.beginMALICIOUS_CODEEI_EXPOSE_REP139Medium
    org.rundeck.api.query.ExecutionQuery.getEnd() may expose internal representation by returning ExecutionQuery.endMALICIOUS_CODEEI_EXPOSE_REP143Medium
    diff --git a/groovy.html b/groovy.html index 9be8fa1..2d9b53c 100644 --- a/groovy.html +++ b/groovy.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/index.html b/index.html index e5f67fc..afb63a4 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/integration.html b/integration.html index 82bd473..3ca18b6 100644 --- a/integration.html +++ b/integration.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Continuous Integration
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/issue-tracking.html b/issue-tracking.html index 3a88abf..23cda90 100644 --- a/issue-tracking.html +++ b/issue-tracking.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Issue Tracking
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/jruby.html b/jruby.html index 7f4fa9a..fdf0a3c 100644 --- a/jruby.html +++ b/jruby.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/jython.html b/jython.html index 9d9e3c8..633d527 100644 --- a/jython.html +++ b/jython.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/license.html b/license.html index ef47e21..94dfb75 100644 --- a/license.html +++ b/license.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Project License
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/mail-lists.html b/mail-lists.html index 6402c26..5eaef3e 100644 --- a/mail-lists.html +++ b/mail-lists.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Project Mailing Lists
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/plugin-updates-report.html b/plugin-updates-report.html index 5abfa84..a500c18 100644 --- a/plugin-updates-report.html +++ b/plugin-updates-report.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Plugin Updates Report
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • @@ -157,7 +157,7 @@
    -

    Overview

    This report summarizes newer versions that may be available for your project's various plugins.

    # of plugins using the latest version available4
    # of plugins where the next version available is smaller than an incremental version update0
    # of plugins where the next version available is an incremental version update3
    # of plugins where the next version available is a minor version update14
    # of plugins where the next version available is a major version update0
    # of plugins where a dependencies section containes a dependency with an updated version0

    Plugin Management

    StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status
    org.apache.maven.pluginsmaven-antrun-plugin1.7
    org.apache.maven.pluginsmaven-assembly-plugin2.2.22.3
    org.apache.maven.pluginsmaven-checkstyle-plugin2.82.9
    org.apache.maven.pluginsmaven-clean-plugin2.4.12.5
    org.apache.maven.pluginsmaven-compiler-plugin2.3.22.43.0
    org.apache.maven.pluginsmaven-dependency-plugin2.32.4
    org.apache.maven.pluginsmaven-deploy-plugin2.7
    org.apache.maven.pluginsmaven-eclipse-plugin2.82.9
    org.apache.maven.pluginsmaven-enforcer-plugin1.0.11.1
    org.apache.maven.pluginsmaven-gpg-plugin1.4
    org.apache.maven.pluginsmaven-help-plugin2.1.1
    org.apache.maven.pluginsmaven-install-plugin2.3.12.4
    org.apache.maven.pluginsmaven-jar-plugin2.3.22.4
    org.apache.maven.pluginsmaven-javadoc-plugin2.82.8.12.9
    org.apache.maven.pluginsmaven-pmd-plugin2.62.7
    org.apache.maven.pluginsmaven-release-plugin2.2.12.2.22.3
    org.apache.maven.pluginsmaven-resources-plugin2.52.6
    org.apache.maven.pluginsmaven-site-plugin3.03.1
    org.apache.maven.pluginsmaven-source-plugin2.1.22.2
    org.apache.maven.pluginsmaven-surefire-plugin2.102.11
    org.codehaus.mojofindbugs-maven-plugin2.3.22.3.32.4.0
    StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status

    Plugins

    This project does not declare any plugins in a build/plugins setcion.

    Plugin Updates

    Plugin org.apache.maven.plugins:maven-antrun-plugin

    Status No newer versions available.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-antrun-plugin
    Current Version1.7

    Plugin org.apache.maven.plugins:maven-assembly-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-assembly-plugin
    Current Version2.2.2
    Newer versions2.3 Next Minor
    2.4 Latest Minor

    Plugin org.apache.maven.plugins:maven-checkstyle-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-checkstyle-plugin
    Current Version2.8
    Newer versions2.9 Next Minor
    2.9.1 Latest Minor

    Plugin org.apache.maven.plugins:maven-clean-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-clean-plugin
    Current Version2.4.1
    Newer versions2.5 Next Minor

    Plugin org.apache.maven.plugins:maven-compiler-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-compiler-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor
    2.5
    2.5.1 Latest Minor
    3.0 Next Major

    Plugin org.apache.maven.plugins:maven-dependency-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-dependency-plugin
    Current Version2.3
    Newer versions2.4 Next Minor
    2.5
    2.5.1
    2.6 Latest Minor

    Plugin org.apache.maven.plugins:maven-deploy-plugin

    Status No newer versions available.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-deploy-plugin
    Current Version2.7

    Plugin org.apache.maven.plugins:maven-eclipse-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-eclipse-plugin
    Current Version2.8
    Newer versions2.9 Next Minor

    Plugin org.apache.maven.plugins:maven-enforcer-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-enforcer-plugin
    Current Version1.0.1
    Newer versions1.1 Next Minor
    1.1.1
    1.2 Latest Minor

    Plugin org.apache.maven.plugins:maven-gpg-plugin

    Status No newer versions available.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-gpg-plugin
    Current Version1.4

    Plugin org.apache.maven.plugins:maven-help-plugin

    Status No newer versions available.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-help-plugin
    Current Version2.1.1

    Plugin org.apache.maven.plugins:maven-install-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-install-plugin
    Current Version2.3.1
    Newer versions2.4 Next Minor

    Plugin org.apache.maven.plugins:maven-jar-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-jar-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor

    Plugin org.apache.maven.plugins:maven-javadoc-plugin

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-javadoc-plugin
    Current Version2.8
    Newer versions2.8.1 Next Incremental
    2.9 Next Minor

    Plugin org.apache.maven.plugins:maven-pmd-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-pmd-plugin
    Current Version2.6
    Newer versions2.7 Next Minor
    2.7.1 Latest Minor

    Plugin org.apache.maven.plugins:maven-release-plugin

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-release-plugin
    Current Version2.2.1
    Newer versions2.2.2 Next Incremental
    2.3 Next Minor
    2.3.1
    2.3.2
    2.4 Latest Minor

    Plugin org.apache.maven.plugins:maven-resources-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-resources-plugin
    Current Version2.5
    Newer versions2.6 Next Minor

    Plugin org.apache.maven.plugins:maven-site-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-site-plugin
    Current Version3.0
    Newer versions3.1 Next Minor
    3.2 Latest Minor

    Plugin org.apache.maven.plugins:maven-source-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-source-plugin
    Current Version2.1.2
    Newer versions2.2 Next Minor
    2.2.1 Latest Minor

    Plugin org.apache.maven.plugins:maven-surefire-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-surefire-plugin
    Current Version2.10
    Newer versions2.11 Next Minor
    2.12
    2.12.1
    2.12.2
    2.12.3
    2.12.4
    2.13 Latest Minor

    Plugin org.codehaus.mojo:findbugs-maven-plugin

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.codehaus.mojo
    Artifact Idfindbugs-maven-plugin
    Current Version2.3.2
    Newer versions2.3.3 Next Incremental
    2.4.0 Next Minor
    2.5
    2.5.1
    2.5.2 Latest Minor
    +

    Overview

    This report summarizes newer versions that may be available for your project's various plugins.

    # of plugins using the latest version available3
    # of plugins where the next version available is smaller than an incremental version update0
    # of plugins where the next version available is an incremental version update3
    # of plugins where the next version available is a minor version update15
    # of plugins where the next version available is a major version update0
    # of plugins where a dependencies section containes a dependency with an updated version0

    Plugin Management

    StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status
    org.apache.maven.pluginsmaven-antrun-plugin1.7
    org.apache.maven.pluginsmaven-assembly-plugin2.2.22.3
    org.apache.maven.pluginsmaven-checkstyle-plugin2.82.9
    org.apache.maven.pluginsmaven-clean-plugin2.4.12.5
    org.apache.maven.pluginsmaven-compiler-plugin2.3.22.43.0
    org.apache.maven.pluginsmaven-dependency-plugin2.32.4
    org.apache.maven.pluginsmaven-deploy-plugin2.7
    org.apache.maven.pluginsmaven-eclipse-plugin2.82.9
    org.apache.maven.pluginsmaven-enforcer-plugin1.0.11.1
    org.apache.maven.pluginsmaven-gpg-plugin1.4
    org.apache.maven.pluginsmaven-help-plugin2.1.12.2
    org.apache.maven.pluginsmaven-install-plugin2.3.12.4
    org.apache.maven.pluginsmaven-jar-plugin2.3.22.4
    org.apache.maven.pluginsmaven-javadoc-plugin2.82.8.12.9
    org.apache.maven.pluginsmaven-pmd-plugin2.62.73.0
    org.apache.maven.pluginsmaven-release-plugin2.2.12.2.22.3
    org.apache.maven.pluginsmaven-resources-plugin2.52.6
    org.apache.maven.pluginsmaven-site-plugin3.03.1
    org.apache.maven.pluginsmaven-source-plugin2.1.22.2
    org.apache.maven.pluginsmaven-surefire-plugin2.102.11
    org.codehaus.mojofindbugs-maven-plugin2.3.22.3.32.4.0
    StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status

    Plugins

    This project does not declare any plugins in a build/plugins setcion.

    Plugin Updates

    Plugin org.apache.maven.plugins:maven-antrun-plugin

    Status No newer versions available.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-antrun-plugin
    Current Version1.7

    Plugin org.apache.maven.plugins:maven-assembly-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-assembly-plugin
    Current Version2.2.2
    Newer versions2.3 Next Minor
    2.4 Latest Minor

    Plugin org.apache.maven.plugins:maven-checkstyle-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-checkstyle-plugin
    Current Version2.8
    Newer versions2.9 Next Minor
    2.9.1
    2.10 Latest Minor

    Plugin org.apache.maven.plugins:maven-clean-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-clean-plugin
    Current Version2.4.1
    Newer versions2.5 Next Minor

    Plugin org.apache.maven.plugins:maven-compiler-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-compiler-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor
    2.5
    2.5.1 Latest Minor
    3.0 Next Major
    3.1 Latest Major

    Plugin org.apache.maven.plugins:maven-dependency-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-dependency-plugin
    Current Version2.3
    Newer versions2.4 Next Minor
    2.5
    2.5.1
    2.6
    2.7
    2.8 Latest Minor

    Plugin org.apache.maven.plugins:maven-deploy-plugin

    Status No newer versions available.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-deploy-plugin
    Current Version2.7

    Plugin org.apache.maven.plugins:maven-eclipse-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-eclipse-plugin
    Current Version2.8
    Newer versions2.9 Next Minor

    Plugin org.apache.maven.plugins:maven-enforcer-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-enforcer-plugin
    Current Version1.0.1
    Newer versions1.1 Next Minor
    1.1.1
    1.2
    1.3 Latest Minor

    Plugin org.apache.maven.plugins:maven-gpg-plugin

    Status No newer versions available.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-gpg-plugin
    Current Version1.4

    Plugin org.apache.maven.plugins:maven-help-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-help-plugin
    Current Version2.1.1
    Newer versions2.2 Next Minor

    Plugin org.apache.maven.plugins:maven-install-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-install-plugin
    Current Version2.3.1
    Newer versions2.4 Next Minor

    Plugin org.apache.maven.plugins:maven-jar-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-jar-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor

    Plugin org.apache.maven.plugins:maven-javadoc-plugin

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-javadoc-plugin
    Current Version2.8
    Newer versions2.8.1 Next Incremental
    2.9 Next Minor
    2.9.1 Latest Minor

    Plugin org.apache.maven.plugins:maven-pmd-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-pmd-plugin
    Current Version2.6
    Newer versions2.7 Next Minor
    2.7.1 Latest Minor
    3.0 Next Major
    3.0.1 Latest Major

    Plugin org.apache.maven.plugins:maven-release-plugin

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-release-plugin
    Current Version2.2.1
    Newer versions2.2.2 Next Incremental
    2.3 Next Minor
    2.3.1
    2.3.2
    2.4
    2.4.1 Latest Minor

    Plugin org.apache.maven.plugins:maven-resources-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-resources-plugin
    Current Version2.5
    Newer versions2.6 Next Minor

    Plugin org.apache.maven.plugins:maven-site-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-site-plugin
    Current Version3.0
    Newer versions3.1 Next Minor
    3.2
    3.3 Latest Minor

    Plugin org.apache.maven.plugins:maven-source-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-source-plugin
    Current Version2.1.2
    Newer versions2.2 Next Minor
    2.2.1 Latest Minor

    Plugin org.apache.maven.plugins:maven-surefire-plugin

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Group Idorg.apache.maven.plugins
    Artifact Idmaven-surefire-plugin
    Current Version2.10
    Newer versions2.11 Next Minor
    2.12
    2.12.1
    2.12.2
    2.12.3
    2.12.4
    2.13
    2.14
    2.14.1
    2.15 Latest Minor

    Plugin org.codehaus.mojo:findbugs-maven-plugin

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Group Idorg.codehaus.mojo
    Artifact Idfindbugs-maven-plugin
    Current Version2.3.2
    Newer versions2.3.3 Next Incremental
    2.4.0 Next Minor
    2.5
    2.5.1
    2.5.2 Latest Minor
    diff --git a/pmd.html b/pmd.html index 8877116..c954248 100644 --- a/pmd.html +++ b/pmd.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • PMD Results
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/pmd.xml b/pmd.xml index d4912a1..7a10884 100644 --- a/pmd.xml +++ b/pmd.xml @@ -1,5 +1,5 @@ - + Avoid unused imports such as 'org.rundeck.api.domain.RundeckExecution.ExecutionStatus' diff --git a/project-info.html b/project-info.html index b16beb4..a7a6416 100644 --- a/project-info.html +++ b/project-info.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Project Information
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/project-reports.html b/project-reports.html index 4152dbb..0a2f7ff 100644 --- a/project-reports.html +++ b/project-reports.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Generated Reports
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/project-summary.html b/project-summary.html index 4c2b20d..f1b0771 100644 --- a/project-summary.html +++ b/project-summary.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Project Summary
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • @@ -151,7 +151,7 @@
    -

    Project Summary

    Project Information

    FieldValue
    NameRunDeck API - Java Client
    DescriptionJava client for the RunDeck REST API
    Homepagehttp://rundeck.github.com/rundeck-api-java-client

    Project Organization

    This project does not belong to an organization.

    Build Information

    FieldValue
    GroupIdorg.rundeck
    ArtifactIdrundeck-api-java-client
    Version6.0
    Typejar
    JDK Rev1.6
    +

    Project Summary

    Project Information

    FieldValue
    NameRunDeck API - Java Client
    DescriptionJava client for the RunDeck REST API
    Homepagehttp://rundeck.github.com/rundeck-api-java-client

    Project Organization

    This project does not belong to an organization.

    Build Information

    FieldValue
    GroupIdorg.rundeck
    ArtifactIdrundeck-api-java-client
    Version8.0
    Typejar
    JDK Rev1.6
    diff --git a/property-updates-report.html b/property-updates-report.html index a1bfb54..108f4eb 100644 --- a/property-updates-report.html +++ b/property-updates-report.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Property Updates Report
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • @@ -157,7 +157,7 @@
    -

    Overview

    This report summarizes newer versions that may be available for your project's various properties associated with artifacts.

    # of properties using the latest version available6
    # of properties where the next version available is smaller than an incremental version update0
    # of properties where the next version available is an incremental version update3
    # of properties where the next version available is a minor version update17
    # of properties where the next version available is a major version update0

    Summary of properties sssociated with artifact versions

    StatusPropertyCurrent VersionNext VersionNext IncrementalNext MinorNext Major
    ${plugin.findbugs.version}2.3.22.3.32.4.0
    ${plugin.clean.version}2.4.12.5
    ${plugin.enforcer.version}1.0.11.1
    ${plugin.install.version}2.3.12.4
    ${plugin.release.version}2.2.12.2.22.3
    ${plugin.resources.version}2.52.6
    ${plugin.assembly.version}2.2.22.3
    ${plugin.antrun.version}1.7
    ${plugin.site.version}3.03.1
    ${plugin.versions.version}1.21.32.0
    ${plugin.project-info-reports.version}2.42.5
    ${plugin.javadoc.version}2.82.8.12.9
    ${plugin.taglist.version}2.4
    ${plugin.eclipse.version}2.82.9
    ${plugin.help.version}2.1.1
    ${plugin.source.version}2.1.22.2
    ${plugin.surefire.version}2.102.11
    ${plugin.compiler.version}2.3.22.43.0
    ${plugin.pmd.version}2.62.7
    ${plugin.jxr.version}2.3
    ${plugin.gpg.version}1.4
    ${plugin.checkstyle.version}2.82.9
    ${plugin.changes.version}2.62.7
    ${plugin.deploy.version}2.7
    ${plugin.dependency.version}2.32.4
    ${plugin.jar.version}2.3.22.4
    StatusPropertyCurrent VersionNext VersionNext IncrementalNext MinorNext Major

    Properties sssociated with artifact versions

    ${plugin.antrun.version}

    Status No newer versions available.
    Property${plugin.antrun.version}
    Associated artifactsorg.apache.maven.plugins:maven-antrun-plugin
    Current Version1.7
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.assembly.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.assembly.version}
    Associated artifactsorg.apache.maven.plugins:maven-assembly-plugin
    Current Version2.2.2
    Newer versions2.3 Next Minor
    2.4 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.changes.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.changes.version}
    Associated artifactsorg.apache.maven.plugins:maven-changes-plugin
    Current Version2.6
    Newer versions2.7 Next Minor
    2.7.1
    2.8 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.checkstyle.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.checkstyle.version}
    Associated artifactsorg.apache.maven.plugins:maven-checkstyle-plugin
    Current Version2.8
    Newer versions2.9 Next Minor
    2.9.1 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.clean.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.clean.version}
    Associated artifactsorg.apache.maven.plugins:maven-clean-plugin
    Current Version2.4.1
    Newer versions2.5 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.compiler.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.compiler.version}
    Associated artifactsorg.apache.maven.plugins:maven-compiler-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor
    2.5
    2.5.1 Latest Minor
    3.0 Next Major
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.dependency.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.dependency.version}
    Associated artifactsorg.apache.maven.plugins:maven-dependency-plugin
    Current Version2.3
    Newer versions2.4 Next Minor
    2.5
    2.5.1
    2.6 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.deploy.version}

    Status No newer versions available.
    Property${plugin.deploy.version}
    Associated artifactsorg.apache.maven.plugins:maven-deploy-plugin
    Current Version2.7
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.eclipse.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.eclipse.version}
    Associated artifactsorg.apache.maven.plugins:maven-eclipse-plugin
    Current Version2.8
    Newer versions2.9 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.enforcer.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.enforcer.version}
    Associated artifactsorg.apache.maven.plugins:maven-enforcer-plugin
    Current Version1.0.1
    Newer versions1.1 Next Minor
    1.1.1
    1.2 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.findbugs.version}

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Property${plugin.findbugs.version}
    Associated artifactsorg.codehaus.mojo:findbugs-maven-plugin
    Current Version2.3.2
    Newer versions2.3.3 Next Incremental
    2.4.0 Next Minor
    2.5
    2.5.1
    2.5.2 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.gpg.version}

    Status No newer versions available.
    Property${plugin.gpg.version}
    Associated artifactsorg.apache.maven.plugins:maven-gpg-plugin
    Current Version1.4
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.help.version}

    Status No newer versions available.
    Property${plugin.help.version}
    Associated artifactsorg.apache.maven.plugins:maven-help-plugin
    Current Version2.1.1
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.install.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.install.version}
    Associated artifactsorg.apache.maven.plugins:maven-install-plugin
    Current Version2.3.1
    Newer versions2.4 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.jar.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.jar.version}
    Associated artifactsorg.apache.maven.plugins:maven-jar-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.javadoc.version}

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Property${plugin.javadoc.version}
    Associated artifactsorg.apache.maven.plugins:maven-javadoc-plugin
    Current Version2.8
    Newer versions2.8.1 Next Incremental
    2.9 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.jxr.version}

    Status No newer versions available.
    Property${plugin.jxr.version}
    Associated artifactsorg.apache.maven.plugins:maven-jxr-plugin
    Current Version2.3
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.pmd.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.pmd.version}
    Associated artifactsorg.apache.maven.plugins:maven-pmd-plugin
    Current Version2.6
    Newer versions2.7 Next Minor
    2.7.1 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.project-info-reports.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.project-info-reports.version}
    Associated artifactsorg.apache.maven.plugins:maven-project-info-reports-plugin
    Current Version2.4
    Newer versions2.5 Next Minor
    2.5.1
    2.6 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.release.version}

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Property${plugin.release.version}
    Associated artifactsorg.apache.maven.plugins:maven-release-plugin
    Current Version2.2.1
    Newer versions2.2.2 Next Incremental
    2.3 Next Minor
    2.3.1
    2.3.2
    2.4 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.resources.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.resources.version}
    Associated artifactsorg.apache.maven.plugins:maven-resources-plugin
    Current Version2.5
    Newer versions2.6 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.site.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.site.version}
    Associated artifactsorg.apache.maven.plugins:maven-site-plugin
    Current Version3.0
    Newer versions3.1 Next Minor
    3.2 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.source.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.source.version}
    Associated artifactsorg.apache.maven.plugins:maven-source-plugin
    Current Version2.1.2
    Newer versions2.2 Next Minor
    2.2.1 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.surefire.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.surefire.version}
    Associated artifactsorg.apache.maven.plugins:maven-surefire-plugin
    Current Version2.10
    Newer versions2.11 Next Minor
    2.12
    2.12.1
    2.12.2
    2.12.3
    2.12.4
    2.13 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.taglist.version}

    Status No newer versions available.
    Property${plugin.taglist.version}
    Associated artifactsorg.codehaus.mojo:taglist-maven-plugin
    Current Version2.4
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.versions.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.versions.version}
    Associated artifactsorg.codehaus.mojo:versions-maven-plugin
    Current Version1.2
    Newer versions1.3 Next Minor
    1.3.1 Latest Minor
    2.0 Next Major
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes
    +

    Overview

    This report summarizes newer versions that may be available for your project's various properties associated with artifacts.

    # of properties using the latest version available5
    # of properties where the next version available is smaller than an incremental version update0
    # of properties where the next version available is an incremental version update3
    # of properties where the next version available is a minor version update18
    # of properties where the next version available is a major version update0

    Summary of properties sssociated with artifact versions

    StatusPropertyCurrent VersionNext VersionNext IncrementalNext MinorNext Major
    ${plugin.findbugs.version}2.3.22.3.32.4.0
    ${plugin.clean.version}2.4.12.5
    ${plugin.enforcer.version}1.0.11.1
    ${plugin.install.version}2.3.12.4
    ${plugin.release.version}2.2.12.2.22.3
    ${plugin.resources.version}2.52.6
    ${plugin.assembly.version}2.2.22.3
    ${plugin.antrun.version}1.7
    ${plugin.site.version}3.03.1
    ${plugin.versions.version}1.21.32.0
    ${plugin.project-info-reports.version}2.42.5
    ${plugin.javadoc.version}2.82.8.12.9
    ${plugin.taglist.version}2.4
    ${plugin.eclipse.version}2.82.9
    ${plugin.help.version}2.1.12.2
    ${plugin.source.version}2.1.22.2
    ${plugin.surefire.version}2.102.11
    ${plugin.compiler.version}2.3.22.43.0
    ${plugin.pmd.version}2.62.73.0
    ${plugin.jxr.version}2.3
    ${plugin.gpg.version}1.4
    ${plugin.checkstyle.version}2.82.9
    ${plugin.changes.version}2.62.7
    ${plugin.deploy.version}2.7
    ${plugin.dependency.version}2.32.4
    ${plugin.jar.version}2.3.22.4
    StatusPropertyCurrent VersionNext VersionNext IncrementalNext MinorNext Major

    Properties sssociated with artifact versions

    ${plugin.antrun.version}

    Status No newer versions available.
    Property${plugin.antrun.version}
    Associated artifactsorg.apache.maven.plugins:maven-antrun-plugin
    Current Version1.7
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.assembly.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.assembly.version}
    Associated artifactsorg.apache.maven.plugins:maven-assembly-plugin
    Current Version2.2.2
    Newer versions2.3 Next Minor
    2.4 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.changes.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.changes.version}
    Associated artifactsorg.apache.maven.plugins:maven-changes-plugin
    Current Version2.6
    Newer versions2.7 Next Minor
    2.7.1
    2.8
    2.9 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.checkstyle.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.checkstyle.version}
    Associated artifactsorg.apache.maven.plugins:maven-checkstyle-plugin
    Current Version2.8
    Newer versions2.9 Next Minor
    2.9.1
    2.10 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.clean.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.clean.version}
    Associated artifactsorg.apache.maven.plugins:maven-clean-plugin
    Current Version2.4.1
    Newer versions2.5 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.compiler.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.compiler.version}
    Associated artifactsorg.apache.maven.plugins:maven-compiler-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor
    2.5
    2.5.1 Latest Minor
    3.0 Next Major
    3.1 Latest Major
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.dependency.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.dependency.version}
    Associated artifactsorg.apache.maven.plugins:maven-dependency-plugin
    Current Version2.3
    Newer versions2.4 Next Minor
    2.5
    2.5.1
    2.6
    2.7
    2.8 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.deploy.version}

    Status No newer versions available.
    Property${plugin.deploy.version}
    Associated artifactsorg.apache.maven.plugins:maven-deploy-plugin
    Current Version2.7
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.eclipse.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.eclipse.version}
    Associated artifactsorg.apache.maven.plugins:maven-eclipse-plugin
    Current Version2.8
    Newer versions2.9 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.enforcer.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.enforcer.version}
    Associated artifactsorg.apache.maven.plugins:maven-enforcer-plugin
    Current Version1.0.1
    Newer versions1.1 Next Minor
    1.1.1
    1.2
    1.3 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.findbugs.version}

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Property${plugin.findbugs.version}
    Associated artifactsorg.codehaus.mojo:findbugs-maven-plugin
    Current Version2.3.2
    Newer versions2.3.3 Next Incremental
    2.4.0 Next Minor
    2.5
    2.5.1
    2.5.2 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.gpg.version}

    Status No newer versions available.
    Property${plugin.gpg.version}
    Associated artifactsorg.apache.maven.plugins:maven-gpg-plugin
    Current Version1.4
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.help.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.help.version}
    Associated artifactsorg.apache.maven.plugins:maven-help-plugin
    Current Version2.1.1
    Newer versions2.2 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.install.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.install.version}
    Associated artifactsorg.apache.maven.plugins:maven-install-plugin
    Current Version2.3.1
    Newer versions2.4 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.jar.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.jar.version}
    Associated artifactsorg.apache.maven.plugins:maven-jar-plugin
    Current Version2.3.2
    Newer versions2.4 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.javadoc.version}

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Property${plugin.javadoc.version}
    Associated artifactsorg.apache.maven.plugins:maven-javadoc-plugin
    Current Version2.8
    Newer versions2.8.1 Next Incremental
    2.9 Next Minor
    2.9.1 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.jxr.version}

    Status No newer versions available.
    Property${plugin.jxr.version}
    Associated artifactsorg.apache.maven.plugins:maven-jxr-plugin
    Current Version2.3
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.pmd.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.pmd.version}
    Associated artifactsorg.apache.maven.plugins:maven-pmd-plugin
    Current Version2.6
    Newer versions2.7 Next Minor
    2.7.1 Latest Minor
    3.0 Next Major
    3.0.1 Latest Major
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.project-info-reports.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.project-info-reports.version}
    Associated artifactsorg.apache.maven.plugins:maven-project-info-reports-plugin
    Current Version2.4
    Newer versions2.5 Next Minor
    2.5.1
    2.6
    2.7 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.release.version}

    Status There is at least one newer incremental version available. Incremental updates are typically passive.
    Property${plugin.release.version}
    Associated artifactsorg.apache.maven.plugins:maven-release-plugin
    Current Version2.2.1
    Newer versions2.2.2 Next Incremental
    2.3 Next Minor
    2.3.1
    2.3.2
    2.4
    2.4.1 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.resources.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.resources.version}
    Associated artifactsorg.apache.maven.plugins:maven-resources-plugin
    Current Version2.5
    Newer versions2.6 Next Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.site.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.site.version}
    Associated artifactsorg.apache.maven.plugins:maven-site-plugin
    Current Version3.0
    Newer versions3.1 Next Minor
    3.2
    3.3 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.source.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.source.version}
    Associated artifactsorg.apache.maven.plugins:maven-source-plugin
    Current Version2.1.2
    Newer versions2.2 Next Minor
    2.2.1 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.surefire.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.surefire.version}
    Associated artifactsorg.apache.maven.plugins:maven-surefire-plugin
    Current Version2.10
    Newer versions2.11 Next Minor
    2.12
    2.12.1
    2.12.2
    2.12.3
    2.12.4
    2.13
    2.14
    2.14.1
    2.15 Latest Minor
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.taglist.version}

    Status No newer versions available.
    Property${plugin.taglist.version}
    Associated artifactsorg.codehaus.mojo:taglist-maven-plugin
    Current Version2.4
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes

    ${plugin.versions.version}

    Status There is at least one newer minor version available. Minor updates are sometimes passive.
    Property${plugin.versions.version}
    Associated artifactsorg.codehaus.mojo:versions-maven-plugin
    Current Version1.2
    Newer versions1.3 Next Minor
    1.3.1 Latest Minor
    2.0 Next Major
    2.1 Latest Major
    Allowed version range[,)
    Infer associations from projectYes
    Only use release versionsNo
    Include projects from reactorYes
    Always use reactor projects (even if older or -SNAPSHOT)Yes
    diff --git a/scripting.html b/scripting.html index c59bb1d..a0b05e3 100644 --- a/scripting.html +++ b/scripting.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/source-repository.html b/source-repository.html index 4a9ecdb..08b1d77 100644 --- a/source-repository.html +++ b/source-repository.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Source Repository
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/status.html b/status.html index 96ed062..89fe4f2 100644 --- a/status.html +++ b/status.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • @@ -119,7 +119,7 @@
    -

    Status of the implementation of the RunDeck API

    RunDeck API version 1

    Documentation of the RunDeck API version 1

    • Login-based authentication - OK
    • System Info - OK
    • Listing Jobs - OK
    • Running a Job - OK
    • Exporting Jobs - OK
    • Importing Jobs - OK
    • Getting a Job Definition - OK
    • Deleting a Job Definition - OK
    • Getting Executions for a Job - OK
    • Listing Running Executions - OK
    • Getting Execution Info - OK
    • Aborting Executions - OK
    • Running Adhoc Commands - OK
    • Running Adhoc Scripts - OK
    • Listing Projects - OK
    • Getting Project Info - OK
    • Listing History - OK
    • Creating History Event Reports - TODO
    • Listing Resources - OK
    • Getting Resource Info - OK

    RunDeck API version 2

    Documentation of the RunDeck API version 2

    • Token-based authentication - OK
    • Listing Jobs for a Project - TODO
    • Updating and Listing Resources for a Project - TODO
    • Refreshing Resources for a Project - TODO

    RunDeck API version 3

    Documentation of the RunDeck API version 3

    • (only updates to Resource endpoints) - TODO

    RunDeck API version 4

    Documentation of the RunDeck API version 4

    • Running Adhoc Script URLs - TODO

    RunDeck API version 5

    Documentation of the RunDeck API version 5

    • Bulk Job Delete - OK
    • Execution Output - OK
    • Execution Query - OK
    • History list query - OK

    RunDeck API version 6

    Documentation of the RunDeck API version 6

    • Execution Output format fixed - OK
    +

    Status of the implementation of the RunDeck API

    RunDeck API version 1

    Documentation of the RunDeck API version 1

    • Login-based authentication - OK
    • System Info - OK
    • Listing Jobs - OK
    • Running a Job - OK
    • Exporting Jobs - OK
    • Importing Jobs - OK
    • Getting a Job Definition - OK
    • Deleting a Job Definition - OK
    • Getting Executions for a Job - OK
    • Listing Running Executions - OK
    • Getting Execution Info - OK
    • Aborting Executions - OK
    • Running Adhoc Commands - OK
    • Running Adhoc Scripts - OK
    • Listing Projects - OK
    • Getting Project Info - OK
    • Listing History - OK
    • Creating History Event Reports - TODO
    • Listing Resources - OK
    • Getting Resource Info - OK

    RunDeck API version 2

    Documentation of the RunDeck API version 2

    • Token-based authentication - OK
    • Listing Jobs for a Project - TODO
    • Updating and Listing Resources for a Project - TODO
    • Refreshing Resources for a Project - TODO

    RunDeck API version 3

    Documentation of the RunDeck API version 3

    • (only updates to Resource endpoints) - TODO

    RunDeck API version 4

    Documentation of the RunDeck API version 4

    • Running Adhoc Script URLs - TODO

    RunDeck API version 5

    Documentation of the RunDeck API version 5

    • Bulk Job Delete - OK
    • Execution Output - OK
    • Execution Query - OK
    • History list query - OK

    RunDeck API version 6

    Documentation of the RunDeck API version 6

    • Execution Output format fixed - OK

    RunDeck API version 7

    Documentation of the RunDeck API version 7

    • Incubator for cluster mode job takeover - TODO

    RunDeck API version 8

    Documentation of the RunDeck API version 8

    • scriptInterpreter addition to run script and run url - OK
    • project parameter added to jobs import - OK
    diff --git a/taglist.html b/taglist.html index fbc52bb..c8ec602 100644 --- a/taglist.html +++ b/taglist.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Tag List report
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/team-list.html b/team-list.html index a7b1720..eb5f0b8 100644 --- a/team-list.html +++ b/team-list.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -50,8 +50,8 @@
  • Team list
  • -
  • Last Published: 2013-02-21
  • |
  • -
  • Version: 6.0
  • +
  • Last Published: 2013-08-06
  • |
  • +
  • Version: 8.0
  • diff --git a/testapidocs/proof-read.txt b/testapidocs/proof-read.txt index f441161..7de4051 100644 --- a/testapidocs/proof-read.txt +++ b/testapidocs/proof-read.txt @@ -133,10 +133,20 @@ METHOD: parsePendingAbort {@link/RundeckClient} . Uses betamax to unit-test HTTP requests without a live RunDeck instance. FIELD: TEST_TOKEN_0 + Note: to add a new test, do the following: + 1) start a rundeck server, available at hostname "rundeck.local" + 2) login as test or admin user, and generate a token + 3) add the test token as a new TEST_TOKEN_X, and use that in your test + 4) run 'mvn test', and commit the new yml file generated at src/test/resources/betamax/tapes FIELD: TEST_TOKEN_1 FIELD: TEST_TOKEN_2 +FIELD: TEST_TOKEN_3 +FIELD: TEST_TOKEN_4 FIELD: recorder CONSTRUCTOR: RundeckClientTest +METHOD: abortExecution +METHOD: abortExecutionAsUser +METHOD: abortExecutionAsUserUnauthorized METHOD: bulkDelete METHOD: bulkDeleteFailDNE METHOD: bulkDeleteFailUnauthorized @@ -148,7 +158,36 @@ METHOD: getHistoryExcludeJoblist METHOD: getHistoryJoblist METHOD: getHistoryUser METHOD: getProjects +METHOD: importJobsContextProject + Import jobs, xml contains project context +METHOD: importJobsNoProject + Import jobs, xml no project defined +METHOD: importJobsProjectParam + Import jobs, using project parameter +METHOD: importJobsProjectParamOverride + Import jobs, project parameter overrides xml +METHOD: importJobsProjectParamV7 + Import jobs, project parameter v7 doesn' use parameter METHOD: setUp +METHOD: triggerAdhocCommand +METHOD: triggerAdhocCommandAsUser +METHOD: triggerAdhocCommandAsUserUnauthorized +METHOD: triggerAdhocCommandDeprecated +METHOD: triggerAdhocCommandDeprecatedAsUser +METHOD: triggerAdhocCommandDeprecatedAsUserUnauthorized +METHOD: triggerAdhocScript +METHOD: triggerAdhocScriptAsUser +METHOD: triggerAdhocScriptAsUserUnauthorized +METHOD: triggerAdhocScriptDeprecated +METHOD: triggerAdhocScriptDeprecatedAsUser +METHOD: triggerAdhocScriptDeprecatedAsUserUnauthorized +METHOD: triggerAdhocScriptInpterpreter +METHOD: triggerJobAsUser +METHOD: triggerJobAsUserUnauthorized +METHOD: triggerJobBasic +METHOD: triggerJobDeprecatedAsUser +METHOD: triggerJobDeprecatedAsUserUnauthorized +METHOD: triggerJobDeprecatedBasic === org/rundeck/api/util/ParametersUtilTest.html === diff --git a/testapidocs/reference/current.xml b/testapidocs/reference/current.xml index 09e8693..4a4cd06 100644 --- a/testapidocs/reference/current.xml +++ b/testapidocs/reference/current.xml @@ -17,6 +17,45 @@ visibility="public" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + String TEST_TOKEN_0 - + Note: to add a new test, do the following: + 1) start a rundeck server, available at hostname "rundeck.local" + 2) login as test or admin user, and generate a token + 3) add the test token as a new TEST_TOKEN_X, and use that in your test + 4) run 'mvn test', and commit the new yml file generated at src/test/resources/betamax/tapes @@ -376,6 +380,20 @@ Summary: + + String + TEST_TOKEN_3 + + + + + + String + TEST_TOKEN_4 + + + + @@ -455,7 +473,7 @@ Summary: void - bulkDelete() + abortExecution() @@ -468,6 +486,54 @@ Summary: + void + + + abortExecutionAsUser() + + + + + + + + + + + + + void + + + abortExecutionAsUserUnauthorized() + + + + + + + + + + + + + void + + + bulkDelete() + + + + + + + + + + + + void @@ -477,7 +543,7 @@ Summary: - + @@ -493,7 +559,7 @@ Summary: - + @@ -509,7 +575,7 @@ Summary: - + @@ -528,7 +594,7 @@ Summary: - + @@ -544,7 +610,7 @@ Summary: - + @@ -560,7 +626,7 @@ Summary: - + @@ -576,7 +642,7 @@ Summary: - + @@ -592,7 +658,7 @@ Summary: - + @@ -608,6 +674,96 @@ Summary: + + + + + + + + void + + + importJobsContextProject() + +
    Import jobs, xml contains project context
    + + + + + + + + + + + + + void + + + importJobsNoProject() + +
    Import jobs, xml no project defined
    + + + + + + + + + + + + + void + + + importJobsProjectParam() + +
    Import jobs, using project parameter
    + + + + + + + + + + + + + void + + + importJobsProjectParamOverride() + +
    Import jobs, project parameter overrides xml
    + + + + + + + + + + + + + void + + + importJobsProjectParamV7() + +
    Import jobs, project parameter v7 doesn' use parameter
    + + + + + @@ -623,6 +779,310 @@ Summary: + + + + + + + + + void + + + triggerAdhocCommand() + + + + + + + + + + + + + void + + + triggerAdhocCommandAsUser() + + + + + + + + + + + + + void + + + triggerAdhocCommandAsUserUnauthorized() + + + + + + + + + + + + + void + + + triggerAdhocCommandDeprecated() + + + + + + + + + + + + + void + + + triggerAdhocCommandDeprecatedAsUser() + + + + + + + + + + + + + void + + + triggerAdhocCommandDeprecatedAsUserUnauthorized() + + + + + + + + + + + + + void + + + triggerAdhocScript() + + + + + + + + + + + + + void + + + triggerAdhocScriptAsUser() + + + + + + + + + + + + + void + + + triggerAdhocScriptAsUserUnauthorized() + + + + + + + + + + + + + void + + + triggerAdhocScriptDeprecated() + + + + + + + + + + + + + void + + + triggerAdhocScriptDeprecatedAsUser() + + + + + + + + + + + + + void + + + triggerAdhocScriptDeprecatedAsUserUnauthorized() + + + + + + + + + + + + + void + + + triggerAdhocScriptInpterpreter() + + + + + + + + + + + + + void + + + triggerJobAsUser() + + + + + + + + + + + + + void + + + triggerJobAsUserUnauthorized() + + + + + + + + + + + + + void + + + triggerJobBasic() + + + + + + + + + + + + + void + + + triggerJobDeprecatedAsUser() + + + + + + + + + + + + + void + + + triggerJobDeprecatedAsUserUnauthorized() + + + + + + + + + + + + + void + + + triggerJobDeprecatedBasic() + + + + @@ -890,7 +1350,16 @@ From class
    -

    +

    Note: to add a new test, do the following: + 1) start a rundeck server, available at hostname "rundeck.local" + 2) login as test or admin user, and generate a token + 3) add the test token as a new TEST_TOKEN_X, and use that in your test + 4) run 'mvn test', and commit the new yml file generated at src/test/resources/betamax/tapes

    +
    +
    See Also
    +
    • createClient(String)
    • +
    +
    @@ -985,6 +1454,84 @@ From class + + +
    +

    + + public + static + final + String + + TEST_TOKEN_3 +

    +
    + + + + + + +
    +
    + +

    + + +
    + Constant Value: + + + "9RdEosesKP3se4oV9EKOd4s3RUeUS3ON" + + +
    + +
    +
    + + + + + +
    +

    + + public + static + final + String + + TEST_TOKEN_4 +

    +
    + + + + + + +
    +
    + +

    + + +
    + Constant Value: + + + "sN5RRSNvu15DnV6EcNDdc2CkdPcv3s32" + + +
    + +
    +
    + + + @@ -1080,6 +1627,126 @@ From class + + +
    +

    + + public + + + + + void + + abortExecution + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + abortExecutionAsUser + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + abortExecutionAsUserUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -1481,6 +2148,206 @@ From class
    + + +
    +

    + + public + + + + + void + + importJobsContextProject + () +

    +
    +
    + +
    + + + +
    +
    + +

    Import jobs, xml contains project context

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + importJobsNoProject + () +

    +
    +
    + +
    + + + +
    +
    + +

    Import jobs, xml no project defined

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + importJobsProjectParam + () +

    +
    +
    + +
    + + + +
    +
    + +

    Import jobs, using project parameter

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + importJobsProjectParamOverride + () +

    +
    +
    + +
    + + + +
    +
    + +

    Import jobs, project parameter overrides xml

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + importJobsProjectParamV7 + () +

    +
    +
    + +
    + + + +
    +
    + +

    Import jobs, project parameter v7 doesn' use parameter

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -1521,6 +2388,766 @@ From class
    + + +
    +

    + + public + + + + + void + + triggerAdhocCommand + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocCommandAsUser + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocCommandAsUserUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocCommandDeprecated + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocCommandDeprecatedAsUser + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocCommandDeprecatedAsUserUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocScript + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocScriptAsUser + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocScriptAsUserUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocScriptDeprecated + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocScriptDeprecatedAsUser + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocScriptDeprecatedAsUserUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerAdhocScriptInpterpreter + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerJobAsUser + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerJobAsUserUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerJobBasic + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerJobDeprecatedAsUser + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerJobDeprecatedAsUserUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + + + +
    +

    + + public + + + + + void + + triggerJobDeprecatedBasic + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + diff --git a/xref-test/index.html b/xref-test/index.html index a980f60..b1874b6 100644 --- a/xref-test/index.html +++ b/xref-test/index.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference + RunDeck API - Java Client 8.0 Reference diff --git a/xref-test/org/rundeck/api/RundeckClientTest.html b/xref-test/org/rundeck/api/RundeckClientTest.html index 8c0a786..a41316c 100644 --- a/xref-test/org/rundeck/api/RundeckClientTest.html +++ b/xref-test/org/rundeck/api/RundeckClientTest.html @@ -33,354 +33,917 @@ 23 import org.junit.Before; 24 import org.junit.Rule; 25 import org.junit.Test; -26 import org.rundeck.api.domain.RundeckEvent; -27 import org.rundeck.api.domain.RundeckExecution; -28 import org.rundeck.api.domain.RundeckHistory; -29 import org.rundeck.api.domain.RundeckJobDelete; -30 import org.rundeck.api.domain.RundeckJobDeleteBulk; -31 import org.rundeck.api.domain.RundeckProject; -32 import org.rundeck.api.query.ExecutionQuery; -33 import org.rundeck.api.util.PagedResults; +26 import org.rundeck.api.domain.*; +27 import org.rundeck.api.query.ExecutionQuery; +28 import org.rundeck.api.util.PagedResults; +29 +30 import java.io.ByteArrayInputStream; +31 import java.io.InputStream; +32 import java.util.*; +33 34 -35 import java.util.ArrayList; -36 import java.util.Arrays; -37 import java.util.Date; -38 import java.util.List; -39 -40 -41 /** -42 * Test the {@link RundeckClient}. Uses betamax to unit-test HTTP requests without a live RunDeck instance. -43 * -44 * @author Vincent Behar -45 */ -46 public class RundeckClientTest { -47 -48 public static final String TEST_TOKEN_0 = "PVnN5K3OPc5vduS3uVuVnEsD57pDC5pd"; -49 public static final String TEST_TOKEN_1 = "0UUNkeRp4d58EDeCs7S6UdODp334DvK9"; -50 public static final String TEST_TOKEN_2 = "PP4s4SdCRO6KUoNPd1D303Dc304ORN87"; -51 -52 @Rule -53 public Recorder recorder = new Recorder(); -54 -55 private RundeckClient client; +35 /** +36 * Test the {@link RundeckClient}. Uses betamax to unit-test HTTP requests without a live RunDeck instance. +37 * +38 * @author Vincent Behar +39 */ +40 public class RundeckClientTest { +41 +42 /** +43 * Note: to add a new test, do the following: +44 * 1) start a rundeck server, available at hostname "rundeck.local" +45 * 2) login as test or admin user, and generate a token +46 * 3) add the test token as a new TEST_TOKEN_X, and use that in your test +47 * 4) run 'mvn test', and commit the new yml file generated at src/test/resources/betamax/tapes +48 * @see #createClient(String) +49 */ +50 +51 public static final String TEST_TOKEN_0 = "PVnN5K3OPc5vduS3uVuVnEsD57pDC5pd"; +52 public static final String TEST_TOKEN_1 = "0UUNkeRp4d58EDeCs7S6UdODp334DvK9"; +53 public static final String TEST_TOKEN_2 = "PP4s4SdCRO6KUoNPd1D303Dc304ORN87"; +54 public static final String TEST_TOKEN_3 = "9RdEosesKP3se4oV9EKOd4s3RUeUS3ON"; +55 public static final String TEST_TOKEN_4 = "sN5RRSNvu15DnV6EcNDdc2CkdPcv3s32"; 56 -57 @Test -58 @Betamax(tape = "get_projects") -59 public void getProjects() throws Exception { -60 List<RundeckProject> projects = client.getProjects(); -61 Assert.assertEquals(1, projects.size()); -62 Assert.assertEquals("test", projects.get(0).getName()); -63 Assert.assertNull(projects.get(0).getDescription()); -64 } -65 @Test -66 @Betamax(tape = "get_history") -67 public void getHistory() throws Exception { -68 final RundeckHistory test = client.getHistory("test"); -69 Assert.assertEquals(3, test.getCount()); -70 Assert.assertEquals(20, test.getMax()); -71 Assert.assertEquals(0, test.getOffset()); -72 Assert.assertEquals(5, test.getTotal()); -73 final List<RundeckEvent> events = test.getEvents(); -74 Assert.assertEquals(3, events.size()); -75 } -76 -77 @Test -78 @Betamax(tape = "get_history_joblist", -79 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) -80 public void getHistoryJoblist() throws Exception { -81 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); -82 final RundeckHistory test = client.getHistory("demo", null, null, jobNames, null, null, null, null, null); -83 Assert.assertEquals(2, test.getCount()); -84 Assert.assertEquals(20, test.getMax()); -85 Assert.assertEquals(0, test.getOffset()); -86 Assert.assertEquals(2, test.getTotal()); -87 final List<RundeckEvent> events = test.getEvents(); -88 Assert.assertEquals(2, events.size()); -89 final List<String> names = new ArrayList<String>(); -90 for (final RundeckEvent event : events) { -91 names.add(event.getTitle()); -92 } -93 Assert.assertEquals(Arrays.asList("malk/blah2", "malk/blah"), names); -94 } -95 -96 @Test -97 @Betamax(tape = "get_history_excludeJoblist", -98 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) -99 public void getHistoryExcludeJoblist() throws Exception { -100 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); -101 final RundeckHistory test = client.getHistory("demo", null, null, null, jobNames, null, null, null, null); -102 Assert.assertEquals(2, test.getCount()); -103 Assert.assertEquals(20, test.getMax()); -104 Assert.assertEquals(0, test.getOffset()); -105 Assert.assertEquals(2, test.getTotal()); -106 final List<RundeckEvent> events = test.getEvents(); -107 Assert.assertEquals(2, events.size()); -108 final List<String> names = new ArrayList<String>(); -109 for (final RundeckEvent event : events) { -110 names.add(event.getTitle()); -111 } -112 Assert.assertEquals(Arrays.asList("fliff", "malk/blah3"), names); -113 } -114 -115 @Test -116 @Betamax(tape = "get_history_user", -117 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query }) -118 public void getHistoryUser() throws Exception { -119 final RundeckHistory test = client.getHistory("demo", "bob", (String)null, (List)null, null, null, null, 1L, 0L); -120 Assert.assertEquals(1, test.getCount()); -121 Assert.assertEquals(20, test.getMax()); -122 Assert.assertEquals(0, test.getOffset()); -123 Assert.assertEquals(1, test.getTotal()); -124 final List<RundeckEvent> events = test.getEvents(); -125 Assert.assertEquals(1, events.size()); -126 final List<String> names = new ArrayList<String>(); -127 for (final RundeckEvent event : events) { -128 names.add(event.getUser()); -129 } -130 Assert.assertEquals(Arrays.asList("bob"), names); -131 } -132 -133 @Test -134 @Betamax(tape = "get_executions", -135 mode = TapeMode.READ_ONLY, -136 match = {MatchRule.uri, MatchRule.headers, MatchRule.method, MatchRule.path, MatchRule.query}) -137 public void getExecutions() throws Exception { -138 -139 RundeckClient client = createClient(TEST_TOKEN_1); -140 -141 -142 final String projectName = "blah"; -143 final PagedResults<RundeckExecution> jobTest = client.getExecutions(ExecutionQuery.builder() -144 .project(projectName) -145 .job("test job") -146 .build(), -147 2L, -148 0L); -149 assertPageResults(jobTest, 2, 2, 2, 0, 2); -150 final PagedResults<RundeckExecution> jobExactTest = client.getExecutions(ExecutionQuery.builder() -151 .project(projectName) -152 .jobExact("test job") -153 .build(), -154 2L, -155 0L); -156 assertPageResults(jobExactTest, 2, 2, 2, 0, 2); -157 final PagedResults<RundeckExecution> excludeJobTest = client.getExecutions(ExecutionQuery.builder() -158 .project(projectName) -159 .excludeJob("test job") -160 .build(), -161 2L, -162 0L); -163 assertPageResults(excludeJobTest, 2, 2, 2, 0, 2); -164 final PagedResults<RundeckExecution> excludeJobExactTest = client.getExecutions(ExecutionQuery.builder() -165 .project(projectName) -166 .excludeJobExact("test job") -167 .build(), -168 2L, -169 0L); -170 assertPageResults(excludeJobExactTest, 2, 2, 2, 0, 2); -171 final PagedResults<RundeckExecution> descriptionTest = client.getExecutions(ExecutionQuery.builder() -172 .project(projectName) -173 .description("a description") -174 .build(), 2L, 0L); -175 assertPageResults(descriptionTest, 2, 2, 2, 0, 2); -176 final PagedResults<RundeckExecution> abortedbyTest = client.getExecutions(ExecutionQuery.builder() -177 .project(projectName) -178 .abortedby("admin") -179 .build(), -180 2L, -181 0L); -182 assertPageResults(abortedbyTest, 1, 1, 2, 0, 1); -183 final PagedResults<RundeckExecution> beginTest = client.getExecutions(ExecutionQuery.builder() -184 .project(projectName) -185 .begin(new Date(1347581178168L)) -186 .build(), 2L, 0L); -187 assertPageResults(beginTest, 2, 2, 2, 0, 2); -188 final PagedResults<RundeckExecution> endTest = client.getExecutions(ExecutionQuery.builder() -189 .project(projectName) -190 .end(new Date(1347581178168L)) -191 .build(), 2L, 0L); -192 assertPageResults(endTest, 2, 2, 2, 0, 2); -193 final List<String> excludeJobIdList = Arrays.asList("123", "456"); -194 final PagedResults<RundeckExecution> excludeJobIdListTest = client.getExecutions(ExecutionQuery.builder() -195 .project(projectName) -196 .excludeJobIdList(excludeJobIdList) -197 .build(), 2L, 0L); -198 assertPageResults(excludeJobIdListTest, 2, 2, 2, 0, 2); -199 final List<String> jobList = Arrays.asList("fruit/mango", "fruit/lemon"); -200 final PagedResults<RundeckExecution> jobListTest = client.getExecutions(ExecutionQuery.builder() -201 .project(projectName) -202 .jobList(jobList) -203 .build(), 2L, 0L); -204 assertPageResults(jobListTest, 2, 2, 2, 0, 2); -205 final List<String> excludeJobList = Arrays.asList("a/path/job1", "path/to/job2"); -206 final PagedResults<RundeckExecution> excludeJobListTest = client.getExecutions(ExecutionQuery.builder() -207 .project(projectName) -208 .excludeJobList(excludeJobList) -209 .build(), 2L, 0L); -210 assertPageResults(excludeJobListTest, 2, 2, 2, 0, 2); -211 final List<String> list = Arrays.asList("1f4415d7-3b52-4fc8-ba42-b6ac97508bff", -212 "d9fc5ee6-f1db-4d24-8808-feda18345bab"); -213 final PagedResults<RundeckExecution> jobIdListTest = client.getExecutions(ExecutionQuery.builder() -214 .project(projectName) -215 .jobIdList(list) -216 .build(), 2L, 0L); -217 assertPageResults(jobIdListTest, 2, 2, 2, 0, 2); -218 final PagedResults<RundeckExecution> groupPathTest = client.getExecutions(ExecutionQuery.builder() +57 @Rule +58 public Recorder recorder = new Recorder(); +59 +60 private RundeckClient client; +61 +62 @Test +63 @Betamax(tape = "get_projects") +64 public void getProjects() throws Exception { +65 List<RundeckProject> projects = client.getProjects(); +66 Assert.assertEquals(1, projects.size()); +67 Assert.assertEquals("test", projects.get(0).getName()); +68 Assert.assertNull(projects.get(0).getDescription()); +69 } +70 @Test +71 @Betamax(tape = "get_history") +72 public void getHistory() throws Exception { +73 final RundeckHistory test = client.getHistory("test"); +74 Assert.assertEquals(3, test.getCount()); +75 Assert.assertEquals(20, test.getMax()); +76 Assert.assertEquals(0, test.getOffset()); +77 Assert.assertEquals(5, test.getTotal()); +78 final List<RundeckEvent> events = test.getEvents(); +79 Assert.assertEquals(3, events.size()); +80 } +81 +82 @Test +83 @Betamax(tape = "get_history_joblist", +84 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) +85 public void getHistoryJoblist() throws Exception { +86 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); +87 final RundeckHistory test = client.getHistory("demo", null, null, jobNames, null, null, null, null, null); +88 Assert.assertEquals(2, test.getCount()); +89 Assert.assertEquals(20, test.getMax()); +90 Assert.assertEquals(0, test.getOffset()); +91 Assert.assertEquals(2, test.getTotal()); +92 final List<RundeckEvent> events = test.getEvents(); +93 Assert.assertEquals(2, events.size()); +94 final List<String> names = new ArrayList<String>(); +95 for (final RundeckEvent event : events) { +96 names.add(event.getTitle()); +97 } +98 Assert.assertEquals(Arrays.asList("malk/blah2", "malk/blah"), names); +99 } +100 +101 @Test +102 @Betamax(tape = "get_history_excludeJoblist", +103 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) +104 public void getHistoryExcludeJoblist() throws Exception { +105 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); +106 final RundeckHistory test = client.getHistory("demo", null, null, null, jobNames, null, null, null, null); +107 Assert.assertEquals(2, test.getCount()); +108 Assert.assertEquals(20, test.getMax()); +109 Assert.assertEquals(0, test.getOffset()); +110 Assert.assertEquals(2, test.getTotal()); +111 final List<RundeckEvent> events = test.getEvents(); +112 Assert.assertEquals(2, events.size()); +113 final List<String> names = new ArrayList<String>(); +114 for (final RundeckEvent event : events) { +115 names.add(event.getTitle()); +116 } +117 Assert.assertEquals(Arrays.asList("fliff", "malk/blah3"), names); +118 } +119 +120 @Test +121 @Betamax(tape = "get_history_user", +122 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query }) +123 public void getHistoryUser() throws Exception { +124 final RundeckHistory test = client.getHistory("demo", "bob", (String)null, (List)null, null, null, null, 1L, 0L); +125 Assert.assertEquals(1, test.getCount()); +126 Assert.assertEquals(20, test.getMax()); +127 Assert.assertEquals(0, test.getOffset()); +128 Assert.assertEquals(1, test.getTotal()); +129 final List<RundeckEvent> events = test.getEvents(); +130 Assert.assertEquals(1, events.size()); +131 final List<String> names = new ArrayList<String>(); +132 for (final RundeckEvent event : events) { +133 names.add(event.getUser()); +134 } +135 Assert.assertEquals(Arrays.asList("bob"), names); +136 } +137 +138 @Test +139 @Betamax(tape = "get_executions", +140 mode = TapeMode.READ_ONLY, +141 match = {MatchRule.uri, MatchRule.headers, MatchRule.method, MatchRule.path, MatchRule.query}) +142 public void getExecutions() throws Exception { +143 +144 RundeckClient client = createClient(TEST_TOKEN_1, 5); +145 +146 +147 final String projectName = "blah"; +148 final PagedResults<RundeckExecution> jobTest = client.getExecutions(ExecutionQuery.builder() +149 .project(projectName) +150 .job("test job") +151 .build(), +152 2L, +153 0L); +154 assertPageResults(jobTest, 2, 2, 2, 0, 2); +155 final PagedResults<RundeckExecution> jobExactTest = client.getExecutions(ExecutionQuery.builder() +156 .project(projectName) +157 .jobExact("test job") +158 .build(), +159 2L, +160 0L); +161 assertPageResults(jobExactTest, 2, 2, 2, 0, 2); +162 final PagedResults<RundeckExecution> excludeJobTest = client.getExecutions(ExecutionQuery.builder() +163 .project(projectName) +164 .excludeJob("test job") +165 .build(), +166 2L, +167 0L); +168 assertPageResults(excludeJobTest, 2, 2, 2, 0, 2); +169 final PagedResults<RundeckExecution> excludeJobExactTest = client.getExecutions(ExecutionQuery.builder() +170 .project(projectName) +171 .excludeJobExact("test job") +172 .build(), +173 2L, +174 0L); +175 assertPageResults(excludeJobExactTest, 2, 2, 2, 0, 2); +176 final PagedResults<RundeckExecution> descriptionTest = client.getExecutions(ExecutionQuery.builder() +177 .project(projectName) +178 .description("a description") +179 .build(), 2L, 0L); +180 assertPageResults(descriptionTest, 2, 2, 2, 0, 2); +181 final PagedResults<RundeckExecution> abortedbyTest = client.getExecutions(ExecutionQuery.builder() +182 .project(projectName) +183 .abortedby("admin") +184 .build(), +185 2L, +186 0L); +187 assertPageResults(abortedbyTest, 1, 1, 2, 0, 1); +188 final PagedResults<RundeckExecution> beginTest = client.getExecutions(ExecutionQuery.builder() +189 .project(projectName) +190 .begin(new Date(1347581178168L)) +191 .build(), 2L, 0L); +192 assertPageResults(beginTest, 2, 2, 2, 0, 2); +193 final PagedResults<RundeckExecution> endTest = client.getExecutions(ExecutionQuery.builder() +194 .project(projectName) +195 .end(new Date(1347581178168L)) +196 .build(), 2L, 0L); +197 assertPageResults(endTest, 2, 2, 2, 0, 2); +198 final List<String> excludeJobIdList = Arrays.asList("123", "456"); +199 final PagedResults<RundeckExecution> excludeJobIdListTest = client.getExecutions(ExecutionQuery.builder() +200 .project(projectName) +201 .excludeJobIdList(excludeJobIdList) +202 .build(), 2L, 0L); +203 assertPageResults(excludeJobIdListTest, 2, 2, 2, 0, 2); +204 final List<String> jobList = Arrays.asList("fruit/mango", "fruit/lemon"); +205 final PagedResults<RundeckExecution> jobListTest = client.getExecutions(ExecutionQuery.builder() +206 .project(projectName) +207 .jobList(jobList) +208 .build(), 2L, 0L); +209 assertPageResults(jobListTest, 2, 2, 2, 0, 2); +210 final List<String> excludeJobList = Arrays.asList("a/path/job1", "path/to/job2"); +211 final PagedResults<RundeckExecution> excludeJobListTest = client.getExecutions(ExecutionQuery.builder() +212 .project(projectName) +213 .excludeJobList(excludeJobList) +214 .build(), 2L, 0L); +215 assertPageResults(excludeJobListTest, 2, 2, 2, 0, 2); +216 final List<String> list = Arrays.asList("1f4415d7-3b52-4fc8-ba42-b6ac97508bff", +217 "d9fc5ee6-f1db-4d24-8808-feda18345bab"); +218 final PagedResults<RundeckExecution> jobIdListTest = client.getExecutions(ExecutionQuery.builder() 219 .project(projectName) -220 .groupPath("fruit") -221 .build(), -222 2L, -223 0L); -224 assertPageResults(groupPathTest, 2, 2, 2, 0, 2); -225 final PagedResults<RundeckExecution> groupPathExactTest = client.getExecutions(ExecutionQuery.builder() -226 .project(projectName) -227 .groupPathExact("fruit") -228 .build(), 2L, 0L); -229 assertPageResults(groupPathExactTest, 2, 2, 2, 0, 2); -230 -231 final PagedResults<RundeckExecution> excludeGroupPathTest = client.getExecutions(ExecutionQuery.builder() -232 .project(projectName) -233 .excludeGroupPath("fruit") -234 .build(), -235 2L, -236 0L); -237 assertPageResults(excludeGroupPathTest, 2, 2, 2, 0, 2); -238 final PagedResults<RundeckExecution> excliudeGroupPathExactTest = client.getExecutions(ExecutionQuery.builder() -239 .project(projectName) -240 .excludeGroupPathExact("fruit") -241 .build(), 2L, 0L); -242 assertPageResults(excliudeGroupPathExactTest, 2, 2, 2, 0, 2); -243 -244 final PagedResults<RundeckExecution> recentTest = client.getExecutions(ExecutionQuery.builder() -245 .project(projectName) -246 .recent("1h").build(), 2L, 0L); -247 assertPageResults(recentTest, 2, 2, 2, 0, 2); -248 final PagedResults<RundeckExecution> statusTest = client.getExecutions(ExecutionQuery.builder() -249 .project(projectName) -250 .status(RundeckExecution.ExecutionStatus.SUCCEEDED) -251 .build(), 2L, 0L); -252 assertPageResults(statusTest, 2, 2, 2, 0, 2); -253 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() +220 .jobIdList(list) +221 .build(), 2L, 0L); +222 assertPageResults(jobIdListTest, 2, 2, 2, 0, 2); +223 final PagedResults<RundeckExecution> groupPathTest = client.getExecutions(ExecutionQuery.builder() +224 .project(projectName) +225 .groupPath("fruit") +226 .build(), +227 2L, +228 0L); +229 assertPageResults(groupPathTest, 2, 2, 2, 0, 2); +230 final PagedResults<RundeckExecution> groupPathExactTest = client.getExecutions(ExecutionQuery.builder() +231 .project(projectName) +232 .groupPathExact("fruit") +233 .build(), 2L, 0L); +234 assertPageResults(groupPathExactTest, 2, 2, 2, 0, 2); +235 +236 final PagedResults<RundeckExecution> excludeGroupPathTest = client.getExecutions(ExecutionQuery.builder() +237 .project(projectName) +238 .excludeGroupPath("fruit") +239 .build(), +240 2L, +241 0L); +242 assertPageResults(excludeGroupPathTest, 2, 2, 2, 0, 2); +243 final PagedResults<RundeckExecution> excliudeGroupPathExactTest = client.getExecutions(ExecutionQuery.builder() +244 .project(projectName) +245 .excludeGroupPathExact("fruit") +246 .build(), 2L, 0L); +247 assertPageResults(excliudeGroupPathExactTest, 2, 2, 2, 0, 2); +248 +249 final PagedResults<RundeckExecution> recentTest = client.getExecutions(ExecutionQuery.builder() +250 .project(projectName) +251 .recent("1h").build(), 2L, 0L); +252 assertPageResults(recentTest, 2, 2, 2, 0, 2); +253 final PagedResults<RundeckExecution> statusTest = client.getExecutions(ExecutionQuery.builder() 254 .project(projectName) -255 .adhoc(true) +255 .status(RundeckExecution.ExecutionStatus.SUCCEEDED) 256 .build(), 2L, 0L); -257 assertPageResults(adhocTest, 2, 2, 2, 0, 2); -258 } -259 -260 /** -261 * Test paging values from results -262 */ -263 @Test -264 @Betamax(tape = "get_executions_paging") -265 public void getExecutionsPaging() throws Exception{ -266 RundeckClient client = createClient(TEST_TOKEN_1); -267 final String projectName = "blah"; -268 //2 max, 1 offset -269 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() -270 .project(projectName) -271 .excludeGroupPathExact("fruit") -272 .build(), 2L, 1L); -273 //expect 2 count, 3 total -274 assertPageResults(adhocTest, 2, 2, 2, 1, 3); -275 -276 //FAKE results, testing paging attributes parsing -277 -278 //1 max, 1 offset -279 final PagedResults<RundeckExecution> test2 = client.getExecutions(ExecutionQuery.builder() -280 .project(projectName) -281 .excludeGroupPathExact("fruit") -282 .build(), 1L, 1L); -283 //expect no paging attributes -284 assertPageResults(test2, 2, -1, -1, -1, -1); -285 -286 //1 max, 2 offset -287 final PagedResults<RundeckExecution> test3 = client.getExecutions(ExecutionQuery.builder() -288 .project(projectName) -289 .excludeGroupPathExact("fruit") -290 .build(), 1L, 2L); -291 //invalid value for count -292 assertPageResults(test3, 2, -1, -1, -1, -1); -293 } -294 @Test -295 @Betamax(tape = "bulk_delete") -296 public void bulkDelete() throws Exception { -297 RundeckClient client = createClient(TEST_TOKEN_2); -298 -299 final RundeckJobDeleteBulk deleteTest -300 = client.deleteJobs(Arrays.asList("0ce457b5-ba84-41ca-812e-02b31da355a4")); -301 Assert.assertTrue(deleteTest.isAllsuccessful()); -302 Assert.assertEquals(1, deleteTest.getRequestCount()); -303 Assert.assertEquals(1, deleteTest.getResults().size()); -304 -305 final RundeckJobDelete delete = deleteTest.getResults().get(0); -306 Assert.assertTrue(delete.isSuccessful()); -307 Assert.assertNull(delete.getError()); -308 Assert.assertNull(delete.getErrorCode()); -309 Assert.assertNotNull(delete.getMessage()); -310 Assert.assertEquals("0ce457b5-ba84-41ca-812e-02b31da355a4", delete.getId()); -311 } -312 @Test -313 @Betamax(tape = "bulk_delete_dne") -314 public void bulkDeleteFailDNE() throws Exception { -315 RundeckClient client = createClient(TEST_TOKEN_2); -316 -317 final RundeckJobDeleteBulk deleteTest -318 = client.deleteJobs(Arrays.asList("does-not-exist")); -319 Assert.assertFalse(deleteTest.isAllsuccessful()); -320 Assert.assertEquals(1, deleteTest.getRequestCount()); -321 Assert.assertEquals(1, deleteTest.getResults().size()); -322 -323 final RundeckJobDelete delete = deleteTest.getResults().get(0); -324 Assert.assertFalse(delete.isSuccessful()); -325 Assert.assertNotNull(delete.getError()); -326 Assert.assertEquals("notfound",delete.getErrorCode()); -327 Assert.assertNull(delete.getMessage()); -328 Assert.assertEquals("does-not-exist", delete.getId()); -329 } -330 @Test -331 @Betamax(tape = "bulk_delete_unauthorized") -332 public void bulkDeleteFailUnauthorized() throws Exception { -333 RundeckClient client = createClient(TEST_TOKEN_2); -334 -335 final RundeckJobDeleteBulk deleteTest -336 = client.deleteJobs(Arrays.asList("3a6d16be-4268-4d26-86a9-cebc1781f768")); -337 Assert.assertFalse(deleteTest.isAllsuccessful()); -338 Assert.assertEquals(1, deleteTest.getRequestCount()); -339 Assert.assertEquals(1, deleteTest.getResults().size()); -340 -341 final RundeckJobDelete delete = deleteTest.getResults().get(0); -342 Assert.assertFalse(delete.isSuccessful()); -343 Assert.assertNotNull(delete.getError()); -344 Assert.assertEquals("unauthorized",delete.getErrorCode()); -345 Assert.assertNull(delete.getMessage()); -346 Assert.assertEquals("3a6d16be-4268-4d26-86a9-cebc1781f768", delete.getId()); -347 } -348 -349 private void assertPageResults(PagedResults<RundeckExecution> jobTest, -350 final int size, -351 final int count, final int max, final int offset, final int total) { -352 Assert.assertEquals(size, jobTest.getResults().size()); -353 Assert.assertEquals(count, jobTest.getCount()); -354 Assert.assertEquals(max, jobTest.getMax()); -355 Assert.assertEquals(offset, jobTest.getOffset()); -356 Assert.assertEquals(total, jobTest.getTotal()); -357 } -358 -359 @Before -360 public void setUp() throws Exception { -361 // not that you can put whatever here, because we don't actually connect to the RunDeck instance -362 // but instead use betamax as a proxy to serve the previously recorded tapes (in src/test/resources) -363 client = createClient(TEST_TOKEN_0); -364 } -365 -366 private RundeckClient createClient(final String token) { -367 return RundeckClient.builder().url("http://rundeck.local:4440") -368 .token(token) -369 .version(5) -370 .build(); -371 } -372 -373 } +257 assertPageResults(statusTest, 2, 2, 2, 0, 2); +258 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() +259 .project(projectName) +260 .adhoc(true) +261 .build(), 2L, 0L); +262 assertPageResults(adhocTest, 2, 2, 2, 0, 2); +263 } +264 +265 /** +266 * Test paging values from results +267 */ +268 @Test +269 @Betamax(tape = "get_executions_paging") +270 public void getExecutionsPaging() throws Exception{ +271 RundeckClient client = createClient(TEST_TOKEN_1, 5); +272 final String projectName = "blah"; +273 //2 max, 1 offset +274 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() +275 .project(projectName) +276 .excludeGroupPathExact("fruit") +277 .build(), 2L, 1L); +278 //expect 2 count, 3 total +279 assertPageResults(adhocTest, 2, 2, 2, 1, 3); +280 +281 //FAKE results, testing paging attributes parsing +282 +283 //1 max, 1 offset +284 final PagedResults<RundeckExecution> test2 = client.getExecutions(ExecutionQuery.builder() +285 .project(projectName) +286 .excludeGroupPathExact("fruit") +287 .build(), 1L, 1L); +288 //expect no paging attributes +289 assertPageResults(test2, 2, -1, -1, -1, -1); +290 +291 //1 max, 2 offset +292 final PagedResults<RundeckExecution> test3 = client.getExecutions(ExecutionQuery.builder() +293 .project(projectName) +294 .excludeGroupPathExact("fruit") +295 .build(), 1L, 2L); +296 //invalid value for count +297 assertPageResults(test3, 2, -1, -1, -1, -1); +298 } +299 @Test +300 @Betamax(tape = "bulk_delete") +301 public void bulkDelete() throws Exception { +302 RundeckClient client = createClient(TEST_TOKEN_2, 5); +303 +304 final RundeckJobDeleteBulk deleteTest +305 = client.deleteJobs(Arrays.asList("0ce457b5-ba84-41ca-812e-02b31da355a4")); +306 Assert.assertTrue(deleteTest.isAllsuccessful()); +307 Assert.assertEquals(1, deleteTest.getRequestCount()); +308 Assert.assertEquals(1, deleteTest.getResults().size()); +309 +310 final RundeckJobDelete delete = deleteTest.getResults().get(0); +311 Assert.assertTrue(delete.isSuccessful()); +312 Assert.assertNull(delete.getError()); +313 Assert.assertNull(delete.getErrorCode()); +314 Assert.assertNotNull(delete.getMessage()); +315 Assert.assertEquals("0ce457b5-ba84-41ca-812e-02b31da355a4", delete.getId()); +316 } +317 @Test +318 @Betamax(tape = "bulk_delete_dne") +319 public void bulkDeleteFailDNE() throws Exception { +320 RundeckClient client = createClient(TEST_TOKEN_2, 5); +321 +322 final RundeckJobDeleteBulk deleteTest +323 = client.deleteJobs(Arrays.asList("does-not-exist")); +324 Assert.assertFalse(deleteTest.isAllsuccessful()); +325 Assert.assertEquals(1, deleteTest.getRequestCount()); +326 Assert.assertEquals(1, deleteTest.getResults().size()); +327 +328 final RundeckJobDelete delete = deleteTest.getResults().get(0); +329 Assert.assertFalse(delete.isSuccessful()); +330 Assert.assertNotNull(delete.getError()); +331 Assert.assertEquals("notfound", delete.getErrorCode()); +332 Assert.assertNull(delete.getMessage()); +333 Assert.assertEquals("does-not-exist", delete.getId()); +334 } +335 @Test +336 @Betamax(tape = "bulk_delete_unauthorized") +337 public void bulkDeleteFailUnauthorized() throws Exception { +338 RundeckClient client = createClient(TEST_TOKEN_2, 5); +339 +340 final RundeckJobDeleteBulk deleteTest +341 = client.deleteJobs(Arrays.asList("3a6d16be-4268-4d26-86a9-cebc1781f768")); +342 Assert.assertFalse(deleteTest.isAllsuccessful()); +343 Assert.assertEquals(1, deleteTest.getRequestCount()); +344 Assert.assertEquals(1, deleteTest.getResults().size()); +345 +346 final RundeckJobDelete delete = deleteTest.getResults().get(0); +347 Assert.assertFalse(delete.isSuccessful()); +348 Assert.assertNotNull(delete.getError()); +349 Assert.assertEquals("unauthorized", delete.getErrorCode()); +350 Assert.assertNull(delete.getMessage()); +351 Assert.assertEquals("3a6d16be-4268-4d26-86a9-cebc1781f768", delete.getId()); +352 } +353 @Test +354 @Betamax(tape = "trigger_job_basic") +355 public void triggerJobDeprecatedBasic() throws Exception { +356 RundeckClient client = createClient(TEST_TOKEN_3, 5); +357 +358 final RundeckExecution test +359 = client.triggerJob("3170ba0e-6093-4b58-94d2-52988aefbfc9", null, null, null); +360 +361 Assert.assertEquals((Long) 19L, test.getId()); +362 Assert.assertEquals(null, test.getArgstring()); +363 Assert.assertEquals(null, test.getAbortedBy()); +364 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +365 Assert.assertEquals("admin", test.getStartedBy()); +366 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +367 +368 } +369 @Test +370 @Betamax(tape = "trigger_job_basic") +371 public void triggerJobBasic() throws Exception { +372 RundeckClient client = createClient(TEST_TOKEN_3, 5); +373 +374 final RundeckExecution test +375 = client.triggerJob(RunJobBuilder.builder().setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9").build()); +376 +377 Assert.assertEquals((Long) 19L, test.getId()); +378 Assert.assertEquals(null, test.getArgstring()); +379 Assert.assertEquals(null, test.getAbortedBy()); +380 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +381 Assert.assertEquals("admin", test.getStartedBy()); +382 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +383 +384 } +385 @Test +386 @Betamax(tape = "trigger_job_as_user") +387 public void triggerJobDeprecatedAsUser() throws Exception { +388 RundeckClient client = createClient(TEST_TOKEN_3, 5); +389 +390 final RundeckExecution test +391 = client.triggerJob("3170ba0e-6093-4b58-94d2-52988aefbfc9", null, null, "api-java-client-user-test1"); +392 +393 Assert.assertEquals((Long) 20L, test.getId()); +394 Assert.assertEquals(null, test.getArgstring()); +395 Assert.assertEquals(null, test.getAbortedBy()); +396 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +397 Assert.assertEquals("api-java-client-user-test1", test.getStartedBy()); +398 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +399 +400 } +401 @Test +402 @Betamax(tape = "trigger_job_as_user") +403 public void triggerJobAsUser() throws Exception { +404 RundeckClient client = createClient(TEST_TOKEN_3, 5); +405 +406 final RundeckExecution test +407 = client.triggerJob(RunJobBuilder.builder() +408 .setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9") +409 .setAsUser("api-java-client-user-test1") +410 .build()); +411 +412 Assert.assertEquals((Long)20L, test.getId()); +413 Assert.assertEquals(null, test.getArgstring()); +414 Assert.assertEquals(null, test.getAbortedBy()); +415 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +416 Assert.assertEquals("api-java-client-user-test1", test.getStartedBy()); +417 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +418 +419 } +420 @Test +421 @Betamax(tape = "trigger_job_as_user_unauthorized") +422 public void triggerJobDeprecatedAsUserUnauthorized() throws Exception { +423 RundeckClient client = createClient(TEST_TOKEN_3, 5); +424 +425 final RundeckExecution test; +426 try { +427 test = client.triggerJob("3170ba0e-6093-4b58-94d2-52988aefbfc9",null,null,"api-java-client-user-test2"); +428 Assert.fail("should not succeed"); +429 } catch (RundeckApiException e) { +430 Assert.assertEquals("Not authorized for action \"Run as User\" for Job ID 3170ba0e-6093-4b58-94d2-52988aefbfc9", e.getMessage()); +431 } +432 } +433 @Test +434 @Betamax(tape = "trigger_job_as_user_unauthorized") +435 public void triggerJobAsUserUnauthorized() throws Exception { +436 RundeckClient client = createClient(TEST_TOKEN_3, 5); +437 +438 final RundeckExecution test; +439 try { +440 test = client.triggerJob(RunJobBuilder.builder() +441 .setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9") +442 .setAsUser("api-java-client-user-test2") +443 .build()); +444 Assert.fail("should not succeed"); +445 } catch (RundeckApiException e) { +446 Assert.assertEquals("Not authorized for action \"Run as User\" for Job ID 3170ba0e-6093-4b58-94d2-52988aefbfc9", e.getMessage()); +447 } +448 } +449 +450 @Test +451 @Betamax(tape = "trigger_adhoc_command") +452 public void triggerAdhocCommandDeprecated() throws Exception { +453 RundeckClient client = createClient(TEST_TOKEN_3, 5); +454 +455 final RundeckExecution test +456 = client.triggerAdhocCommand("test", "echo test trigger_adhoc_command"); +457 +458 Assert.assertEquals((Long) 23L, test.getId()); +459 Assert.assertEquals(null, test.getArgstring()); +460 Assert.assertEquals(null, test.getAbortedBy()); +461 Assert.assertEquals("echo test trigger_adhoc_command", test.getDescription()); +462 Assert.assertEquals("admin", test.getStartedBy()); +463 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); +464 } +465 +466 @Test +467 @Betamax(tape = "trigger_adhoc_command") +468 public void triggerAdhocCommand() throws Exception { +469 RundeckClient client = createClient(TEST_TOKEN_3, 5); +470 +471 final RundeckExecution test +472 = client.triggerAdhocCommand(RunAdhocCommandBuilder.builder() +473 .setProject("test") +474 .setCommand("echo test trigger_adhoc_command") +475 .build()); +476 +477 Assert.assertEquals((Long) 23L, test.getId()); +478 Assert.assertEquals(null, test.getArgstring()); +479 Assert.assertEquals(null, test.getAbortedBy()); +480 Assert.assertEquals("echo test trigger_adhoc_command", test.getDescription()); +481 Assert.assertEquals("admin", test.getStartedBy()); +482 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); +483 } +484 +485 @Test +486 @Betamax(tape = "trigger_adhoc_command_as_user") +487 public void triggerAdhocCommandDeprecatedAsUser() throws Exception { +488 RundeckClient client = createClient(TEST_TOKEN_3, 5); +489 +490 final RundeckExecution test +491 = client.triggerAdhocCommand("test", "echo test trigger_adhoc_command_as_user",null,null,null,"api-java-client-test-run-command-as-user1"); +492 +493 Assert.assertEquals((Long) 24L, test.getId()); +494 Assert.assertEquals(null, test.getArgstring()); +495 Assert.assertEquals(null, test.getAbortedBy()); +496 Assert.assertEquals("echo test trigger_adhoc_command_as_user", test.getDescription()); +497 Assert.assertEquals("api-java-client-test-run-command-as-user1", test.getStartedBy()); +498 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); +499 } +500 @Test +501 @Betamax(tape = "trigger_adhoc_command_as_user") +502 public void triggerAdhocCommandAsUser() throws Exception { +503 RundeckClient client = createClient(TEST_TOKEN_3, 5); +504 +505 final RundeckExecution test +506 = client.triggerAdhocCommand( +507 RunAdhocCommandBuilder.builder() +508 .setProject("test") +509 .setCommand("echo test trigger_adhoc_command_as_user") +510 .setAsUser("api-java-client-test-run-command-as-user1") +511 .build() +512 ); +513 +514 Assert.assertEquals((Long) 24L, test.getId()); +515 Assert.assertEquals(null, test.getArgstring()); +516 Assert.assertEquals(null, test.getAbortedBy()); +517 Assert.assertEquals("echo test trigger_adhoc_command_as_user", test.getDescription()); +518 Assert.assertEquals("api-java-client-test-run-command-as-user1", test.getStartedBy()); +519 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); +520 } +521 @Test +522 @Betamax(tape = "trigger_adhoc_command_as_user_unauthorized") +523 public void triggerAdhocCommandDeprecatedAsUserUnauthorized() throws Exception { +524 RundeckClient client = createClient(TEST_TOKEN_3, 5); +525 +526 final RundeckExecution test; +527 try { +528 test = client.triggerAdhocCommand("test", "echo test trigger_adhoc_command_as_user",null,null,null,"api-java-client-test-run-command-as-user1"); +529 Assert.fail("should not succeed"); +530 } catch (RundeckApiException e) { +531 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); +532 } +533 } +534 @Test +535 @Betamax(tape = "trigger_adhoc_command_as_user_unauthorized") +536 public void triggerAdhocCommandAsUserUnauthorized() throws Exception { +537 RundeckClient client = createClient(TEST_TOKEN_3, 5); +538 +539 final RundeckExecution test; +540 try { +541 test = client.triggerAdhocCommand( +542 RunAdhocCommandBuilder.builder() +543 .setProject("test") +544 .setCommand("echo test trigger_adhoc_command_as_user") +545 .setAsUser("api-java-client-test-run-command-as-user1") +546 .build() +547 ); +548 Assert.fail("should not succeed"); +549 } catch (RundeckApiException e) { +550 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); +551 } +552 } +553 +554 @Test +555 @Betamax(tape = "trigger_adhoc_script") +556 public void triggerAdhocScriptDeprecated() throws Exception { +557 RundeckClient client = createClient(TEST_TOKEN_3, 5); +558 String script = "#!/bin/bash\n" + +559 "echo test trigger_adhoc_script\n"; +560 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +561 +562 final RundeckExecution test +563 = client.triggerAdhocScript("test", byteArrayInputStream,(Properties) null, null, null, null, null); +564 +565 Assert.assertEquals((Long) 25L, test.getId()); +566 Assert.assertEquals(null, test.getArgstring()); +567 Assert.assertEquals(null, test.getAbortedBy()); +568 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +569 Assert.assertEquals("admin", test.getStartedBy()); +570 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +571 } +572 @Test +573 @Betamax(tape = "trigger_adhoc_script") +574 public void triggerAdhocScript() throws Exception { +575 RundeckClient client = createClient(TEST_TOKEN_3, 5); +576 String script = "#!/bin/bash\n" + +577 "echo test trigger_adhoc_script\n"; +578 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +579 +580 final RundeckExecution test +581 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +582 (byteArrayInputStream).build()); +583 +584 Assert.assertEquals((Long) 25L, test.getId()); +585 Assert.assertEquals(null, test.getArgstring()); +586 Assert.assertEquals(null, test.getAbortedBy()); +587 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +588 Assert.assertEquals("admin", test.getStartedBy()); +589 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +590 } +591 @Test +592 @Betamax(tape = "trigger_adhoc_script_as_user") +593 public void triggerAdhocScriptDeprecatedAsUser() throws Exception { +594 RundeckClient client = createClient(TEST_TOKEN_3, 5); +595 String script = "#!/bin/bash\n" + +596 "echo test trigger_adhoc_script\n"; +597 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +598 +599 final RundeckExecution test +600 = client.triggerAdhocScript("test", byteArrayInputStream, (Properties) null, null, null, null, "api-java-client-test-adhoc-script-as-user1"); +601 +602 Assert.assertEquals((Long) 26L, test.getId()); +603 Assert.assertEquals(null, test.getArgstring()); +604 Assert.assertEquals(null, test.getAbortedBy()); +605 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +606 Assert.assertEquals("api-java-client-test-adhoc-script-as-user1", test.getStartedBy()); +607 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +608 } +609 @Test +610 @Betamax(tape = "trigger_adhoc_script_as_user") +611 public void triggerAdhocScriptAsUser() throws Exception { +612 RundeckClient client = createClient(TEST_TOKEN_3, 5); +613 String script = "#!/bin/bash\n" + +614 "echo test trigger_adhoc_script\n"; +615 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +616 +617 final RundeckExecution test +618 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +619 (byteArrayInputStream).setAsUser("api-java-client-test-adhoc-script-as-user1").build()); +620 +621 Assert.assertEquals((Long) 26L, test.getId()); +622 Assert.assertEquals(null, test.getArgstring()); +623 Assert.assertEquals(null, test.getAbortedBy()); +624 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +625 Assert.assertEquals("api-java-client-test-adhoc-script-as-user1", test.getStartedBy()); +626 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +627 } +628 @Test +629 @Betamax(tape = "trigger_adhoc_script_as_user_unauthorized") +630 public void triggerAdhocScriptDeprecatedAsUserUnauthorized() throws Exception { +631 RundeckClient client = createClient(TEST_TOKEN_3, 5); +632 String script = "#!/bin/bash\n" + +633 "echo test trigger_adhoc_script\n"; +634 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +635 +636 try{ +637 final RundeckExecution test +638 = client.triggerAdhocScript("test", byteArrayInputStream, (Properties) null, null, null, null, "api-java-client-test-adhoc-script-as-user1"); +639 Assert.fail("should not succeed"); +640 } catch (RundeckApiException e) { +641 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); +642 } +643 +644 } +645 @Test +646 @Betamax(tape = "trigger_adhoc_script_as_user_unauthorized") +647 public void triggerAdhocScriptAsUserUnauthorized() throws Exception { +648 RundeckClient client = createClient(TEST_TOKEN_3, 5); +649 String script = "#!/bin/bash\n" + +650 "echo test trigger_adhoc_script\n"; +651 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +652 +653 try{ +654 final RundeckExecution test +655 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +656 (byteArrayInputStream).setAsUser("api-java-client-test-adhoc-script-as-user1").build()); +657 Assert.fail("should not succeed"); +658 } catch (RundeckApiException e) { +659 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); +660 } +661 +662 } +663 +664 @Test +665 @Betamax(tape = "trigger_adhoc_script_interpreter") +666 public void triggerAdhocScriptInpterpreter() throws Exception { +667 RundeckClient client = createClient(TEST_TOKEN_3, 8); +668 String script = "#!/bin/bash\n" + +669 "echo test trigger_adhoc_script\n"; +670 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +671 final RundeckExecution test +672 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder() +673 .setProject("test").setScript(byteArrayInputStream) +674 .setScriptInterpreter("sudo -c bob") +675 .build()); +676 +677 Assert.assertEquals((Long) 27L, test.getId()); +678 Assert.assertEquals(null, test.getArgstring()); +679 Assert.assertEquals(null, test.getAbortedBy()); +680 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +681 Assert.assertEquals("admin", test.getStartedBy()); +682 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +683 } +684 @Test +685 @Betamax(tape = "abort_execution") +686 public void abortExecution() throws Exception { +687 RundeckClient client = createClient(TEST_TOKEN_3, 5); +688 +689 long executionId = 21L; +690 final RundeckAbort test = client.abortExecution(executionId); +691 +692 Assert.assertEquals((Long) executionId,test.getExecution().getId()); +693 Assert.assertEquals(RundeckAbort.AbortStatus.PENDING,test.getStatus()); +694 } +695 @Test +696 @Betamax(tape = "abort_execution_as_user") +697 public void abortExecutionAsUser() throws Exception { +698 RundeckClient client = createClient(TEST_TOKEN_3, 5); +699 +700 long executionId = 22L; +701 final RundeckAbort test = client.abortExecution(executionId,"api-java-client-test-abort-as-user1"); +702 +703 Assert.assertEquals((Long) executionId,test.getExecution().getId()); +704 Assert.assertEquals(RundeckAbort.AbortStatus.PENDING,test.getStatus()); +705 } +706 @Test +707 @Betamax(tape = "abort_execution_as_user_unauthorized") +708 public void abortExecutionAsUserUnauthorized() throws Exception { +709 RundeckClient client = createClient(TEST_TOKEN_3, 5); +710 +711 long executionId = 28L; +712 final RundeckAbort test = client.abortExecution(executionId, "api-java-client-test-abort-as-user1"); +713 Assert.assertEquals(RundeckAbort.AbortStatus.FAILED, test.getStatus()); +714 } +715 private void assertPageResults(PagedResults<RundeckExecution> jobTest, +716 final int size, +717 final int count, final int max, final int offset, final int total) { +718 Assert.assertEquals(size, jobTest.getResults().size()); +719 Assert.assertEquals(count, jobTest.getCount()); +720 Assert.assertEquals(max, jobTest.getMax()); +721 Assert.assertEquals(offset, jobTest.getOffset()); +722 Assert.assertEquals(total, jobTest.getTotal()); +723 } +724 +725 /** +726 * Import jobs, xml contains project context +727 * @throws Exception +728 */ +729 @Test +730 @Betamax(tape = "import_jobs_context_project") +731 public void importJobsContextProject() throws Exception { +732 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +733 InputStream stream=new ByteArrayInputStream( +734 ("<joblist>\n" + +735 " <job>\n" + +736 " <loglevel>INFO</loglevel>\n" + +737 " <sequence keepgoing='false' strategy='node-first'>\n" + +738 " <command>\n" + +739 " <exec>echo hi</exec>\n" + +740 " </command>\n" + +741 " </sequence>\n" + +742 " <description></description>\n" + +743 " <name>job1</name>\n" + +744 " <context>\n" + +745 " <project>test</project>\n" + +746 " </context>\n" + +747 " </job>\n" + +748 "</joblist>").getBytes("utf-8")); +749 +750 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +751 .setStream(stream) +752 .setFileType(FileType.XML) +753 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +754 .build(); +755 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +756 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +757 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +758 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +759 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +760 Assert.assertEquals("job1", rundeckJob.getName()); +761 Assert.assertEquals("test", rundeckJob.getProject()); +762 } +763 /** +764 * Import jobs, xml no project defined +765 * @throws Exception +766 */ +767 @Test +768 @Betamax(tape = "import_jobs_no_project") +769 public void importJobsNoProject() throws Exception { +770 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +771 InputStream stream=new ByteArrayInputStream( +772 ("<joblist>\n" + +773 " <job>\n" + +774 " <loglevel>INFO</loglevel>\n" + +775 " <sequence keepgoing='false' strategy='node-first'>\n" + +776 " <command>\n" + +777 " <exec>echo hi</exec>\n" + +778 " </command>\n" + +779 " </sequence>\n" + +780 " <description></description>\n" + +781 " <name>job2</name>\n" + +782 " </job>\n" + +783 "</joblist>").getBytes("utf-8")); +784 +785 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +786 .setStream(stream) +787 .setFileType(FileType.XML) +788 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +789 .build(); +790 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +791 Assert.assertEquals(1,rundeckJobsImportResult.getFailedJobs().size()); +792 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +793 Assert.assertEquals(0,rundeckJobsImportResult.getSucceededJobs().size()); +794 RundeckJob rundeckJob = rundeckJobsImportResult.getFailedJobs().entrySet().iterator().next().getKey(); +795 String reason = rundeckJobsImportResult.getFailedJobs().get(rundeckJob); +796 Assert.assertEquals("job2", rundeckJob.getName()); +797 Assert.assertEquals(null, rundeckJob.getProject()); +798 Assert.assertTrue(reason.contains("Project was not specified")); +799 } +800 /** +801 * Import jobs, using project parameter +802 * @throws Exception +803 */ +804 @Test +805 @Betamax(tape = "import_jobs_project_param") +806 public void importJobsProjectParam() throws Exception { +807 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +808 InputStream stream=new ByteArrayInputStream( +809 ("<joblist>\n" + +810 " <job>\n" + +811 " <loglevel>INFO</loglevel>\n" + +812 " <sequence keepgoing='false' strategy='node-first'>\n" + +813 " <command>\n" + +814 " <exec>echo hi</exec>\n" + +815 " </command>\n" + +816 " </sequence>\n" + +817 " <description></description>\n" + +818 " <name>importJobsProjectParam</name>\n" + +819 " </job>\n" + +820 "</joblist>").getBytes("utf-8")); +821 +822 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +823 .setStream(stream) +824 .setFileType(FileType.XML) +825 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +826 .setProject("test") +827 .build(); +828 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +829 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +830 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +831 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +832 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +833 Assert.assertEquals("importJobsProjectParam", rundeckJob.getName()); +834 Assert.assertEquals("test", rundeckJob.getProject()); +835 } +836 /** +837 * Import jobs, project parameter overrides xml +838 * @throws Exception +839 */ +840 @Test +841 @Betamax(tape = "import_jobs_project_param_override") +842 public void importJobsProjectParamOverride() throws Exception { +843 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +844 InputStream stream=new ByteArrayInputStream( +845 ("<joblist>\n" + +846 " <job>\n" + +847 " <loglevel>INFO</loglevel>\n" + +848 " <sequence keepgoing='false' strategy='node-first'>\n" + +849 " <command>\n" + +850 " <exec>echo hi</exec>\n" + +851 " </command>\n" + +852 " </sequence>\n" + +853 " <description></description>\n" + +854 " <name>importJobsProjectParamOverride</name>\n" + +855 " <context>\n" + +856 " <project>testXYZ</project>\n" + +857 " </context>\n" + +858 " </job>\n" + +859 "</joblist>").getBytes("utf-8")); +860 +861 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +862 .setStream(stream) +863 .setFileType(FileType.XML) +864 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +865 .setProject("test") +866 .build(); +867 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +868 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +869 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +870 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +871 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +872 Assert.assertEquals("importJobsProjectParamOverride", rundeckJob.getName()); +873 Assert.assertEquals("test", rundeckJob.getProject()); +874 } +875 /** +876 * Import jobs, project parameter v7 doesn' use parameter +877 * @throws Exception +878 */ +879 @Test +880 @Betamax(tape = "import_jobs_project_param_v7") +881 public void importJobsProjectParamV7() throws Exception { +882 final RundeckClient client = createClient(TEST_TOKEN_4, 7); +883 InputStream stream=new ByteArrayInputStream( +884 ("<joblist>\n" + +885 " <job>\n" + +886 " <loglevel>INFO</loglevel>\n" + +887 " <sequence keepgoing='false' strategy='node-first'>\n" + +888 " <command>\n" + +889 " <exec>echo hi</exec>\n" + +890 " </command>\n" + +891 " </sequence>\n" + +892 " <description></description>\n" + +893 " <name>importJobsProjectParamV7</name>\n" + +894 " <context>\n" + +895 " <project>testXYZ</project>\n" + +896 " </context>\n" + +897 " </job>\n" + +898 "</joblist>").getBytes("utf-8")); +899 +900 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +901 .setStream(stream) +902 .setFileType(FileType.XML) +903 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +904 .setProject("test") +905 .build(); +906 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +907 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +908 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +909 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +910 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +911 Assert.assertEquals("importJobsProjectParamV7", rundeckJob.getName()); +912 Assert.assertEquals("testXYZ", rundeckJob.getProject()); +913 } +914 +915 @Before +916 public void setUp() throws Exception { +917 // not that you can put whatever here, because we don't actually connect to the RunDeck instance +918 // but instead use betamax as a proxy to serve the previously recorded tapes (in src/test/resources) +919 client = createClient(TEST_TOKEN_0, 5); +920 } +921 +922 private RundeckClient createClient(final String token, int version) { +923 return createBuilder(token).version(version).build(); +924 } +925 +926 private RundeckClient createClient(String token) { +927 return createBuilder(token) +928 .build(); +929 } +930 +931 private RundeckClientBuilder createBuilder(String token) { +932 return RundeckClient.builder().url("http://rundeck.local:4440") +933 .token(token); +934 } +935 +936 }
    diff --git a/xref-test/org/rundeck/api/package-frame.html b/xref-test/org/rundeck/api/package-frame.html index 782282d..3d9f170 100644 --- a/xref-test/org/rundeck/api/package-frame.html +++ b/xref-test/org/rundeck/api/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api diff --git a/xref-test/org/rundeck/api/package-summary.html b/xref-test/org/rundeck/api/package-summary.html index 88555f2..c4f5cf7 100644 --- a/xref-test/org/rundeck/api/package-summary.html +++ b/xref-test/org/rundeck/api/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api diff --git a/xref-test/org/rundeck/api/parser/package-frame.html b/xref-test/org/rundeck/api/parser/package-frame.html index e1e61da..6e6ab63 100644 --- a/xref-test/org/rundeck/api/parser/package-frame.html +++ b/xref-test/org/rundeck/api/parser/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.parser + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.parser diff --git a/xref-test/org/rundeck/api/parser/package-summary.html b/xref-test/org/rundeck/api/parser/package-summary.html index 1d5ce50..6e982e0 100644 --- a/xref-test/org/rundeck/api/parser/package-summary.html +++ b/xref-test/org/rundeck/api/parser/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.parser + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.parser diff --git a/xref-test/org/rundeck/api/util/package-frame.html b/xref-test/org/rundeck/api/util/package-frame.html index 18c609b..278f96f 100644 --- a/xref-test/org/rundeck/api/util/package-frame.html +++ b/xref-test/org/rundeck/api/util/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.util + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.util diff --git a/xref-test/org/rundeck/api/util/package-summary.html b/xref-test/org/rundeck/api/util/package-summary.html index 60feac8..4eb2994 100644 --- a/xref-test/org/rundeck/api/util/package-summary.html +++ b/xref-test/org/rundeck/api/util/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.util + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.util diff --git a/xref-test/overview-frame.html b/xref-test/overview-frame.html index 4ffb7d4..aea9d85 100644 --- a/xref-test/overview-frame.html +++ b/xref-test/overview-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference + RunDeck API - Java Client 8.0 Reference diff --git a/xref-test/overview-summary.html b/xref-test/overview-summary.html index e0f2983..8e9f6db 100644 --- a/xref-test/overview-summary.html +++ b/xref-test/overview-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference + RunDeck API - Java Client 8.0 Reference @@ -24,7 +24,7 @@
    -

    RunDeck API - Java Client 6.0 Reference

    +

    RunDeck API - Java Client 8.0 Reference

    diff --git a/xref/allclasses-frame.html b/xref/allclasses-frame.html index e1154f8..2b54d99 100644 --- a/xref/allclasses-frame.html +++ b/xref/allclasses-frame.html @@ -34,6 +34,21 @@
  • BulkDeleteParser +
  • +
  • + DefaultJobsImport +
  • +
  • + DefaultRunAdhoc +
  • +
  • + DefaultRunAdhocCommand +
  • +
  • + DefaultRunAdhocScript +
  • +
  • + DefaultRunJob
  • DeleteParser @@ -109,6 +124,27 @@
  • QueryParameterBuilder +
  • +
  • + RunAdhoc +
  • +
  • + RunAdhocCommand +
  • +
  • + RunAdhocCommandBuilder +
  • +
  • + RunAdhocScript +
  • +
  • + RunAdhocScriptBuilder +
  • +
  • + RunJob +
  • +
  • + RunJobBuilder
  • RundeckAbort @@ -148,6 +184,12 @@
  • RundeckJobDeleteBulk +
  • +
  • + RundeckJobsImport +
  • +
  • + RundeckJobsImportBuilder
  • RundeckJobsImportMethod diff --git a/xref/index.html b/xref/index.html index a980f60..b1874b6 100644 --- a/xref/index.html +++ b/xref/index.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference + RunDeck API - Java Client 8.0 Reference diff --git a/xref/org/rundeck/api/DefaultJobsImport.html b/xref/org/rundeck/api/DefaultJobsImport.html new file mode 100644 index 0000000..58badf4 --- /dev/null +++ b/xref/org/rundeck/api/DefaultJobsImport.html @@ -0,0 +1,61 @@ + + + + +DefaultJobsImport xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import org.rundeck.api.domain.RundeckJobsImportMethod;
    +4   
    +5   import java.io.InputStream;
    +6   
    +7   /**
    +8    * $INTERFACE is ... User: greg Date: 8/6/13 Time: 10:18 AM
    +9    */
    +10  public class DefaultJobsImport implements RundeckJobsImport{
    +11      private InputStream stream;
    +12      private FileType fileType;
    +13      private RundeckJobsImportMethod importMethod;
    +14      private String project;
    +15  
    +16      public InputStream getStream() {
    +17          return stream;
    +18      }
    +19  
    +20      public void setStream(final InputStream stream) {
    +21          this.stream = stream;
    +22      }
    +23  
    +24      public FileType getFileType() {
    +25          return fileType;
    +26      }
    +27  
    +28      public void setFileType(final FileType fileType) {
    +29          this.fileType = fileType;
    +30      }
    +31  
    +32      public RundeckJobsImportMethod getImportMethod() {
    +33          return importMethod;
    +34      }
    +35  
    +36      public void setImportMethod(final RundeckJobsImportMethod importMethod) {
    +37          this.importMethod = importMethod;
    +38      }
    +39  
    +40      public String getProject() {
    +41          return project;
    +42      }
    +43  
    +44      public void setProject(final String project) {
    +45          this.project = project;
    +46      }
    +47  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/DefaultRunAdhoc.html b/xref/org/rundeck/api/DefaultRunAdhoc.html new file mode 100644 index 0000000..2e75d90 --- /dev/null +++ b/xref/org/rundeck/api/DefaultRunAdhoc.html @@ -0,0 +1,68 @@ + + + + +DefaultRunAdhoc xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.util.Properties;
    +4   
    +5   /**
    +6    * Base class for adhoc requests
    +7    */
    +8   class DefaultRunAdhoc implements RunAdhoc{
    +9       private String project;
    +10      private Properties nodeFilters;
    +11      private Integer nodeThreadcount;
    +12      private Boolean nodeKeepgoing;
    +13      private String asUser;
    +14  
    +15      public String getProject() {
    +16          return project;
    +17      }
    +18  
    +19      public void setProject(String project) {
    +20          this.project = project;
    +21      }
    +22  
    +23      public Properties getNodeFilters() {
    +24          return nodeFilters;
    +25      }
    +26  
    +27      public void setNodeFilters(Properties nodeFilters) {
    +28          this.nodeFilters = nodeFilters;
    +29      }
    +30  
    +31      public Integer getNodeThreadcount() {
    +32          return nodeThreadcount;
    +33      }
    +34  
    +35      public void setNodeThreadcount(Integer nodeThreadcount) {
    +36          this.nodeThreadcount = nodeThreadcount;
    +37      }
    +38  
    +39      public Boolean getNodeKeepgoing() {
    +40          return nodeKeepgoing;
    +41      }
    +42  
    +43      public void setNodeKeepgoing(Boolean nodeKeepgoing) {
    +44          this.nodeKeepgoing = nodeKeepgoing;
    +45      }
    +46  
    +47      public String getAsUser() {
    +48          return asUser;
    +49      }
    +50  
    +51      public void setAsUser(String asUser) {
    +52          this.asUser = asUser;
    +53      }
    +54  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/DefaultRunAdhocCommand.html b/xref/org/rundeck/api/DefaultRunAdhocCommand.html new file mode 100644 index 0000000..5229651 --- /dev/null +++ b/xref/org/rundeck/api/DefaultRunAdhocCommand.html @@ -0,0 +1,32 @@ + + + + +DefaultRunAdhocCommand xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   /**
    +4    * Implementation of {@link RunAdhocCommand}
    +5    */
    +6   class DefaultRunAdhocCommand extends DefaultRunAdhoc implements RunAdhocCommand {
    +7       private String command;
    +8   
    +9       @Override
    +10      public String getCommand() {
    +11          return command;
    +12      }
    +13  
    +14      public void setCommand(String command) {
    +15          this.command = command;
    +16      }
    +17  
    +18  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/DefaultRunAdhocScript.html b/xref/org/rundeck/api/DefaultRunAdhocScript.html new file mode 100644 index 0000000..30c14f8 --- /dev/null +++ b/xref/org/rundeck/api/DefaultRunAdhocScript.html @@ -0,0 +1,60 @@ + + + + +DefaultRunAdhocScript xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.io.InputStream;
    +4   
    +5   /**
    +6    * Bean implementing {@link RunAdhocScript}
    +7    */
    +8   class DefaultRunAdhocScript extends DefaultRunAdhoc implements RunAdhocScript {
    +9       private InputStream script;
    +10      private String argString;
    +11      private String scriptInterpreter;
    +12      private Boolean interpreterArgsQuoted;
    +13  
    +14      @Override
    +15      public InputStream getScript() {
    +16          return script;
    +17      }
    +18  
    +19      public void setScript(InputStream script) {
    +20          this.script = script;
    +21      }
    +22  
    +23      public String getArgString() {
    +24          return argString;
    +25      }
    +26  
    +27      public void setArgString(String argString) {
    +28          this.argString = argString;
    +29      }
    +30  
    +31      public String getScriptInterpreter() {
    +32          return scriptInterpreter;
    +33      }
    +34  
    +35      public void setScriptInterpreter(String scriptInterpreter) {
    +36          this.scriptInterpreter = scriptInterpreter;
    +37      }
    +38  
    +39      public Boolean getInterpreterArgsQuoted() {
    +40          return interpreterArgsQuoted;
    +41      }
    +42  
    +43      public void setInterpreterArgsQuoted(Boolean interpreterArgsQuoted) {
    +44          this.interpreterArgsQuoted = interpreterArgsQuoted;
    +45      }
    +46  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/DefaultRunJob.html b/xref/org/rundeck/api/DefaultRunJob.html new file mode 100644 index 0000000..d24c57c --- /dev/null +++ b/xref/org/rundeck/api/DefaultRunJob.html @@ -0,0 +1,64 @@ + + + + +DefaultRunJob xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.util.Properties;
    +4   
    +5   /**
    +6    * impl of {@link RunJob}
    +7    */
    +8   class DefaultRunJob implements RunJob {
    +9       private String jobId;
    +10      private Properties options;
    +11      private Properties nodeFilters;
    +12      private String asUser;
    +13  
    +14  
    +15      @Override
    +16      public String getJobId() {
    +17          return jobId;
    +18      }
    +19  
    +20      @Override
    +21      public Properties getOptions() {
    +22          return options;
    +23      }
    +24  
    +25      @Override
    +26      public Properties getNodeFilters() {
    +27          return nodeFilters;
    +28      }
    +29  
    +30      @Override
    +31      public String getAsUser() {
    +32          return asUser;
    +33      }
    +34  
    +35      public void setJobId(String jobId) {
    +36          this.jobId = jobId;
    +37      }
    +38  
    +39      public void setOptions(Properties options) {
    +40          this.options = options;
    +41      }
    +42  
    +43      public void setNodeFilters(Properties nodeFilters) {
    +44          this.nodeFilters = nodeFilters;
    +45      }
    +46  
    +47      public void setAsUser(String asUser) {
    +48          this.asUser = asUser;
    +49      }
    +50  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RunAdhoc.html b/xref/org/rundeck/api/RunAdhoc.html new file mode 100644 index 0000000..002392e --- /dev/null +++ b/xref/org/rundeck/api/RunAdhoc.html @@ -0,0 +1,52 @@ + + + + +RunAdhoc xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.util.Properties;
    +4   
    +5   /**
    +6    * Super interface for adhoc executions
    +7    */
    +8   public interface RunAdhoc {
    +9       /**
    +10       * Project name, required
    +11       * @return
    +12       */
    +13      String getProject();
    +14  
    +15      /**
    +16       * Filters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder}
    +17       * @return
    +18       */
    +19      Properties getNodeFilters();
    +20  
    +21      /**
    +22       * Thread count to use (for parallelizing when running on multiple nodes) - optional
    +23       * @return
    +24       */
    +25      Integer getNodeThreadcount();
    +26  
    +27      /**
    +28       * if true, continue executing on other nodes even if some fail - optional
    +29       * @return
    +30       */
    +31      Boolean getNodeKeepgoing();
    +32  
    +33      /**
    +34       * Specify a user name to run the job as, must have 'runAs' permission
    +35       * @return
    +36       */
    +37      String getAsUser();
    +38  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RunAdhocCommand.html b/xref/org/rundeck/api/RunAdhocCommand.html new file mode 100644 index 0000000..c637932 --- /dev/null +++ b/xref/org/rundeck/api/RunAdhocCommand.html @@ -0,0 +1,28 @@ + + + + +RunAdhocCommand xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   /**
    +4    * A command to execute
    +5    */
    +6   public interface RunAdhocCommand extends RunAdhoc {
    +7   
    +8       /**
    +9        * Command to executed
    +10       * @return
    +11       */
    +12      String getCommand();
    +13  
    +14  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RunAdhocCommandBuilder.html b/xref/org/rundeck/api/RunAdhocCommandBuilder.html new file mode 100644 index 0000000..aaab65c --- /dev/null +++ b/xref/org/rundeck/api/RunAdhocCommandBuilder.html @@ -0,0 +1,69 @@ + + + + +RunAdhocCommandBuilder xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.util.Properties;
    +4   
    +5   /**
    +6    * Builder for adhoc command request
    +7    */
    +8   public class RunAdhocCommandBuilder {
    +9       private DefaultRunAdhocCommand command;
    +10  
    +11      public RunAdhocCommandBuilder() {
    +12          command = new DefaultRunAdhocCommand();
    +13      }
    +14  
    +15      public static RunAdhocCommandBuilder builder() {
    +16          return new RunAdhocCommandBuilder();
    +17      }
    +18  
    +19      public RunAdhocCommandBuilder setProject(String project) {
    +20          command.setProject(project);
    +21  
    +22          return this;
    +23      }
    +24  
    +25      public RunAdhocCommandBuilder setCommand(String commandString) {
    +26          command.setCommand(commandString);
    +27          return this;
    +28      }
    +29  
    +30      public RunAdhocCommandBuilder setNodeFilters(Properties nodeFilters) {
    +31          command.setNodeFilters(nodeFilters);
    +32          return this;
    +33      }
    +34  
    +35      public RunAdhocCommandBuilder setNodeThreadcount(Integer nodeThreadcount) {
    +36          command.setNodeThreadcount(nodeThreadcount);
    +37          return this;
    +38      }
    +39  
    +40      public RunAdhocCommandBuilder setNodeKeepgoing(Boolean nodeKeepgoing) {
    +41          command.setNodeKeepgoing(nodeKeepgoing);
    +42          return this;
    +43      }
    +44  
    +45      public RunAdhocCommandBuilder setAsUser(String asUser) {
    +46          command.setAsUser(asUser);
    +47          return this;
    +48      }
    +49  
    +50      public RunAdhocCommand build() {
    +51          DefaultRunAdhocCommand built = command;
    +52          command = new DefaultRunAdhocCommand();
    +53          return built;
    +54      }
    +55  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RunAdhocScript.html b/xref/org/rundeck/api/RunAdhocScript.html new file mode 100644 index 0000000..2e99447 --- /dev/null +++ b/xref/org/rundeck/api/RunAdhocScript.html @@ -0,0 +1,48 @@ + + + + +RunAdhocScript xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.io.InputStream;
    +4   
    +5   /**
    +6    * An adhoc script to be executed by Rundeck
    +7    */
    +8   public interface RunAdhocScript extends RunAdhoc {
    +9   
    +10      /**
    +11       * InputStream for reading the script to be executed - mandatory
    +12       * @return
    +13       */
    +14      InputStream getScript();
    +15  
    +16      /**
    +17       * Arguments to the script
    +18       * @return
    +19       */
    +20      String getArgString();
    +21  
    +22      /**
    +23       * Command string to invoke the script with arguments
    +24       * @return
    +25       */
    +26      String getScriptInterpreter();
    +27  
    +28      /**
    +29       * If true, quote the script filepath and args to the script interpreter.
    +30       * @return
    +31       */
    +32      Boolean getInterpreterArgsQuoted();
    +33  
    +34  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RunAdhocScriptBuilder.html b/xref/org/rundeck/api/RunAdhocScriptBuilder.html new file mode 100644 index 0000000..583ad00 --- /dev/null +++ b/xref/org/rundeck/api/RunAdhocScriptBuilder.html @@ -0,0 +1,114 @@ + + + + +RunAdhocScriptBuilder xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.io.InputStream;
    +4   import java.util.Properties;
    +5   
    +6   /**
    +7    * A builder to build a {@link RunAdhocScript}, use the {@link #builder()} to build a builder, then {@link #build()}
    +8    * to build an RunAdhocScript
    +9    */
    +10  public class RunAdhocScriptBuilder {
    +11      private DefaultRunAdhocScript script;
    +12  
    +13      private RunAdhocScriptBuilder() {
    +14          script = new DefaultRunAdhocScript();
    +15      }
    +16  
    +17      public RunAdhocScriptBuilder(final RunAdhocScript oldScript) {
    +18          script = new DefaultRunAdhocScript();
    +19          setAsUser(oldScript.getAsUser());
    +20          setArgString(oldScript.getArgString());
    +21          setProject(oldScript.getProject());
    +22          setScript(oldScript.getScript());
    +23          setNodeFilters(oldScript.getNodeFilters());
    +24          setNodeKeepgoing(oldScript.getNodeKeepgoing());
    +25          setNodeThreadcount(oldScript.getNodeThreadcount());
    +26          setScriptInterpreter(oldScript.getScriptInterpreter());
    +27          setInterpreterArgsQuoted(oldScript.getInterpreterArgsQuoted());
    +28      }
    +29  
    +30      /**
    +31       * Create a new builder
    +32       *
    +33       * @return
    +34       */
    +35      public static RunAdhocScriptBuilder builder() {
    +36          return new RunAdhocScriptBuilder();
    +37      }
    +38  
    +39      /**
    +40       * Create a builder initialized with an existing {@link RunAdhocScript}
    +41       *
    +42       * @param script
    +43       *
    +44       * @return this builder
    +45       */
    +46      public static RunAdhocScriptBuilder builder(final RunAdhocScript script) {
    +47          return new RunAdhocScriptBuilder(script);
    +48      }
    +49  
    +50      public RunAdhocScriptBuilder setProject(final String project) {
    +51          script.setProject(project);
    +52          return this;
    +53      }
    +54  
    +55      public RunAdhocScriptBuilder setScript(final InputStream stream) {
    +56          script.setScript(stream);
    +57          return this;
    +58      }
    +59  
    +60      public RunAdhocScriptBuilder setArgString(final String argString) {
    +61          script.setArgString(argString);
    +62          return this;
    +63      }
    +64  
    +65      public RunAdhocScriptBuilder setNodeFilters(final Properties nodeFilters) {
    +66          script.setNodeFilters(nodeFilters);
    +67          return this;
    +68      }
    +69  
    +70      public RunAdhocScriptBuilder setNodeThreadcount(final Integer nodeThreadcount) {
    +71          script.setNodeThreadcount(nodeThreadcount);
    +72          return this;
    +73      }
    +74  
    +75      public RunAdhocScriptBuilder setNodeKeepgoing(final Boolean nodeKeepgoing) {
    +76          script.setNodeKeepgoing(nodeKeepgoing);
    +77          return this;
    +78      }
    +79  
    +80      public RunAdhocScriptBuilder setAsUser(final String asUser) {
    +81          script.setAsUser(asUser);
    +82          return this;
    +83      }
    +84  
    +85      public RunAdhocScriptBuilder setScriptInterpreter(final String scriptInterpreter) {
    +86          script.setScriptInterpreter(scriptInterpreter);
    +87          return this;
    +88      }
    +89  
    +90      public RunAdhocScriptBuilder setInterpreterArgsQuoted(final Boolean interpreterArgsQuoted) {
    +91          script.setInterpreterArgsQuoted(interpreterArgsQuoted);
    +92          return this;
    +93      }
    +94  
    +95      public RunAdhocScript build() {
    +96          final DefaultRunAdhocScript built = script;
    +97          script = new DefaultRunAdhocScript();
    +98          return built;
    +99      }
    +100 }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RunJob.html b/xref/org/rundeck/api/RunJob.html new file mode 100644 index 0000000..0fdca25 --- /dev/null +++ b/xref/org/rundeck/api/RunJob.html @@ -0,0 +1,48 @@ + + + + +RunJob xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.util.Properties;
    +4   
    +5   /**
    +6    * Job run request
    +7    */
    +8   public interface RunJob {
    +9       /**
    +10       * Identifier of the job - mandatory
    +11       * @return
    +12       */
    +13      String getJobId();
    +14  
    +15      /**
    +16       * Options of the job - optional. See {@link OptionsBuilder}.
    +17       * @return
    +18       */
    +19      Properties getOptions();
    +20  
    +21      /**
    +22       * Node filters for overriding the nodes on which the job will be executed - optional. See
    +23       *            {@link NodeFiltersBuilder}
    +24       *
    +25       * @return
    +26       */
    +27      Properties getNodeFilters();
    +28  
    +29      /**
    +30       * Specify a user name to run the job as, must have 'runAs' permission
    +31       * @return
    +32       */
    +33      String getAsUser();
    +34  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RunJobBuilder.html b/xref/org/rundeck/api/RunJobBuilder.html new file mode 100644 index 0000000..dec0d8a --- /dev/null +++ b/xref/org/rundeck/api/RunJobBuilder.html @@ -0,0 +1,58 @@ + + + + +RunJobBuilder xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import java.util.Properties;
    +4   
    +5   /**
    +6    * Job run request builder
    +7    */
    +8   public class RunJobBuilder {
    +9       private DefaultRunJob jobRun;
    +10  
    +11      public static RunJobBuilder builder() {
    +12          return new RunJobBuilder();
    +13      }
    +14  
    +15      public RunJobBuilder() {
    +16          jobRun = new DefaultRunJob();
    +17      }
    +18  
    +19      public RunJobBuilder setJobId(String jobId) {
    +20          jobRun.setJobId(jobId);
    +21          return this;
    +22      }
    +23  
    +24      public RunJobBuilder setOptions(Properties options) {
    +25          jobRun.setOptions(options);
    +26          return this;
    +27      }
    +28  
    +29      public RunJobBuilder setNodeFilters(Properties nodeFilters) {
    +30          jobRun.setNodeFilters(nodeFilters);
    +31          return this;
    +32      }
    +33  
    +34      public RunJobBuilder setAsUser(String asUser) {
    +35          jobRun.setAsUser(asUser);
    +36          return this;
    +37      }
    +38  
    +39      public RunJob build() {
    +40          RunJob built = jobRun;
    +41          jobRun = new DefaultRunJob();
    +42          return built;
    +43      }
    +44  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RundeckClient.html b/xref/org/rundeck/api/RundeckClient.html index 0940e04..3088278 100644 --- a/xref/org/rundeck/api/RundeckClient.html +++ b/xref/org/rundeck/api/RundeckClient.html @@ -50,643 +50,643 @@ 40 import java.util.concurrent.TimeUnit; 41 42 /** -43 * Main entry point to talk to a RunDeck instance.<br> -44 * You have 2 methods for authentication : login-based or token-based. If you want to use the first, you need to provide -45 * both a "login" and a "password". Otherwise, just provide a "token" (also called "auth-token"). See the RunDeck -46 * documentation for generating such a token.<br> -47 * <br> -48 * Usage : <br> -49 * <code> -50 * <pre> -51 * // using login-based authentication : -52 * RundeckClient rundeck = new RundeckClient("http://localhost:4440", "admin", "admin"); -53 * // or for a token-based authentication : -54 * RundeckClient rundeck = new RundeckClient("http://localhost:4440", "PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD"); -55 * -56 * List&lt;RundeckProject&gt; projects = rundeck.getProjects(); -57 * -58 * RundeckJob job = rundeck.findJob("my-project", "main-group/sub-group", "job-name"); -59 * RundeckExecution execution = rundeck.triggerJob(job.getId(), -60 * new OptionsBuilder().addOption("version", "1.2.0").toProperties()); -61 * -62 * List&lt;RundeckExecution&gt; runningExecutions = rundeck.getRunningExecutions("my-project"); -63 * -64 * rundeck.exportJobsToFile("/tmp/jobs.xml", FileType.XML, "my-project"); -65 * rundeck.importJobs("/tmp/jobs.xml", FileType.XML); -66 * </pre> -67 * </code> -68 * -69 * @author Vincent Behar -70 */ -71 public class RundeckClient implements Serializable { -72 -73 private static final long serialVersionUID = 1L; -74 -75 /** -76 * Supported version numbers -77 */ -78 public static enum Version { -79 V5(5), -80 V6(6), -81 ; -82 -83 private int versionNumber; -84 -85 Version(final int i) { -86 versionNumber = i; -87 } -88 -89 public int getVersionNumber() { -90 return versionNumber; -91 } -92 } -93 /** Version of the API supported */ -94 public static final transient int API_VERSION = Version.V6.getVersionNumber(); -95 -96 private static final String API = "/api/"; -97 -98 /** End-point of the API */ -99 public static final transient String API_ENDPOINT = API + API_VERSION; -100 -101 /** Default value for the "pooling interval" used when running jobs/commands/scripts */ -102 private static final transient long DEFAULT_POOLING_INTERVAL = 5; -103 -104 /** Default unit of the "pooling interval" used when running jobs/commands/scripts */ -105 private static final transient TimeUnit DEFAULT_POOLING_UNIT = TimeUnit.SECONDS; +43 * Main entry point to talk to a RunDeck instance. +44 * <p> +45 * <em>Deprecation Warning:</em> These methods which take multiple arguments are deprecated in +46 * favor of single argument versions, and associated Builder classes to generate them. +47 * These methods will be removed in version 10 of this library: +48 * <ul> +49 * <li> triggerAdhocScript(...), use {@link #triggerAdhocScript(RunAdhocScript)} and {@link RunAdhocScriptBuilder}</li> +50 * <li> runAdhocScript(...), use {@link #runAdhocScript(RunAdhocScript)} and {@link RunAdhocScriptBuilder}</li> +51 * <li> triggerAdhocCommand(...), use {@link #triggerAdhocCommand(RunAdhocCommand)} and {@link +52 * RunAdhocCommandBuilder}</li> +53 * <li> runAdhocCommand(...), use {@link #runAdhocCommand(RunAdhocCommand)} and {@link +54 * RunAdhocCommandBuilder}</li> +55 * <li> triggerJob(...), use {@link #triggerJob(RunJob)} and {@link +56 * RunJobBuilder}</li> +57 * <li> runJob(...), use {@link #runJob(RunJob)} and {@link +58 * RunJobBuilder}</li> +59 * <li> importJobs(...), use {@link #importJobs(RundeckJobsImport)} and {@link #importJobs(String, RundeckJobsImport)}</li> +60 * </ul> +61 * </p> +62 * <p> +63 * You have 2 methods for authentication : login-based or token-based. If you want to use the first, you need to provide +64 * both a "login" and a "password". Otherwise, just provide a "token" (also called "auth-token"). See the RunDeck +65 * documentation for generating such a token.</p> +66 * <br> +67 * Usage : <br> +68 * <code> +69 * <pre> +70 * // using login-based authentication : +71 * RundeckClient rundeck = new RundeckClient("http://localhost:4440", "admin", "admin"); +72 * // or for a token-based authentication : +73 * RundeckClient rundeck = new RundeckClient("http://localhost:4440", "PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD"); +74 * +75 * List&lt;RundeckProject&gt; projects = rundeck.getProjects(); +76 * +77 * RundeckJob job = rundeck.findJob("my-project", "main-group/sub-group", "job-name"); +78 * RundeckExecution execution = rundeck.triggerJob(job.getId(), +79 * new OptionsBuilder().addOption("version", "1.2.0").toProperties()); +80 * +81 * List&lt;RundeckExecution&gt; runningExecutions = rundeck.getRunningExecutions("my-project"); +82 * +83 * rundeck.exportJobsToFile("/tmp/jobs.xml", FileType.XML, "my-project"); +84 * rundeck.importJobs("/tmp/jobs.xml", FileType.XML); +85 * </pre> +86 * </code> +87 * +88 * @author Vincent Behar +89 */ +90 public class RundeckClient implements Serializable { +91 +92 private static final long serialVersionUID = 1L; +93 public static final String JOBS_IMPORT = "/jobs/import"; +94 +95 /** +96 * Supported version numbers +97 */ +98 public static enum Version { +99 V5(5), +100 V6(6), +101 V7(7), +102 V8(8), +103 ; +104 +105 private int versionNumber; 106 -107 /** URL of the RunDeck instance ("http://localhost:4440" target="alexandria_uri">http://localhost:4440", "http://rundeck.your-compagny.com/", etc) */ -108 private final String url; -109 -110 private int apiVersion = API_VERSION; -111 -112 private String token; -113 -114 private String login; -115 -116 private String password; -117 -118 private String sessionID; +107 Version(final int i) { +108 versionNumber = i; +109 } +110 +111 public int getVersionNumber() { +112 return versionNumber; +113 } +114 } +115 /** Version of the API supported */ +116 public static final transient int API_VERSION = Version.V8.getVersionNumber(); +117 +118 private static final String API = "/api/"; 119 -120 void setToken(String token) { -121 this.token = token; -122 } -123 -124 void setLogin(String login) { -125 this.login = login; -126 } -127 -128 void setPassword(String password) { -129 this.password = password; -130 } +120 /** End-point of the API */ +121 public static final transient String API_ENDPOINT = API + API_VERSION; +122 +123 /** Default value for the "pooling interval" used when running jobs/commands/scripts */ +124 private static final transient long DEFAULT_POOLING_INTERVAL = 5; +125 +126 /** Default unit of the "pooling interval" used when running jobs/commands/scripts */ +127 private static final transient TimeUnit DEFAULT_POOLING_UNIT = TimeUnit.SECONDS; +128 +129 /** URL of the RunDeck instance ("http://localhost:4440" target="alexandria_uri">http://localhost:4440", "http://rundeck.your-compagny.com/", etc) */ +130 private final String url; 131 -132 void setSessionID(String sessionID) { -133 this.sessionID = sessionID; -134 } +132 private int apiVersion = API_VERSION; +133 +134 private String token; 135 -136 int getApiVersion() { -137 return apiVersion; -138 } +136 private String login; +137 +138 private String password; 139 -140 void setApiVersion(int apiVersion) { -141 this.apiVersion = apiVersion; -142 } -143 -144 void setApiVersion(Version apiVersion) { -145 this.apiVersion = apiVersion.getVersionNumber(); -146 } -147 -148 String getApiEndpoint() { -149 return API + getApiVersion(); -150 } -151 -152 /** -153 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, using login-based -154 * authentication. -155 * -156 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) -157 * @param login to use for authentication on the RunDeck instance -158 * @param password to use for authentication on the RunDeck instance -159 * @throws IllegalArgumentException if the url, login or password is blank (null, empty or whitespace) -160 */ -161 public RundeckClient(String url, String login, String password) throws IllegalArgumentException { -162 this(url); -163 AssertUtil.notBlank(login, "The RunDeck login is mandatory !"); -164 AssertUtil.notBlank(password, "The RunDeck password is mandatory !"); -165 this.login = login; -166 this.password = password; -167 this.token = null; +140 private String sessionID; +141 +142 void setToken(String token) { +143 this.token = token; +144 } +145 +146 void setLogin(String login) { +147 this.login = login; +148 } +149 +150 void setPassword(String password) { +151 this.password = password; +152 } +153 +154 void setSessionID(String sessionID) { +155 this.sessionID = sessionID; +156 } +157 +158 int getApiVersion() { +159 return apiVersion; +160 } +161 +162 void setApiVersion(int apiVersion) { +163 this.apiVersion = apiVersion; +164 } +165 +166 void setApiVersion(Version apiVersion) { +167 this.apiVersion = apiVersion.getVersionNumber(); 168 } 169 -170 /** -171 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, -172 * using token-based or session-based authentication. Either token or sessionID must be valid -173 * -174 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) -175 * @param token to use for authentication on the RunDeck instance -176 * @param sessionID to use for session authentication on the RunDeck instance -177 * @param useToken should be true if using token, false if using sessionID -178 * @throws IllegalArgumentException if the url or token is blank (null, empty or whitespace) -179 * @deprecated Use the builder {@link RundeckClientBuilder} -180 */ -181 public RundeckClient(String url, String token, String sessionID, boolean useToken) throws IllegalArgumentException { -182 this(url); -183 -184 if(useToken){ -185 AssertUtil.notBlank(token, "Token is mandatory!"); -186 this.token = token; -187 this.sessionID = null; -188 } -189 else { -190 AssertUtil.notBlank(sessionID, "sessionID is mandatory!"); -191 this.sessionID = sessionID; -192 this.token = null; -193 } -194 this.login = null; -195 this.password = null; -196 } -197 -198 -199 public RundeckClient(String url, String token) throws IllegalArgumentException { -200 this(url, token, null, true); -201 } -202 -203 /** -204 * Used by RundeckClientBuilder -205 */ -206 RundeckClient(final String url) throws IllegalArgumentException { -207 AssertUtil.notBlank(url, "The RunDeck URL is mandatory !"); -208 this.url=url; -209 } -210 -211 /** -212 * Create a builder for RundeckClient -213 */ -214 public static RundeckClientBuilder builder() { -215 return new RundeckClientBuilder(); -216 } -217 -218 /** -219 * Try to "ping" the RunDeck instance to see if it is alive -220 * -221 * @throws RundeckApiException if the ping fails -222 */ -223 public void ping() throws RundeckApiException { -224 new ApiCall(this).ping(); -225 } -226 -227 /** -228 * Test the authentication on the RunDeck instance. -229 * -230 * @return sessionID if doing username+password login and it succeeded -231 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -232 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -233 */ -234 public String testAuth() throws RundeckApiLoginException, RundeckApiTokenException { -235 return (new ApiCall(this)).testAuth(); -236 } -237 -238 /** -239 * @deprecated Use {@link #testAuth()} -240 * @see #testAuth() -241 */ -242 @Deprecated -243 public void testCredentials() throws RundeckApiLoginException, RundeckApiTokenException { -244 testAuth(); -245 } -246 -247 /* -248 * Projects -249 */ -250 -251 /** -252 * List all projects -253 * -254 * @return a {@link List} of {@link RundeckProject} : might be empty, but won't be null -255 * @throws RundeckApiException in case of error when calling the API -256 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -257 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -258 */ -259 public List<RundeckProject> getProjects() throws RundeckApiException, RundeckApiLoginException, -260 RundeckApiTokenException { -261 return new ApiCall(this).get(new ApiPathBuilder("/projects"), -262 new ListParser<RundeckProject>(new ProjectParser(), "result/projects/project")); -263 } -264 -265 /** -266 * Get the definition of a single project, identified by the given name -267 * -268 * @param projectName name of the project - mandatory -269 * @return a {@link RundeckProject} instance - won't be null -270 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -271 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -272 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -273 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -274 */ -275 public RundeckProject getProject(String projectName) throws RundeckApiException, RundeckApiLoginException, -276 RundeckApiTokenException, IllegalArgumentException { -277 AssertUtil.notBlank(projectName, "projectName is mandatory to get the details of a project !"); -278 return new ApiCall(this).get(new ApiPathBuilder("/project/", projectName), -279 new ProjectParser("result/projects/project")); -280 } -281 -282 /* -283 * Jobs -284 */ -285 -286 /** -287 * List all jobs (for all projects) -288 * -289 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null -290 * @throws RundeckApiException in case of error when calling the API -291 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -292 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -293 */ -294 public List<RundeckJob> getJobs() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { -295 List<RundeckJob> jobs = new ArrayList<RundeckJob>(); -296 for (RundeckProject project : getProjects()) { -297 jobs.addAll(getJobs(project.getName())); -298 } -299 return jobs; -300 } -301 -302 /** -303 * List all jobs that belongs to the given project -304 * -305 * @param project name of the project - mandatory -306 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null -307 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -308 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -309 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -310 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -311 * @see #getJobs(String, String, String, String...) -312 */ -313 public List<RundeckJob> getJobs(String project) throws RundeckApiException, RundeckApiLoginException, -314 RundeckApiTokenException, IllegalArgumentException { -315 return getJobs(project, null, null, new String[0]); -316 } -317 -318 /** -319 * List the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds) -320 * -321 * @param project name of the project - mandatory -322 * @param jobFilter a filter for the job Name - optional -323 * @param groupPath a group or partial group path to include all jobs within that group path - optional -324 * @param jobIds a list of Job IDs to include - optional -325 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null -326 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -327 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -328 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -329 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -330 * @see #getJobs(String) -331 */ -332 public List<RundeckJob> getJobs(String project, String jobFilter, String groupPath, String... jobIds) -333 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -334 AssertUtil.notBlank(project, "project is mandatory to get all jobs !"); -335 return new ApiCall(this).get(new ApiPathBuilder("/jobs").param("project", project) -336 .param("jobFilter", jobFilter) -337 .param("groupPath", groupPath) -338 .param("idlist", StringUtils.join(jobIds, ",")), -339 new ListParser<RundeckJob>(new JobParser(), "result/jobs/job")); -340 } -341 -342 /** -343 * Export the definitions of all jobs that belongs to the given project -344 * -345 * @param filename path of the file where the content should be saved - mandatory -346 * @param format of the export. See {@link FileType} - mandatory -347 * @param project name of the project - mandatory +170 String getApiEndpoint() { +171 return API + getApiVersion(); +172 } +173 +174 /** +175 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, using login-based +176 * authentication. +177 * +178 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) +179 * @param login to use for authentication on the RunDeck instance +180 * @param password to use for authentication on the RunDeck instance +181 * @throws IllegalArgumentException if the url, login or password is blank (null, empty or whitespace) +182 */ +183 public RundeckClient(String url, String login, String password) throws IllegalArgumentException { +184 this(url); +185 AssertUtil.notBlank(login, "The RunDeck login is mandatory !"); +186 AssertUtil.notBlank(password, "The RunDeck password is mandatory !"); +187 this.login = login; +188 this.password = password; +189 this.token = null; +190 } +191 +192 /** +193 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, +194 * using token-based or session-based authentication. Either token or sessionID must be valid +195 * +196 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) +197 * @param token to use for authentication on the RunDeck instance +198 * @param sessionID to use for session authentication on the RunDeck instance +199 * @param useToken should be true if using token, false if using sessionID +200 * @throws IllegalArgumentException if the url or token is blank (null, empty or whitespace) +201 * @deprecated Use the builder {@link RundeckClientBuilder}, this method will not be public in version 10 of this library. +202 */ +203 public RundeckClient(String url, String token, String sessionID, boolean useToken) throws IllegalArgumentException { +204 this(url); +205 +206 if(useToken){ +207 AssertUtil.notBlank(token, "Token is mandatory!"); +208 this.token = token; +209 this.sessionID = null; +210 } +211 else { +212 AssertUtil.notBlank(sessionID, "sessionID is mandatory!"); +213 this.sessionID = sessionID; +214 this.token = null; +215 } +216 this.login = null; +217 this.password = null; +218 } +219 +220 +221 public RundeckClient(String url, String token) throws IllegalArgumentException { +222 this(url, token, null, true); +223 } +224 +225 /** +226 * Used by RundeckClientBuilder +227 */ +228 RundeckClient(final String url) throws IllegalArgumentException { +229 AssertUtil.notBlank(url, "The RunDeck URL is mandatory !"); +230 this.url=url; +231 } +232 +233 /** +234 * Create a builder for RundeckClient +235 */ +236 public static RundeckClientBuilder builder() { +237 return new RundeckClientBuilder(); +238 } +239 +240 /** +241 * Try to "ping" the RunDeck instance to see if it is alive +242 * +243 * @throws RundeckApiException if the ping fails +244 */ +245 public void ping() throws RundeckApiException { +246 new ApiCall(this).ping(); +247 } +248 +249 /** +250 * Test the authentication on the RunDeck instance. +251 * +252 * @return sessionID if doing username+password login and it succeeded +253 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +254 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +255 */ +256 public String testAuth() throws RundeckApiLoginException, RundeckApiTokenException { +257 return (new ApiCall(this)).testAuth(); +258 } +259 +260 /** +261 * @deprecated Use {@link #testAuth()} +262 * @see #testAuth() +263 */ +264 @Deprecated +265 public void testCredentials() throws RundeckApiLoginException, RundeckApiTokenException { +266 testAuth(); +267 } +268 +269 /* +270 * Projects +271 */ +272 +273 /** +274 * List all projects +275 * +276 * @return a {@link List} of {@link RundeckProject} : might be empty, but won't be null +277 * @throws RundeckApiException in case of error when calling the API +278 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +279 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +280 */ +281 public List<RundeckProject> getProjects() throws RundeckApiException, RundeckApiLoginException, +282 RundeckApiTokenException { +283 return new ApiCall(this).get(new ApiPathBuilder("/projects"), +284 new ListParser<RundeckProject>(new ProjectParser(), "result/projects/project")); +285 } +286 +287 /** +288 * Get the definition of a single project, identified by the given name +289 * +290 * @param projectName name of the project - mandatory +291 * @return a {@link RundeckProject} instance - won't be null +292 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +293 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +294 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +295 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +296 */ +297 public RundeckProject getProject(String projectName) throws RundeckApiException, RundeckApiLoginException, +298 RundeckApiTokenException, IllegalArgumentException { +299 AssertUtil.notBlank(projectName, "projectName is mandatory to get the details of a project !"); +300 return new ApiCall(this).get(new ApiPathBuilder("/project/", projectName), +301 new ProjectParser("result/projects/project")); +302 } +303 +304 /* +305 * Jobs +306 */ +307 +308 /** +309 * List all jobs (for all projects) +310 * +311 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null +312 * @throws RundeckApiException in case of error when calling the API +313 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +314 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +315 */ +316 public List<RundeckJob> getJobs() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { +317 List<RundeckJob> jobs = new ArrayList<RundeckJob>(); +318 for (RundeckProject project : getProjects()) { +319 jobs.addAll(getJobs(project.getName())); +320 } +321 return jobs; +322 } +323 +324 /** +325 * List all jobs that belongs to the given project +326 * +327 * @param project name of the project - mandatory +328 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null +329 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +330 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +331 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +332 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +333 * @see #getJobs(String, String, String, String...) +334 */ +335 public List<RundeckJob> getJobs(String project) throws RundeckApiException, RundeckApiLoginException, +336 RundeckApiTokenException, IllegalArgumentException { +337 return getJobs(project, null, null, new String[0]); +338 } +339 +340 /** +341 * List the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds) +342 * +343 * @param project name of the project - mandatory +344 * @param jobFilter a filter for the job Name - optional +345 * @param groupPath a group or partial group path to include all jobs within that group path - optional +346 * @param jobIds a list of Job IDs to include - optional +347 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null 348 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) 349 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 350 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -351 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is -352 * invalid -353 * @throws IOException if we failed to write to the file -354 * @see #exportJobsToFile(String, FileType, String, String, String, String...) -355 * @see #exportJobs(String, String) -356 */ -357 public void exportJobsToFile(String filename, String format, String project) throws RundeckApiException, -358 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -359 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -360 exportJobsToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), project); -361 } -362 -363 /** -364 * Export the definitions of all jobs that belongs to the given project -365 * -366 * @param filename path of the file where the content should be saved - mandatory -367 * @param format of the export. See {@link FileType} - mandatory -368 * @param project name of the project - mandatory -369 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -370 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -371 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -372 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null -373 * @throws IOException if we failed to write to the file -374 * @see #exportJobsToFile(String, FileType, String, String, String, String...) -375 * @see #exportJobs(FileType, String) -376 */ -377 public void exportJobsToFile(String filename, FileType format, String project) throws RundeckApiException, -378 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -379 exportJobsToFile(filename, format, project, null, null, new String[0]); -380 } -381 -382 /** -383 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -384 * groupPath and jobIds) -385 * -386 * @param filename path of the file where the content should be saved - mandatory -387 * @param format of the export. See {@link FileType} - mandatory -388 * @param project name of the project - mandatory -389 * @param jobFilter a filter for the job Name - optional -390 * @param groupPath a group or partial group path to include all jobs within that group path - optional -391 * @param jobIds a list of Job IDs to include - optional -392 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -393 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -394 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -395 * @throws IllegalArgumentException if the filename, format or project is blank (null, empty or whitespace), or the -396 * format is invalid -397 * @throws IOException if we failed to write to the file -398 * @see #exportJobsToFile(String, FileType, String, String, String, String...) -399 * @see #exportJobs(FileType, String, String, String, String...) -400 */ -401 public void exportJobsToFile(String filename, String format, String project, String jobFilter, String groupPath, -402 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -403 IllegalArgumentException, IOException { -404 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -405 exportJobsToFile(filename, -406 FileType.valueOf(StringUtils.upperCase(format)), -407 project, -408 jobFilter, -409 groupPath, -410 jobIds); -411 } -412 -413 /** -414 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -415 * groupPath and jobIds) -416 * -417 * @param filename path of the file where the content should be saved - mandatory -418 * @param format of the export. See {@link FileType} - mandatory -419 * @param project name of the project - mandatory -420 * @param jobFilter a filter for the job Name - optional -421 * @param groupPath a group or partial group path to include all jobs within that group path - optional -422 * @param jobIds a list of Job IDs to include - optional -423 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -424 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -425 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -426 * @throws IllegalArgumentException if the filename or project is blank (null, empty or whitespace), or the format -427 * is null -428 * @throws IOException if we failed to write to the file -429 * @see #exportJobs(FileType, String, String, String, String...) -430 */ -431 public void exportJobsToFile(String filename, FileType format, String project, String jobFilter, String groupPath, -432 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -433 IllegalArgumentException, IOException { -434 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); -435 InputStream inputStream = exportJobs(format, project, jobFilter, groupPath, jobIds); -436 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); -437 } -438 -439 /** -440 * Export the definitions of all jobs that belongs to the given project -441 * -442 * @param format of the export. See {@link FileType} - mandatory -443 * @param project name of the project - mandatory -444 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +351 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +352 * @see #getJobs(String) +353 */ +354 public List<RundeckJob> getJobs(String project, String jobFilter, String groupPath, String... jobIds) +355 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +356 AssertUtil.notBlank(project, "project is mandatory to get all jobs !"); +357 return new ApiCall(this).get(new ApiPathBuilder("/jobs").param("project", project) +358 .param("jobFilter", jobFilter) +359 .param("groupPath", groupPath) +360 .param("idlist", StringUtils.join(jobIds, ",")), +361 new ListParser<RundeckJob>(new JobParser(), "result/jobs/job")); +362 } +363 +364 /** +365 * Export the definitions of all jobs that belongs to the given project +366 * +367 * @param filename path of the file where the content should be saved - mandatory +368 * @param format of the export. See {@link FileType} - mandatory +369 * @param project name of the project - mandatory +370 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +371 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +372 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +373 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is +374 * invalid +375 * @throws IOException if we failed to write to the file +376 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +377 * @see #exportJobs(String, String) +378 */ +379 public void exportJobsToFile(String filename, String format, String project) throws RundeckApiException, +380 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +381 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +382 exportJobsToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), project); +383 } +384 +385 /** +386 * Export the definitions of all jobs that belongs to the given project +387 * +388 * @param filename path of the file where the content should be saved - mandatory +389 * @param format of the export. See {@link FileType} - mandatory +390 * @param project name of the project - mandatory +391 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +392 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +393 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +394 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null +395 * @throws IOException if we failed to write to the file +396 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +397 * @see #exportJobs(FileType, String) +398 */ +399 public void exportJobsToFile(String filename, FileType format, String project) throws RundeckApiException, +400 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +401 exportJobsToFile(filename, format, project, null, null, new String[0]); +402 } +403 +404 /** +405 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +406 * groupPath and jobIds) +407 * +408 * @param filename path of the file where the content should be saved - mandatory +409 * @param format of the export. See {@link FileType} - mandatory +410 * @param project name of the project - mandatory +411 * @param jobFilter a filter for the job Name - optional +412 * @param groupPath a group or partial group path to include all jobs within that group path - optional +413 * @param jobIds a list of Job IDs to include - optional +414 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +415 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +416 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +417 * @throws IllegalArgumentException if the filename, format or project is blank (null, empty or whitespace), or the +418 * format is invalid +419 * @throws IOException if we failed to write to the file +420 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +421 * @see #exportJobs(FileType, String, String, String, String...) +422 */ +423 public void exportJobsToFile(String filename, String format, String project, String jobFilter, String groupPath, +424 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +425 IllegalArgumentException, IOException { +426 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +427 exportJobsToFile(filename, +428 FileType.valueOf(StringUtils.upperCase(format)), +429 project, +430 jobFilter, +431 groupPath, +432 jobIds); +433 } +434 +435 /** +436 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +437 * groupPath and jobIds) +438 * +439 * @param filename path of the file where the content should be saved - mandatory +440 * @param format of the export. See {@link FileType} - mandatory +441 * @param project name of the project - mandatory +442 * @param jobFilter a filter for the job Name - optional +443 * @param groupPath a group or partial group path to include all jobs within that group path - optional +444 * @param jobIds a list of Job IDs to include - optional 445 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) 446 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 447 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -448 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is -449 * invalid -450 * @see #exportJobs(FileType, String, String, String, String...) -451 * @see #exportJobsToFile(String, String, String) +448 * @throws IllegalArgumentException if the filename or project is blank (null, empty or whitespace), or the format +449 * is null +450 * @throws IOException if we failed to write to the file +451 * @see #exportJobs(FileType, String, String, String, String...) 452 */ -453 public InputStream exportJobs(String format, String project) throws RundeckApiException, RundeckApiLoginException, -454 RundeckApiTokenException, IllegalArgumentException { -455 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -456 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project); -457 } -458 -459 /** -460 * Export the definitions of all jobs that belongs to the given project -461 * -462 * @param format of the export. See {@link FileType} - mandatory -463 * @param project name of the project - mandatory -464 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -465 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -466 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -467 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -468 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null -469 * @see #exportJobs(FileType, String, String, String, String...) -470 * @see #exportJobsToFile(String, FileType, String) -471 */ -472 public InputStream exportJobs(FileType format, String project) throws RundeckApiException, -473 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -474 return exportJobs(format, project, null, null, new String[0]); -475 } -476 -477 /** -478 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -479 * groupPath and jobIds) -480 * -481 * @param format of the export. See {@link FileType} - mandatory -482 * @param project name of the project - mandatory -483 * @param jobFilter a filter for the job Name - optional -484 * @param groupPath a group or partial group path to include all jobs within that group path - optional -485 * @param jobIds a list of Job IDs to include - optional +453 public void exportJobsToFile(String filename, FileType format, String project, String jobFilter, String groupPath, +454 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +455 IllegalArgumentException, IOException { +456 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); +457 InputStream inputStream = exportJobs(format, project, jobFilter, groupPath, jobIds); +458 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); +459 } +460 +461 /** +462 * Export the definitions of all jobs that belongs to the given project +463 * +464 * @param format of the export. See {@link FileType} - mandatory +465 * @param project name of the project - mandatory +466 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +467 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +468 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +469 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +470 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is +471 * invalid +472 * @see #exportJobs(FileType, String, String, String, String...) +473 * @see #exportJobsToFile(String, String, String) +474 */ +475 public InputStream exportJobs(String format, String project) throws RundeckApiException, RundeckApiLoginException, +476 RundeckApiTokenException, IllegalArgumentException { +477 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +478 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project); +479 } +480 +481 /** +482 * Export the definitions of all jobs that belongs to the given project +483 * +484 * @param format of the export. See {@link FileType} - mandatory +485 * @param project name of the project - mandatory 486 * @return an {@link InputStream} instance, not linked to any network resources - won't be null 487 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) 488 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 489 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -490 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is -491 * invalid -492 * @see #exportJobs(FileType, String, String, String, String...) -493 * @see #exportJobsToFile(String, String, String, String, String, String...) -494 */ -495 public InputStream exportJobs(String format, String project, String jobFilter, String groupPath, String... jobIds) -496 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -497 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -498 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project, jobFilter, groupPath, jobIds); -499 } -500 -501 /** -502 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -503 * groupPath and jobIds) -504 * -505 * @param format of the export. See {@link FileType} - mandatory -506 * @param project name of the project - mandatory -507 * @param jobFilter a filter for the job Name - optional -508 * @param groupPath a group or partial group path to include all jobs within that group path - optional -509 * @param jobIds a list of Job IDs to include - optional -510 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -511 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -512 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -513 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -514 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null -515 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +490 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null +491 * @see #exportJobs(FileType, String, String, String, String...) +492 * @see #exportJobsToFile(String, FileType, String) +493 */ +494 public InputStream exportJobs(FileType format, String project) throws RundeckApiException, +495 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +496 return exportJobs(format, project, null, null, new String[0]); +497 } +498 +499 /** +500 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +501 * groupPath and jobIds) +502 * +503 * @param format of the export. See {@link FileType} - mandatory +504 * @param project name of the project - mandatory +505 * @param jobFilter a filter for the job Name - optional +506 * @param groupPath a group or partial group path to include all jobs within that group path - optional +507 * @param jobIds a list of Job IDs to include - optional +508 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +509 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +510 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +511 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +512 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is +513 * invalid +514 * @see #exportJobs(FileType, String, String, String, String...) +515 * @see #exportJobsToFile(String, String, String, String, String, String...) 516 */ -517 public InputStream exportJobs(FileType format, String project, String jobFilter, String groupPath, String... jobIds) +517 public InputStream exportJobs(String format, String project, String jobFilter, String groupPath, String... jobIds) 518 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -519 AssertUtil.notNull(format, "format is mandatory to export jobs !"); -520 AssertUtil.notBlank(project, "project is mandatory to export jobs !"); -521 return new ApiCall(this).get(new ApiPathBuilder("/jobs/export").param("format", format) -522 .param("project", project) -523 .param("jobFilter", jobFilter) -524 .param("groupPath", groupPath) -525 .param("idlist", StringUtils.join(jobIds, ","))); -526 } -527 -528 /** -529 * Export the definition of a single job (identified by the given ID) -530 * -531 * @param filename path of the file where the content should be saved - mandatory -532 * @param format of the export. See {@link FileType} - mandatory -533 * @param jobId identifier of the job - mandatory -534 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -535 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -536 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -537 * @throws IllegalArgumentException if the filename, format or jobId is blank (null, empty or whitespace), or the -538 * format is invalid -539 * @throws IOException if we failed to write to the file -540 * @see #exportJobToFile(String, FileType, String) -541 * @see #exportJob(String, String) -542 * @see #getJob(String) -543 */ -544 public void exportJobToFile(String filename, String format, String jobId) throws RundeckApiException, -545 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -546 AssertUtil.notBlank(format, "format is mandatory to export a job !"); -547 exportJobToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), jobId); +519 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +520 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project, jobFilter, groupPath, jobIds); +521 } +522 +523 /** +524 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +525 * groupPath and jobIds) +526 * +527 * @param format of the export. See {@link FileType} - mandatory +528 * @param project name of the project - mandatory +529 * @param jobFilter a filter for the job Name - optional +530 * @param groupPath a group or partial group path to include all jobs within that group path - optional +531 * @param jobIds a list of Job IDs to include - optional +532 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +533 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +534 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +535 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +536 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null +537 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +538 */ +539 public InputStream exportJobs(FileType format, String project, String jobFilter, String groupPath, String... jobIds) +540 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +541 AssertUtil.notNull(format, "format is mandatory to export jobs !"); +542 AssertUtil.notBlank(project, "project is mandatory to export jobs !"); +543 return new ApiCall(this).get(new ApiPathBuilder("/jobs/export").param("format", format) +544 .param("project", project) +545 .param("jobFilter", jobFilter) +546 .param("groupPath", groupPath) +547 .param("idlist", StringUtils.join(jobIds, ","))); 548 } 549 550 /** 551 * Export the definition of a single job (identified by the given ID) -552 * +552 * 553 * @param filename path of the file where the content should be saved - mandatory 554 * @param format of the export. See {@link FileType} - mandatory 555 * @param jobId identifier of the job - mandatory 556 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) 557 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 558 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -559 * @throws IllegalArgumentException if the filename or jobId is blank (null, empty or whitespace), or the format is -560 * null +559 * @throws IllegalArgumentException if the filename, format or jobId is blank (null, empty or whitespace), or the +560 * format is invalid 561 * @throws IOException if we failed to write to the file -562 * @see #exportJob(FileType, String) -563 * @see #getJob(String) -564 */ -565 public void exportJobToFile(String filename, FileType format, String jobId) throws RundeckApiException, -566 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -567 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); -568 InputStream inputStream = exportJob(format, jobId); -569 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); +562 * @see #exportJobToFile(String, FileType, String) +563 * @see #exportJob(String, String) +564 * @see #getJob(String) +565 */ +566 public void exportJobToFile(String filename, String format, String jobId) throws RundeckApiException, +567 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +568 AssertUtil.notBlank(format, "format is mandatory to export a job !"); +569 exportJobToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), jobId); 570 } 571 572 /** -573 * Export the definition of a single job, identified by the given ID -574 * -575 * @param format of the export. See {@link FileType} - mandatory -576 * @param jobId identifier of the job - mandatory -577 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +573 * Export the definition of a single job (identified by the given ID) +574 * +575 * @param filename path of the file where the content should be saved - mandatory +576 * @param format of the export. See {@link FileType} - mandatory +577 * @param jobId identifier of the job - mandatory 578 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) 579 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 580 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -581 * @throws IllegalArgumentException if the format or jobId is blank (null, empty or whitespace), or the format is -582 * invalid -583 * @see #exportJobToFile(String, String, String) -584 * @see #getJob(String) -585 */ -586 public InputStream exportJob(String format, String jobId) throws RundeckApiException, RundeckApiLoginException, -587 RundeckApiTokenException, IllegalArgumentException { -588 AssertUtil.notBlank(format, "format is mandatory to export a job !"); -589 return exportJob(FileType.valueOf(StringUtils.upperCase(format)), jobId); -590 } -591 -592 /** -593 * Export the definition of a single job, identified by the given ID -594 * -595 * @param format of the export. See {@link FileType} - mandatory -596 * @param jobId identifier of the job - mandatory -597 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -598 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -599 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -600 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -601 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the format is null -602 * @see #exportJobToFile(String, FileType, String) -603 * @see #getJob(String) -604 */ -605 public InputStream exportJob(FileType format, String jobId) throws RundeckApiException, RundeckApiLoginException, -606 RundeckApiTokenException, IllegalArgumentException { -607 AssertUtil.notNull(format, "format is mandatory to export a job !"); -608 AssertUtil.notBlank(jobId, "jobId is mandatory to export a job !"); -609 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId).param("format", format)); -610 } -611 -612 /** -613 * Import the definitions of jobs, from the given file -614 * -615 * @param filename of the file containing the jobs definitions - mandatory -616 * @param fileType type of the file. See {@link FileType} - mandatory -617 * @return a {@link RundeckJobsImportResult} instance - won't be null -618 * @throws RundeckApiException in case of error when calling the API -619 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -620 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -621 * @throws IllegalArgumentException if the filename or fileType is blank (null, empty or whitespace), or the -622 * fileType is invalid -623 * @throws IOException if we failed to read the file -624 * @see #importJobs(InputStream, String) -625 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +581 * @throws IllegalArgumentException if the filename or jobId is blank (null, empty or whitespace), or the format is +582 * null +583 * @throws IOException if we failed to write to the file +584 * @see #exportJob(FileType, String) +585 * @see #getJob(String) +586 */ +587 public void exportJobToFile(String filename, FileType format, String jobId) throws RundeckApiException, +588 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +589 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); +590 InputStream inputStream = exportJob(format, jobId); +591 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); +592 } +593 +594 /** +595 * Export the definition of a single job, identified by the given ID +596 * +597 * @param format of the export. See {@link FileType} - mandatory +598 * @param jobId identifier of the job - mandatory +599 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +600 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +601 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +602 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +603 * @throws IllegalArgumentException if the format or jobId is blank (null, empty or whitespace), or the format is +604 * invalid +605 * @see #exportJobToFile(String, String, String) +606 * @see #getJob(String) +607 */ +608 public InputStream exportJob(String format, String jobId) throws RundeckApiException, RundeckApiLoginException, +609 RundeckApiTokenException, IllegalArgumentException { +610 AssertUtil.notBlank(format, "format is mandatory to export a job !"); +611 return exportJob(FileType.valueOf(StringUtils.upperCase(format)), jobId); +612 } +613 +614 /** +615 * Export the definition of a single job, identified by the given ID +616 * +617 * @param format of the export. See {@link FileType} - mandatory +618 * @param jobId identifier of the job - mandatory +619 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +620 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +621 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +622 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +623 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the format is null +624 * @see #exportJobToFile(String, FileType, String) +625 * @see #getJob(String) 626 */ -627 public RundeckJobsImportResult importJobs(String filename, String fileType) throws RundeckApiException, -628 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -629 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); -630 return importJobs(filename, FileType.valueOf(StringUtils.upperCase(fileType))); -631 } -632 -633 /** -634 * Import the definitions of jobs, from the given file -635 * -636 * @param filename of the file containing the jobs definitions - mandatory -637 * @param fileType type of the file. See {@link FileType} - mandatory -638 * @return a {@link RundeckJobsImportResult} instance - won't be null -639 * @throws RundeckApiException in case of error when calling the API -640 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -641 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -642 * @throws IllegalArgumentException if the filename is blank (null, empty or whitespace), or the fileType is null -643 * @throws IOException if we failed to read the file -644 * @see #importJobs(InputStream, FileType) -645 * @see #importJobs(String, FileType, RundeckJobsImportMethod) -646 */ -647 public RundeckJobsImportResult importJobs(String filename, FileType fileType) throws RundeckApiException, -648 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -649 return importJobs(filename, fileType, (RundeckJobsImportMethod) null); -650 } -651 -652 /** -653 * Import the definitions of jobs, from the given file, using the given behavior -654 * -655 * @param filename of the file containing the jobs definitions - mandatory -656 * @param fileType type of the file. See {@link FileType} - mandatory -657 * @param importBehavior see {@link RundeckJobsImportMethod} -658 * @return a {@link RundeckJobsImportResult} instance - won't be null -659 * @throws RundeckApiException in case of error when calling the API -660 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -661 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -662 * @throws IllegalArgumentException if the filename or fileType is blank (null, empty or whitespace), or the -663 * fileType or behavior is not valid -664 * @throws IOException if we failed to read the file -665 * @see #importJobs(InputStream, String, String) -666 * @see #importJobs(String, FileType, RundeckJobsImportMethod) -667 */ -668 public RundeckJobsImportResult importJobs(String filename, String fileType, String importBehavior) -669 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, -670 IOException { -671 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); -672 return importJobs(filename, -673 FileType.valueOf(StringUtils.upperCase(fileType)), -674 RundeckJobsImportMethod.valueOf(StringUtils.upperCase(importBehavior))); +627 public InputStream exportJob(FileType format, String jobId) throws RundeckApiException, RundeckApiLoginException, +628 RundeckApiTokenException, IllegalArgumentException { +629 AssertUtil.notNull(format, "format is mandatory to export a job !"); +630 AssertUtil.notBlank(jobId, "jobId is mandatory to export a job !"); +631 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId).param("format", format)); +632 } +633 +634 /** +635 * Import the definitions of jobs, from the given file +636 * +637 * @param filename of the file containing the jobs definitions - mandatory +638 * @param fileType type of the file. See {@link FileType} - mandatory +639 * @return a {@link RundeckJobsImportResult} instance - won't be null +640 * @throws RundeckApiException in case of error when calling the API +641 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +642 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +643 * @throws IllegalArgumentException if the filename or fileType is blank (null, empty or whitespace), or the +644 * fileType is invalid +645 * @throws IOException if we failed to read the file +646 * @see #importJobs(InputStream, String) +647 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +648 * @deprecated use {@link #importJobs(RundeckJobsImport)}, this method will be removed in version 10 of this library. +649 */ +650 public RundeckJobsImportResult importJobs(String filename, String fileType) throws RundeckApiException, +651 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +652 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); +653 return importJobs(filename, FileType.valueOf(StringUtils.upperCase(fileType))); +654 } +655 +656 /** +657 * Import the definitions of jobs, from the given file +658 * +659 * @param filename of the file containing the jobs definitions - mandatory +660 * @param fileType type of the file. See {@link FileType} - mandatory +661 * @return a {@link RundeckJobsImportResult} instance - won't be null +662 * @throws RundeckApiException in case of error when calling the API +663 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +664 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +665 * @throws IllegalArgumentException if the filename is blank (null, empty or whitespace), or the fileType is null +666 * @throws IOException if we failed to read the file +667 * @see #importJobs(InputStream, FileType) +668 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +669 * @deprecated use {@link #importJobs(RundeckJobsImport)}, this method will be removed in version 10 of this +670 * library. +671 */ +672 public RundeckJobsImportResult importJobs(String filename, FileType fileType) throws RundeckApiException, +673 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +674 return importJobs(filename, fileType, (RundeckJobsImportMethod) null); 675 } 676 677 /** 678 * Import the definitions of jobs, from the given file, using the given behavior -679 * +679 * 680 * @param filename of the file containing the jobs definitions - mandatory 681 * @param fileType type of the file. See {@link FileType} - mandatory 682 * @param importBehavior see {@link RundeckJobsImportMethod} @@ -694,1992 +694,2722 @@ 684 * @throws RundeckApiException in case of error when calling the API 685 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 686 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -687 * @throws IllegalArgumentException if the filename is blank (null, empty or whitespace), or the fileType is null -688 * @throws IOException if we failed to read the file -689 * @see #importJobs(InputStream, FileType, RundeckJobsImportMethod) -690 */ -691 public RundeckJobsImportResult importJobs(String filename, FileType fileType, RundeckJobsImportMethod importBehavior) -692 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, -693 IOException { -694 AssertUtil.notBlank(filename, "filename (of jobs file) is mandatory to import jobs !"); -695 FileInputStream stream = null; -696 try { -697 stream = FileUtils.openInputStream(new File(filename)); -698 return importJobs(stream, fileType, importBehavior); -699 } finally { -700 IOUtils.closeQuietly(stream); -701 } +687 * @throws IllegalArgumentException if the filename or fileType is blank (null, empty or whitespace), or the +688 * fileType or behavior is not valid +689 * @throws IOException if we failed to read the file +690 * @see #importJobs(InputStream, String, String) +691 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +692 * @deprecated use {@link #importJobs(RundeckJobsImport)}, this method will be removed in version 10 of this +693 * library. +694 */ +695 public RundeckJobsImportResult importJobs(String filename, String fileType, String importBehavior) +696 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, +697 IOException { +698 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); +699 return importJobs(filename, +700 FileType.valueOf(StringUtils.upperCase(fileType)), +701 RundeckJobsImportMethod.valueOf(StringUtils.upperCase(importBehavior))); 702 } 703 704 /** -705 * Import the definitions of jobs, from the given input stream -706 * -707 * @param stream inputStream for reading the definitions - mandatory +705 * Import the definitions of jobs, from the given file, using the given behavior +706 * +707 * @param filename of the file containing the jobs definitions - mandatory 708 * @param fileType type of the file. See {@link FileType} - mandatory -709 * @return a {@link RundeckJobsImportResult} instance - won't be null -710 * @throws RundeckApiException in case of error when calling the API -711 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -712 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -713 * @throws IllegalArgumentException if the stream is null, or the fileType is blank (null, empty or whitespace) or -714 * invalid -715 * @see #importJobs(String, String) +709 * @param importBehavior see {@link RundeckJobsImportMethod} +710 * @return a {@link RundeckJobsImportResult} instance - won't be null +711 * @throws RundeckApiException in case of error when calling the API +712 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +713 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +714 * @throws IllegalArgumentException if the filename is blank (null, empty or whitespace), or the fileType is null +715 * @throws IOException if we failed to read the file 716 * @see #importJobs(InputStream, FileType, RundeckJobsImportMethod) -717 */ -718 public RundeckJobsImportResult importJobs(InputStream stream, String fileType) throws RundeckApiException, -719 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -720 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); -721 return importJobs(stream, FileType.valueOf(StringUtils.upperCase(fileType))); -722 } -723 -724 /** -725 * Import the definitions of jobs, from the given input stream -726 * -727 * @param stream inputStream for reading the definitions - mandatory -728 * @param fileType type of the file. See {@link FileType} - mandatory -729 * @return a {@link RundeckJobsImportResult} instance - won't be null -730 * @throws RundeckApiException in case of error when calling the API -731 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -732 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -733 * @throws IllegalArgumentException if the stream or fileType is null -734 * @see #importJobs(String, FileType) -735 * @see #importJobs(InputStream, FileType, RundeckJobsImportMethod) -736 */ -737 public RundeckJobsImportResult importJobs(InputStream stream, FileType fileType) throws RundeckApiException, -738 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -739 return importJobs(stream, fileType, (RundeckJobsImportMethod) null); -740 } -741 -742 /** -743 * Import the definitions of jobs, from the given input stream, using the given behavior -744 * -745 * @param stream inputStream for reading the definitions - mandatory -746 * @param fileType type of the file. See {@link FileType} - mandatory -747 * @param importBehavior see {@link RundeckJobsImportMethod} -748 * @return a {@link RundeckJobsImportResult} instance - won't be null -749 * @throws RundeckApiException in case of error when calling the API -750 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -751 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -752 * @throws IllegalArgumentException if the stream is null, or the fileType is blank (null, empty or whitespace), or -753 * the fileType or behavior is not valid -754 * @see #importJobs(String, String, String) -755 * @see #importJobs(InputStream, FileType, RundeckJobsImportMethod) -756 */ -757 public RundeckJobsImportResult importJobs(InputStream stream, String fileType, String importBehavior) -758 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -759 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); -760 return importJobs(stream, -761 FileType.valueOf(StringUtils.upperCase(fileType)), -762 RundeckJobsImportMethod.valueOf(StringUtils.upperCase(importBehavior))); -763 } -764 -765 /** -766 * Import the definitions of jobs, from the given input stream, using the given behavior -767 * -768 * @param stream inputStream for reading the definitions - mandatory -769 * @param fileType type of the file. See {@link FileType} - mandatory -770 * @param importBehavior see {@link RundeckJobsImportMethod} -771 * @return a {@link RundeckJobsImportResult} instance - won't be null -772 * @throws RundeckApiException in case of error when calling the API -773 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -774 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -775 * @throws IllegalArgumentException if the stream or fileType is null -776 * @see #importJobs(String, FileType, RundeckJobsImportMethod) -777 */ -778 public RundeckJobsImportResult importJobs(InputStream stream, FileType fileType, -779 RundeckJobsImportMethod importBehavior) throws RundeckApiException, RundeckApiLoginException, -780 RundeckApiTokenException, IllegalArgumentException { -781 AssertUtil.notNull(stream, "inputStream of jobs is mandatory to import jobs !"); -782 AssertUtil.notNull(fileType, "fileType is mandatory to import jobs !"); -783 return new ApiCall(this).post(new ApiPathBuilder("/jobs/import").param("format", fileType) -784 .param("dupeOption", importBehavior) -785 .attach("xmlBatch", stream), -786 new JobsImportResultParser("result")); -787 } -788 -789 /** -790 * Find a job, identified by its project, group and name. Note that the groupPath is optional, as a job does not -791 * need to belong to a group (either pass null, or an empty string). -792 * -793 * @param project name of the project - mandatory -794 * @param groupPath group to which the job belongs (if it belongs to a group) - optional -795 * @param name of the job to find - mandatory -796 * @return a {@link RundeckJob} instance - null if not found -797 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -798 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -799 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -800 * @throws IllegalArgumentException if the project or the name is blank (null, empty or whitespace) -801 * @see #getJob(String) -802 */ -803 public RundeckJob findJob(String project, String groupPath, String name) throws RundeckApiException, -804 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -805 AssertUtil.notBlank(project, "project is mandatory to find a job !"); -806 AssertUtil.notBlank(name, "job name is mandatory to find a job !"); -807 List<RundeckJob> jobs = getJobs(project, name, groupPath, new String[0]); -808 return jobs.isEmpty() ? null : jobs.get(0); -809 } -810 -811 /** -812 * Get the definition of a single job, identified by the given ID -813 * -814 * @param jobId identifier of the job - mandatory -815 * @return a {@link RundeckJob} instance - won't be null -816 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -817 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -818 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -819 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -820 * @see #findJob(String, String, String) -821 * @see #exportJob(String, String) -822 */ -823 public RundeckJob getJob(String jobId) throws RundeckApiException, RundeckApiLoginException, -824 RundeckApiTokenException, IllegalArgumentException { -825 AssertUtil.notBlank(jobId, "jobId is mandatory to get the details of a job !"); -826 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId), new JobParser("joblist/job")); -827 } -828 -829 /** -830 * Delete a single job, identified by the given ID -831 * -832 * @param jobId identifier of the job - mandatory -833 * @return the success message (note that in case of error, you'll get an exception) -834 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -835 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -836 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -837 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -838 */ -839 public String deleteJob(String jobId) throws RundeckApiException, RundeckApiLoginException, -840 RundeckApiTokenException, IllegalArgumentException { -841 AssertUtil.notBlank(jobId, "jobId is mandatory to delete a job !"); -842 return new ApiCall(this).delete(new ApiPathBuilder("/job/", jobId), new StringParser("result/success/message")); -843 } -844 /** -845 * Delete multiple jobs, identified by the given IDs -846 * -847 * @param jobIds List of job IDS -848 * @return the bulk delete result -849 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -850 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -851 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -852 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -853 */ -854 public RundeckJobDeleteBulk deleteJobs(final List<String> jobIds) throws RundeckApiException, RundeckApiLoginException, -855 RundeckApiTokenException, IllegalArgumentException { -856 if (null == jobIds || 0 == jobIds.size()) { -857 throw new IllegalArgumentException("jobIds are mandatory to delete a job"); -858 } -859 return new ApiCall(this).post(new ApiPathBuilder("/jobs/delete").field("ids",jobIds), -860 new BulkDeleteParser("result/deleteJobs")); -861 } -862 -863 /** -864 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the -865 * end of the job execution) -866 * -867 * @param jobId identifier of the job - mandatory -868 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -869 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -870 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -871 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -872 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -873 * @see #triggerJob(String, Properties, Properties) -874 * @see #runJob(String) -875 */ -876 public RundeckExecution triggerJob(String jobId) throws RundeckApiException, RundeckApiLoginException, -877 RundeckApiTokenException, IllegalArgumentException { -878 return triggerJob(jobId, null); -879 } -880 -881 /** -882 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the -883 * end of the job execution) -884 * -885 * @param jobId identifier of the job - mandatory -886 * @param options of the job - optional. See {@link OptionsBuilder}. -887 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -888 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -889 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -890 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -891 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -892 * @see #triggerJob(String, Properties, Properties) -893 * @see #runJob(String, Properties) -894 */ -895 public RundeckExecution triggerJob(String jobId, Properties options) throws RundeckApiException, -896 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -897 return triggerJob(jobId, options, null); +717 * @deprecated use {@link #importJobs(String, RundeckJobsImport)}, this method will be removed in version 10 of +718 * this library. +719 */ +720 public RundeckJobsImportResult importJobs(String filename, FileType fileType, RundeckJobsImportMethod importBehavior) +721 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, +722 IOException { +723 AssertUtil.notBlank(filename, "filename (of jobs file) is mandatory to import jobs !"); +724 FileInputStream stream = null; +725 try { +726 stream = FileUtils.openInputStream(new File(filename)); +727 return importJobs(stream, fileType, importBehavior); +728 } finally { +729 IOUtils.closeQuietly(stream); +730 } +731 } +732 +733 /** +734 * Import the definitions of jobs, from the given input stream +735 * +736 * @param stream inputStream for reading the definitions - mandatory +737 * @param fileType type of the file. See {@link FileType} - mandatory +738 * @return a {@link RundeckJobsImportResult} instance - won't be null +739 * @throws RundeckApiException in case of error when calling the API +740 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +741 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +742 * @throws IllegalArgumentException if the stream is null, or the fileType is blank (null, empty or whitespace) or +743 * invalid +744 * @see #importJobs(String, String) +745 * @see #importJobs(InputStream, FileType, RundeckJobsImportMethod) +746 * @deprecated use {@link #importJobs(RundeckJobsImport)}, this method will be removed in version 10 of this +747 * library. +748 */ +749 public RundeckJobsImportResult importJobs(InputStream stream, String fileType) throws RundeckApiException, +750 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +751 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); +752 return importJobs(stream, FileType.valueOf(StringUtils.upperCase(fileType))); +753 } +754 +755 /** +756 * Import the definitions of jobs, from the given input stream +757 * +758 * @param stream inputStream for reading the definitions - mandatory +759 * @param fileType type of the file. See {@link FileType} - mandatory +760 * @return a {@link RundeckJobsImportResult} instance - won't be null +761 * @throws RundeckApiException in case of error when calling the API +762 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +763 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +764 * @throws IllegalArgumentException if the stream or fileType is null +765 * @see #importJobs(String, FileType) +766 * @see #importJobs(InputStream, FileType, RundeckJobsImportMethod) +767 * @deprecated use {@link #importJobs(RundeckJobsImport)}, this method will be removed in version 10 of this +768 * library. +769 */ +770 public RundeckJobsImportResult importJobs(InputStream stream, FileType fileType) throws RundeckApiException, +771 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +772 return importJobs(stream, fileType, (RundeckJobsImportMethod) null); +773 } +774 +775 /** +776 * Import the definitions of jobs, from the given input stream, using the given behavior +777 * +778 * @param stream inputStream for reading the definitions - mandatory +779 * @param fileType type of the file. See {@link FileType} - mandatory +780 * @param importBehavior see {@link RundeckJobsImportMethod} +781 * @return a {@link RundeckJobsImportResult} instance - won't be null +782 * @throws RundeckApiException in case of error when calling the API +783 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +784 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +785 * @throws IllegalArgumentException if the stream is null, or the fileType is blank (null, empty or whitespace), or +786 * the fileType or behavior is not valid +787 * @see #importJobs(String, String, String) +788 * @see #importJobs(InputStream, FileType, RundeckJobsImportMethod) +789 * @deprecated use {@link #importJobs(RundeckJobsImport)}, this method will be removed in version 10 of this +790 * library. +791 */ +792 public RundeckJobsImportResult importJobs(InputStream stream, String fileType, String importBehavior) +793 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +794 AssertUtil.notBlank(fileType, "fileType is mandatory to import jobs !"); +795 return importJobs(stream, +796 FileType.valueOf(StringUtils.upperCase(fileType)), +797 RundeckJobsImportMethod.valueOf(StringUtils.upperCase(importBehavior))); +798 } +799 +800 /** +801 * Import the definitions of jobs, from the given input stream, using the given behavior +802 * +803 * @param stream inputStream for reading the definitions - mandatory +804 * @param fileType type of the file. See {@link FileType} - mandatory +805 * @param importBehavior see {@link RundeckJobsImportMethod} +806 * @return a {@link RundeckJobsImportResult} instance - won't be null +807 * @throws RundeckApiException in case of error when calling the API +808 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +809 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +810 * @throws IllegalArgumentException if the stream or fileType is null +811 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +812 * @deprecated use {@link #importJobs(RundeckJobsImport)}, this method will be removed in version 10 of this +813 * library. +814 */ +815 public RundeckJobsImportResult importJobs(InputStream stream, FileType fileType, +816 RundeckJobsImportMethod importBehavior) throws RundeckApiException, RundeckApiLoginException, +817 RundeckApiTokenException, IllegalArgumentException { +818 return importJobs(RundeckJobsImportBuilder.builder().setStream(stream).setFileType(fileType) +819 .setJobsImportMethod(importBehavior).build()); +820 } +821 +822 /** +823 * Import the definitions of jobs, from the given input stream, using the given behavior +824 * +825 * @param rundeckJobsImport import request, see {@link RundeckJobsImportBuilder} +826 * +827 * @return a {@link RundeckJobsImportResult} instance - won't be null +828 * +829 * @throws RundeckApiException in case of error when calling the API +830 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +831 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +832 * @throws IllegalArgumentException if the stream or fileType is null +833 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +834 */ +835 public RundeckJobsImportResult importJobs(final String filename,final RundeckJobsImport rundeckJobsImport) throws RundeckApiException, +836 RundeckApiLoginException, +837 RundeckApiTokenException, IllegalArgumentException, IOException { +838 AssertUtil.notBlank(filename, "filename (of jobs file) is mandatory to import jobs !"); +839 FileInputStream stream = null; +840 try { +841 stream = FileUtils.openInputStream(new File(filename)); +842 return importJobs(RundeckJobsImportBuilder.builder(rundeckJobsImport).setStream(stream).build()); +843 } finally { +844 +845 IOUtils.closeQuietly(stream); +846 } +847 } +848 /** +849 * Import the definitions of jobs, from the given input stream, using the given behavior +850 * +851 * @param rundeckJobsImport import request, see {@link RundeckJobsImportBuilder} +852 * +853 * @return a {@link RundeckJobsImportResult} instance - won't be null +854 * +855 * @throws RundeckApiException in case of error when calling the API +856 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +857 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +858 * @throws IllegalArgumentException if the stream or fileType is null +859 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +860 */ +861 public RundeckJobsImportResult importJobs(final RundeckJobsImport rundeckJobsImport) throws RundeckApiException, +862 RundeckApiLoginException, +863 RundeckApiTokenException, IllegalArgumentException { +864 +865 AssertUtil.notNull(rundeckJobsImport.getStream(), "inputStream of jobs is mandatory to import jobs !"); +866 AssertUtil.notNull(rundeckJobsImport.getFileType(), "fileType is mandatory to import jobs !"); +867 final ApiPathBuilder request = new ApiPathBuilder(JOBS_IMPORT) +868 .param("format", rundeckJobsImport.getFileType()) +869 .param("dupeOption", rundeckJobsImport.getImportMethod()) +870 .attach("xmlBatch", rundeckJobsImport.getStream()); +871 if(null!=rundeckJobsImport.getProject()) { +872 //API v8 +873 request.param("project", rundeckJobsImport.getProject()); +874 } +875 return new ApiCall(this).post(request, new JobsImportResultParser("result")); +876 } +877 +878 /** +879 * Find a job, identified by its project, group and name. Note that the groupPath is optional, as a job does not +880 * need to belong to a group (either pass null, or an empty string). +881 * +882 * @param project name of the project - mandatory +883 * @param groupPath group to which the job belongs (if it belongs to a group) - optional +884 * @param name of the job to find - mandatory +885 * @return a {@link RundeckJob} instance - null if not found +886 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +887 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +888 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +889 * @throws IllegalArgumentException if the project or the name is blank (null, empty or whitespace) +890 * @see #getJob(String) +891 */ +892 public RundeckJob findJob(String project, String groupPath, String name) throws RundeckApiException, +893 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +894 AssertUtil.notBlank(project, "project is mandatory to find a job !"); +895 AssertUtil.notBlank(name, "job name is mandatory to find a job !"); +896 List<RundeckJob> jobs = getJobs(project, name, groupPath, new String[0]); +897 return jobs.isEmpty() ? null : jobs.get(0); 898 } 899 900 /** -901 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the -902 * end of the job execution) -903 * -904 * @param jobId identifier of the job - mandatory -905 * @param options of the job - optional. See {@link OptionsBuilder}. -906 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See -907 * {@link NodeFiltersBuilder} -908 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -909 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -910 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -911 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -912 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -913 * @see #triggerJob(String) -914 * @see #runJob(String, Properties, Properties) -915 */ -916 public RundeckExecution triggerJob(String jobId, Properties options, Properties nodeFilters) -917 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -918 AssertUtil.notBlank(jobId, "jobId is mandatory to trigger a job !"); -919 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId, "/run").param("argString", -920 ParametersUtil.generateArgString(options)) -921 .nodeFilters(nodeFilters), -922 new ExecutionParser("result/executions/execution")); -923 } -924 -925 /** -926 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. -927 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or -928 * aborted) or is still running. -929 * -930 * @param jobId identifier of the job - mandatory -931 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -932 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -933 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -934 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -935 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -936 * @see #triggerJob(String) -937 * @see #runJob(String, Properties, Properties, long, TimeUnit) -938 */ -939 public RundeckExecution runJob(String jobId) throws RundeckApiException, RundeckApiLoginException, -940 RundeckApiTokenException, IllegalArgumentException { -941 return runJob(jobId, null); -942 } -943 -944 /** -945 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. -946 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or -947 * aborted) or is still running. -948 * -949 * @param jobId identifier of the job - mandatory -950 * @param options of the job - optional. See {@link OptionsBuilder}. -951 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -952 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -953 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -954 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -955 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -956 * @see #triggerJob(String, Properties) -957 * @see #runJob(String, Properties, Properties, long, TimeUnit) -958 */ -959 public RundeckExecution runJob(String jobId, Properties options) throws RundeckApiException, -960 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -961 return runJob(jobId, options, null); -962 } -963 -964 /** -965 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. -966 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or -967 * aborted) or is still running. -968 * -969 * @param jobId identifier of the job - mandatory -970 * @param options of the job - optional. See {@link OptionsBuilder}. -971 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See -972 * {@link NodeFiltersBuilder} -973 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -974 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -975 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -976 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -977 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -978 * @see #triggerJob(String, Properties, Properties) -979 * @see #runJob(String, Properties, Properties, long, TimeUnit) -980 */ -981 public RundeckExecution runJob(String jobId, Properties options, Properties nodeFilters) -982 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -983 return runJob(jobId, options, nodeFilters, DEFAULT_POOLING_INTERVAL, DEFAULT_POOLING_UNIT); -984 } -985 -986 /** -987 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. -988 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to -989 * know if the execution is finished (or aborted) or is still running. -990 * -991 * @param jobId identifier of the job - mandatory -992 * @param options of the job - optional. See {@link OptionsBuilder}. -993 * @param poolingInterval for checking the status of the execution. Must be > 0. -994 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -995 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -996 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -997 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -998 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -999 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1000 * @see #triggerJob(String, Properties) -1001 * @see #runJob(String, Properties, Properties, long, TimeUnit) -1002 */ -1003 public RundeckExecution runJob(String jobId, Properties options, long poolingInterval, TimeUnit poolingUnit) -1004 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1005 return runJob(jobId, options, null, poolingInterval, poolingUnit); -1006 } -1007 -1008 /** -1009 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. -1010 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to -1011 * know if the execution is finished (or aborted) or is still running. -1012 * -1013 * @param jobId identifier of the job - mandatory -1014 * @param options of the job - optional. See {@link OptionsBuilder}. -1015 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See -1016 * {@link NodeFiltersBuilder} -1017 * @param poolingInterval for checking the status of the execution. Must be > 0. -1018 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1019 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1020 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1021 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1022 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1023 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1024 * @see #triggerJob(String, Properties) -1025 * @see #runJob(String, Properties, Properties, long, TimeUnit) -1026 */ -1027 public RundeckExecution runJob(String jobId, Properties options, Properties nodeFilters, long poolingInterval, -1028 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1029 IllegalArgumentException { -1030 if (poolingInterval <= 0) { -1031 poolingInterval = DEFAULT_POOLING_INTERVAL; -1032 poolingUnit = DEFAULT_POOLING_UNIT; -1033 } -1034 if (poolingUnit == null) { -1035 poolingUnit = DEFAULT_POOLING_UNIT; -1036 } -1037 -1038 RundeckExecution execution = triggerJob(jobId, options, nodeFilters); -1039 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { -1040 try { -1041 Thread.sleep(poolingUnit.toMillis(poolingInterval)); -1042 } catch (InterruptedException e) { -1043 break; -1044 } -1045 execution = getExecution(execution.getId()); -1046 } -1047 return execution; -1048 } -1049 -1050 /* -1051 * Ad-hoc commands -1052 */ -1053 -1054 /** -1055 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). -1056 * The command will not be dispatched to nodes, but be executed on the RunDeck server. -1057 * -1058 * @param project name of the project - mandatory -1059 * @param command to be executed - mandatory -1060 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1061 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1062 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1063 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1064 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1065 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) -1066 * @see #runAdhocCommand(String, String) -1067 */ -1068 public RundeckExecution triggerAdhocCommand(String project, String command) throws RundeckApiException, -1069 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1070 return triggerAdhocCommand(project, command, null); -1071 } -1072 -1073 /** -1074 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). -1075 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. -1076 * -1077 * @param project name of the project - mandatory -1078 * @param command to be executed - mandatory -1079 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1080 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1081 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1082 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1083 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1084 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1085 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) -1086 * @see #runAdhocCommand(String, String, Properties) -1087 */ -1088 public RundeckExecution triggerAdhocCommand(String project, String command, Properties nodeFilters) -1089 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1090 return triggerAdhocCommand(project, command, nodeFilters, null, null); -1091 } -1092 -1093 /** -1094 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). -1095 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. -1096 * -1097 * @param project name of the project - mandatory -1098 * @param command to be executed - mandatory -1099 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1100 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1101 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1102 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1103 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1104 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1105 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1106 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1107 * @see #triggerAdhocCommand(String, String) -1108 * @see #runAdhocCommand(String, String, Properties) -1109 */ -1110 public RundeckExecution triggerAdhocCommand(String project, String command, Properties nodeFilters, -1111 Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, RundeckApiLoginException, -1112 RundeckApiTokenException, IllegalArgumentException { -1113 AssertUtil.notBlank(project, "project is mandatory to trigger an ad-hoc command !"); -1114 AssertUtil.notBlank(command, "command is mandatory to trigger an ad-hoc command !"); -1115 RundeckExecution execution = new ApiCall(this).get(new ApiPathBuilder("/run/command").param("project", project) -1116 .param("exec", command) -1117 .param("nodeThreadcount", -1118 nodeThreadcount) -1119 .param("nodeKeepgoing", -1120 nodeKeepgoing) -1121 .nodeFilters(nodeFilters), -1122 new ExecutionParser("result/execution")); -1123 // the first call just returns the ID of the execution, so we need another call to get a "real" execution -1124 return getExecution(execution.getId()); -1125 } -1126 -1127 /** -1128 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1129 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1130 * running. The command will not be dispatched to nodes, but be executed on the RunDeck server. -1131 * -1132 * @param project name of the project - mandatory -1133 * @param command to be executed - mandatory -1134 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1135 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1136 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1137 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1138 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1139 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) -1140 * @see #triggerAdhocCommand(String, String) -1141 */ -1142 public RundeckExecution runAdhocCommand(String project, String command) throws RundeckApiException, -1143 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1144 return runAdhocCommand(project, command, null); -1145 } -1146 -1147 /** -1148 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1149 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1150 * finished (or aborted) or is still running. The command will not be dispatched to nodes, but be executed on the -1151 * RunDeck server. -1152 * -1153 * @param project name of the project - mandatory -1154 * @param command to be executed - mandatory -1155 * @param poolingInterval for checking the status of the execution. Must be > 0. -1156 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1157 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1158 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1159 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1160 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1161 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1162 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) -1163 * @see #triggerAdhocCommand(String, String) -1164 */ -1165 public RundeckExecution runAdhocCommand(String project, String command, long poolingInterval, TimeUnit poolingUnit) -1166 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1167 return runAdhocCommand(project, command, null, poolingInterval, poolingUnit); -1168 } -1169 -1170 /** -1171 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1172 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1173 * running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter. -1174 * -1175 * @param project name of the project - mandatory -1176 * @param command to be executed - mandatory -1177 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1178 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1179 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1180 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1181 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1182 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1183 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) -1184 * @see #triggerAdhocCommand(String, String, Properties) -1185 */ -1186 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters) -1187 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1188 return runAdhocCommand(project, command, nodeFilters, null, null); -1189 } -1190 -1191 /** -1192 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1193 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1194 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the -1195 * nodeFilters parameter. -1196 * -1197 * @param project name of the project - mandatory -1198 * @param command to be executed - mandatory -1199 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1200 * @param poolingInterval for checking the status of the execution. Must be > 0. -1201 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1202 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1203 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1204 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1205 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1206 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1207 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) -1208 * @see #triggerAdhocCommand(String, String, Properties) -1209 */ -1210 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, -1211 long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, -1212 RundeckApiTokenException, IllegalArgumentException { -1213 return runAdhocCommand(project, command, nodeFilters, null, null, poolingInterval, poolingUnit); -1214 } -1215 -1216 /** -1217 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1218 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1219 * running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter. -1220 * -1221 * @param project name of the project - mandatory -1222 * @param command to be executed - mandatory -1223 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1224 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1225 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1226 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1227 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1228 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1229 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1230 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1231 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) -1232 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) -1233 */ -1234 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, -1235 Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, RundeckApiLoginException, -1236 RundeckApiTokenException, IllegalArgumentException { -1237 return runAdhocCommand(project, -1238 command, -1239 nodeFilters, -1240 nodeThreadcount, -1241 nodeKeepgoing, -1242 DEFAULT_POOLING_INTERVAL, -1243 DEFAULT_POOLING_UNIT); -1244 } -1245 -1246 /** -1247 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1248 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1249 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the -1250 * nodeFilters parameter. -1251 * -1252 * @param project name of the project - mandatory -1253 * @param command to be executed - mandatory -1254 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1255 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1256 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1257 * @param poolingInterval for checking the status of the execution. Must be > 0. -1258 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1259 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1260 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1261 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1262 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1263 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1264 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) -1265 */ -1266 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, -1267 Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit) -1268 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1269 if (poolingInterval <= 0) { -1270 poolingInterval = DEFAULT_POOLING_INTERVAL; -1271 poolingUnit = DEFAULT_POOLING_UNIT; -1272 } -1273 if (poolingUnit == null) { -1274 poolingUnit = DEFAULT_POOLING_UNIT; -1275 } -1276 -1277 RundeckExecution execution = triggerAdhocCommand(project, command, nodeFilters, nodeThreadcount, nodeKeepgoing); -1278 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { -1279 try { -1280 Thread.sleep(poolingUnit.toMillis(poolingInterval)); -1281 } catch (InterruptedException e) { -1282 break; -1283 } -1284 execution = getExecution(execution.getId()); -1285 } -1286 return execution; -1287 } -1288 -1289 /* -1290 * Ad-hoc scripts -1291 */ -1292 -1293 /** -1294 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1295 * script will not be dispatched to nodes, but be executed on the RunDeck server. -1296 * -1297 * @param project name of the project - mandatory -1298 * @param scriptFilename filename of the script to be executed - mandatory -1299 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1300 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1301 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1302 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1303 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1304 * @throws IOException if we failed to read the file -1305 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) -1306 * @see #runAdhocScript(String, String) -1307 */ -1308 public RundeckExecution triggerAdhocScript(String project, String scriptFilename) throws RundeckApiException, -1309 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1310 return triggerAdhocScript(project, scriptFilename, null); -1311 } -1312 -1313 /** -1314 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1315 * script will not be dispatched to nodes, but be executed on the RunDeck server. -1316 * -1317 * @param project name of the project - mandatory -1318 * @param scriptFilename filename of the script to be executed - mandatory -1319 * @param options of the script - optional. See {@link OptionsBuilder}. -1320 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1321 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1322 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1323 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1324 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1325 * @throws IOException if we failed to read the file -1326 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) -1327 * @see #runAdhocScript(String, String, Properties) -1328 */ -1329 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options) -1330 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, -1331 IOException { -1332 return triggerAdhocScript(project, scriptFilename, options, null); -1333 } -1334 -1335 /** -1336 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1337 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1338 * -1339 * @param project name of the project - mandatory -1340 * @param scriptFilename filename of the script to be executed - mandatory -1341 * @param options of the script - optional. See {@link OptionsBuilder}. -1342 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1343 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1344 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1345 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1346 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1347 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1348 * @throws IOException if we failed to read the file -1349 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) -1350 * @see #runAdhocScript(String, String, Properties, Properties) -1351 */ -1352 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options, -1353 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1354 IllegalArgumentException, IOException { -1355 return triggerAdhocScript(project, scriptFilename, options, nodeFilters, null, null); -1356 } -1357 -1358 /** -1359 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1360 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1361 * -1362 * @param project name of the project - mandatory -1363 * @param scriptFilename filename of the script to be executed - mandatory -1364 * @param options of the script - optional. See {@link OptionsBuilder}. -1365 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1366 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1367 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1368 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1369 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1370 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1371 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1372 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1373 * @throws IOException if we failed to read the file -1374 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) -1375 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1376 */ -1377 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options, -1378 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, -1379 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1380 AssertUtil.notBlank(scriptFilename, "scriptFilename is mandatory to trigger an ad-hoc script !"); -1381 FileInputStream stream = null; -1382 try { -1383 stream = FileUtils.openInputStream(new File(scriptFilename)); -1384 return triggerAdhocScript(project, stream, options, nodeFilters, nodeThreadcount, nodeKeepgoing); -1385 } finally { -1386 IOUtils.closeQuietly(stream); -1387 } -1388 } -1389 -1390 /** -1391 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1392 * script will not be dispatched to nodes, but be executed on the RunDeck server. -1393 * -1394 * @param project name of the project - mandatory -1395 * @param script inputStream for reading the script to be executed - mandatory -1396 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1397 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1398 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1399 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1400 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1401 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) -1402 * @see #runAdhocScript(String, InputStream) -1403 */ -1404 public RundeckExecution triggerAdhocScript(String project, InputStream script) throws RundeckApiException, -1405 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1406 return triggerAdhocScript(project, script, null); -1407 } -1408 -1409 /** -1410 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1411 * script will not be dispatched to nodes, but be executed on the RunDeck server. -1412 * -1413 * @param project name of the project - mandatory -1414 * @param script inputStream for reading the script to be executed - mandatory -1415 * @param options of the script - optional. See {@link OptionsBuilder}. -1416 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1417 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1418 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1419 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1420 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1421 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) -1422 * @see #runAdhocScript(String, InputStream, Properties) -1423 */ -1424 public RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options) -1425 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1426 return triggerAdhocScript(project, script, options, null); -1427 } -1428 -1429 /** -1430 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1431 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1432 * +901 * Get the definition of a single job, identified by the given ID +902 * +903 * @param jobId identifier of the job - mandatory +904 * @return a {@link RundeckJob} instance - won't be null +905 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +906 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +907 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +908 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +909 * @see #findJob(String, String, String) +910 * @see #exportJob(String, String) +911 */ +912 public RundeckJob getJob(String jobId) throws RundeckApiException, RundeckApiLoginException, +913 RundeckApiTokenException, IllegalArgumentException { +914 AssertUtil.notBlank(jobId, "jobId is mandatory to get the details of a job !"); +915 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId), new JobParser("joblist/job")); +916 } +917 +918 /** +919 * Delete a single job, identified by the given ID +920 * +921 * @param jobId identifier of the job - mandatory +922 * @return the success message (note that in case of error, you'll get an exception) +923 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +924 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +925 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +926 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +927 */ +928 public String deleteJob(String jobId) throws RundeckApiException, RundeckApiLoginException, +929 RundeckApiTokenException, IllegalArgumentException { +930 AssertUtil.notBlank(jobId, "jobId is mandatory to delete a job !"); +931 return new ApiCall(this).delete(new ApiPathBuilder("/job/", jobId), new StringParser("result/success/message")); +932 } +933 /** +934 * Delete multiple jobs, identified by the given IDs +935 * +936 * @param jobIds List of job IDS +937 * @return the bulk delete result +938 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +939 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +940 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +941 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +942 */ +943 public RundeckJobDeleteBulk deleteJobs(final List<String> jobIds) throws RundeckApiException, RundeckApiLoginException, +944 RundeckApiTokenException, IllegalArgumentException { +945 if (null == jobIds || 0 == jobIds.size()) { +946 throw new IllegalArgumentException("jobIds are mandatory to delete a job"); +947 } +948 return new ApiCall(this).post(new ApiPathBuilder("/jobs/delete").field("ids",jobIds), +949 new BulkDeleteParser("result/deleteJobs")); +950 } +951 +952 /** +953 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the +954 * end of the job execution) +955 * +956 * @param jobId identifier of the job - mandatory +957 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +958 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +959 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +960 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +961 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +962 * @see #triggerJob(String, Properties, Properties) +963 * @see #runJob(String) +964 * @deprecated use {@link #triggerJob(RunJob)}, this method will be removed in version 10 of this library +965 */ +966 public RundeckExecution triggerJob(String jobId) throws RundeckApiException, RundeckApiLoginException, +967 RundeckApiTokenException, IllegalArgumentException { +968 return triggerJob(jobId, null); +969 } +970 +971 /** +972 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the +973 * end of the job execution) +974 * +975 * @param jobId identifier of the job - mandatory +976 * @param options of the job - optional. See {@link OptionsBuilder}. +977 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +978 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +979 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +980 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +981 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +982 * @see #triggerJob(String, Properties, Properties) +983 * @see #runJob(String, Properties) +984 * @deprecated use {@link #triggerJob(RunJob)}, this method will be removed in version 10 of this library +985 */ +986 public RundeckExecution triggerJob(String jobId, Properties options) throws RundeckApiException, +987 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +988 return triggerJob(jobId, options, null); +989 } +990 +991 /** +992 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the +993 * end of the job execution) +994 * +995 * @param jobId identifier of the job - mandatory +996 * @param options of the job - optional. See {@link OptionsBuilder}. +997 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See +998 * {@link NodeFiltersBuilder} +999 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1000 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1001 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1002 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1003 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1004 * @see #triggerJob(String) +1005 * @see #runJob(String, Properties, Properties) +1006 * @deprecated use {@link #triggerJob(RunJob)}, this method will be removed in version 10 of this library +1007 */ +1008 public RundeckExecution triggerJob(String jobId, Properties options, Properties nodeFilters) +1009 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1010 return triggerJob(jobId, options, nodeFilters, null); +1011 } +1012 /** +1013 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the +1014 * end of the job execution) +1015 * +1016 * @param jobId identifier of the job - mandatory +1017 * @param options of the job - optional. See {@link OptionsBuilder}. +1018 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See +1019 * {@link NodeFiltersBuilder} +1020 * @param asUser specify a user name to run the job as, must have 'runAs' permission +1021 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1022 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1023 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1024 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1025 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1026 * @see #triggerJob(String) +1027 * @see #runJob(String, Properties, Properties) +1028 * @deprecated use {@link #triggerJob(RunJob)}, this method will be removed in version 10 of this library +1029 */ +1030 public RundeckExecution triggerJob(String jobId, Properties options, Properties nodeFilters, String asUser) +1031 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1032 return triggerJob(RunJobBuilder.builder() +1033 .setJobId(jobId) +1034 .setOptions(options) +1035 .setNodeFilters(nodeFilters) +1036 .setAsUser(asUser) +1037 .build()); +1038 } +1039 /** +1040 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the +1041 * end of the job execution) +1042 * +1043 * @param jobRun the RunJob, see {@link RunJobBuilder} +1044 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1045 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1046 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1047 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1048 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1049 * @see #triggerJob(String) +1050 * @see #runJob(String, Properties, Properties) +1051 */ +1052 public RundeckExecution triggerJob(final RunJob jobRun) +1053 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1054 AssertUtil.notBlank(jobRun.getJobId(), "jobId is mandatory to trigger a job !"); +1055 ApiPathBuilder apiPath = new ApiPathBuilder("/job/", jobRun.getJobId(), "/run").param("argString", +1056 ParametersUtil.generateArgString(jobRun.getOptions())) +1057 .nodeFilters(jobRun.getNodeFilters()); +1058 if(null!=jobRun.getAsUser()) { +1059 apiPath.param("asUser", jobRun.getAsUser()); +1060 } +1061 return new ApiCall(this).get(apiPath, new ExecutionParser("result/executions/execution")); +1062 } +1063 +1064 /** +1065 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1066 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or +1067 * aborted) or is still running. +1068 * +1069 * @param jobId identifier of the job - mandatory +1070 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1071 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1072 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1073 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1074 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1075 * @see #triggerJob(String) +1076 * @see #runJob(String, Properties, Properties, long, TimeUnit) +1077 * @deprecated use {@link #runJob(RunJob, long, java.util.concurrent.TimeUnit)}, +1078 * this method will be removed in version 10 of this library +1079 */ +1080 public RundeckExecution runJob(String jobId) throws RundeckApiException, RundeckApiLoginException, +1081 RundeckApiTokenException, IllegalArgumentException { +1082 return runJob(jobId, null); +1083 } +1084 +1085 /** +1086 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1087 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or +1088 * aborted) or is still running. +1089 * +1090 * @param jobId identifier of the job - mandatory +1091 * @param options of the job - optional. See {@link OptionsBuilder}. +1092 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1093 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1094 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1095 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1096 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1097 * @see #triggerJob(String, Properties) +1098 * @see #runJob(String, Properties, Properties, long, TimeUnit) +1099 * @deprecated use {@link #runJob(RunJob, long, java.util.concurrent.TimeUnit)}, +1100 * this method will be removed in version 10 of this library +1101 */ +1102 public RundeckExecution runJob(String jobId, Properties options) throws RundeckApiException, +1103 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1104 return runJob(jobId, options, null); +1105 } +1106 +1107 /** +1108 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1109 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or +1110 * aborted) or is still running. +1111 * +1112 * @param jobId identifier of the job - mandatory +1113 * @param options of the job - optional. See {@link OptionsBuilder}. +1114 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See +1115 * {@link NodeFiltersBuilder} +1116 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1117 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1118 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1119 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1120 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1121 * @see #triggerJob(String, Properties, Properties) +1122 * @see #runJob(String, Properties, Properties, long, TimeUnit) +1123 * @deprecated use {@link #runJob(RunJob, long, java.util.concurrent.TimeUnit)}, +1124 * this method will be removed in version 10 of this library +1125 */ +1126 public RundeckExecution runJob(String jobId, Properties options, Properties nodeFilters) +1127 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1128 return runJob(jobId, options, nodeFilters, DEFAULT_POOLING_INTERVAL, DEFAULT_POOLING_UNIT); +1129 } +1130 +1131 /** +1132 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1133 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or +1134 * aborted) or is still running. +1135 * +1136 * @param runJob the RunJob, see {@link RunJobBuilder} +1137 * +1138 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1139 * +1140 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1141 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1142 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1143 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1144 * @see #triggerJob(RunJob) +1145 * @see #runJob(RunJob, long, TimeUnit) +1146 */ +1147 public RundeckExecution runJob(final RunJob runJob) throws RundeckApiException, RundeckApiLoginException, +1148 RundeckApiTokenException, IllegalArgumentException { +1149 return runJob(runJob, DEFAULT_POOLING_INTERVAL, DEFAULT_POOLING_UNIT); +1150 } +1151 /** +1152 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1153 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to +1154 * know if the execution is finished (or aborted) or is still running. +1155 * +1156 * @param jobId identifier of the job - mandatory +1157 * @param options of the job - optional. See {@link OptionsBuilder}. +1158 * @param poolingInterval for checking the status of the execution. Must be > 0. +1159 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1160 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1161 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1162 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1163 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1164 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1165 * @see #triggerJob(String, Properties) +1166 * @see #runJob(String, Properties, Properties, long, TimeUnit) +1167 * @deprecated use {@link #runJob(RunJob, long, java.util.concurrent.TimeUnit)}, +1168 * this method will be removed in version 10 of this library +1169 */ +1170 public RundeckExecution runJob(String jobId, Properties options, long poolingInterval, TimeUnit poolingUnit) +1171 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1172 return runJob(jobId, options, null, poolingInterval, poolingUnit); +1173 } +1174 +1175 /** +1176 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1177 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to +1178 * know if the execution is finished (or aborted) or is still running. +1179 * +1180 * @param jobId identifier of the job - mandatory +1181 * @param options of the job - optional. See {@link OptionsBuilder}. +1182 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See +1183 * {@link NodeFiltersBuilder} +1184 * @param poolingInterval for checking the status of the execution. Must be > 0. +1185 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1186 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1187 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1188 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1189 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1190 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1191 * @see #triggerJob(String, Properties) +1192 * @see #runJob(String, Properties, Properties, long, TimeUnit) +1193 * @deprecated use {@link #runJob(RunJob, long, java.util.concurrent.TimeUnit)}, +1194 * this method will be removed in version 10 of this library +1195 */ +1196 public RundeckExecution runJob(String jobId, Properties options, Properties nodeFilters, long poolingInterval, +1197 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +1198 IllegalArgumentException { +1199 return runJob(jobId, options, nodeFilters, null, poolingInterval, poolingUnit); +1200 } +1201 /** +1202 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1203 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to +1204 * know if the execution is finished (or aborted) or is still running. +1205 * +1206 * @param jobId identifier of the job - mandatory +1207 * @param options of the job - optional. See {@link OptionsBuilder}. +1208 * @param nodeFilters for overriding the nodes on which the job will be executed - optional. See +1209 * {@link NodeFiltersBuilder} +1210 * @param asUser specify a user name to run the job as, must have 'runAs' permission +1211 * @param poolingInterval for checking the status of the execution. Must be > 0. +1212 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1213 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1214 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1215 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1216 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1217 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1218 * @see #triggerJob(String, Properties) +1219 * @see #runJob(String, Properties, Properties, long, TimeUnit) +1220 * @deprecated use {@link #runJob(RunJob, long, java.util.concurrent.TimeUnit)}, this method will be removed in version 10 of this library +1221 */ +1222 public RundeckExecution runJob(String jobId, Properties options, Properties nodeFilters, String asUser, long poolingInterval, +1223 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +1224 IllegalArgumentException { +1225 return runJob(RunJobBuilder.builder() +1226 .setJobId(jobId) +1227 .setOptions(options) +1228 .setNodeFilters(nodeFilters) +1229 .setAsUser(asUser) +1230 .build(), poolingInterval, poolingUnit); +1231 } +1232 +1233 /** +1234 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1235 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to +1236 * know if the execution is finished (or aborted) or is still running. +1237 * +1238 * @param jobRun the RunJob, see {@link RunJobBuilder} +1239 * @param poolingInterval for checking the status of the execution. Must be > 0. +1240 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1241 * +1242 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1243 * +1244 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1245 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1246 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1247 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1248 * @see #triggerJob(RunJob) +1249 */ +1250 public RundeckExecution runJob(final RunJob jobRun, long poolingInterval, +1251 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +1252 IllegalArgumentException { +1253 +1254 if (poolingInterval <= 0) { +1255 poolingInterval = DEFAULT_POOLING_INTERVAL; +1256 poolingUnit = DEFAULT_POOLING_UNIT; +1257 } +1258 if (poolingUnit == null) { +1259 poolingUnit = DEFAULT_POOLING_UNIT; +1260 } +1261 +1262 RundeckExecution execution = triggerJob(jobRun); +1263 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { +1264 try { +1265 Thread.sleep(poolingUnit.toMillis(poolingInterval)); +1266 } catch (InterruptedException e) { +1267 break; +1268 } +1269 execution = getExecution(execution.getId()); +1270 } +1271 return execution; +1272 } +1273 +1274 /* +1275 * Ad-hoc commands +1276 */ +1277 +1278 /** +1279 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). +1280 * The command will not be dispatched to nodes, but be executed on the RunDeck server. +1281 * +1282 * @param project name of the project - mandatory +1283 * @param command to be executed - mandatory +1284 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1285 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1286 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1287 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1288 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1289 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) +1290 * @see #runAdhocCommand(String, String) +1291 * @deprecated use {@link #triggerAdhocCommand(RunAdhocCommand)}, will be removed in version 10 of this library +1292 */ +1293 public RundeckExecution triggerAdhocCommand(String project, String command) throws RundeckApiException, +1294 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1295 return triggerAdhocCommand(project, command, null); +1296 } +1297 +1298 /** +1299 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). +1300 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1301 * +1302 * @param project name of the project - mandatory +1303 * @param command to be executed - mandatory +1304 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1305 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1306 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1307 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1308 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1309 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1310 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) +1311 * @see #runAdhocCommand(String, String, Properties) +1312 * @deprecated use {@link #triggerAdhocCommand(RunAdhocCommand)}, will be removed in version 10 of this library +1313 */ +1314 public RundeckExecution triggerAdhocCommand(String project, String command, Properties nodeFilters) +1315 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1316 return triggerAdhocCommand(project, command, nodeFilters, null, null); +1317 } +1318 +1319 /** +1320 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). +1321 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1322 * +1323 * @param project name of the project - mandatory +1324 * @param command to be executed - mandatory +1325 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1326 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1327 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1328 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1329 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1330 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1331 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1332 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1333 * @see #triggerAdhocCommand(String, String) +1334 * @see #runAdhocCommand(String, String, Properties) +1335 * @deprecated use {@link #triggerAdhocCommand(RunAdhocCommand)}, will be removed in version 10 of this library +1336 */ +1337 public RundeckExecution triggerAdhocCommand(String project, String command, Properties nodeFilters, +1338 Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, RundeckApiLoginException, +1339 RundeckApiTokenException, IllegalArgumentException { +1340 return triggerAdhocCommand(project, command, nodeFilters, nodeThreadcount, nodeKeepgoing, null); +1341 } +1342 /** +1343 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). +1344 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1345 * +1346 * @param project name of the project - mandatory +1347 * @param command to be executed - mandatory +1348 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1349 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1350 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1351 * @param asUser specify a user name to run the job as, must have 'runAs' permission +1352 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1353 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1354 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1355 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1356 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1357 * @see #triggerAdhocCommand(String, String) +1358 * @see #runAdhocCommand(String, String, Properties) +1359 * @deprecated use {@link #triggerAdhocCommand(RunAdhocCommand)}, will be removed in version 10 of this library +1360 */ +1361 public RundeckExecution triggerAdhocCommand(String project, String command, Properties nodeFilters, +1362 Integer nodeThreadcount, Boolean nodeKeepgoing, String asUser) throws RundeckApiException, RundeckApiLoginException, +1363 RundeckApiTokenException, IllegalArgumentException { +1364 return triggerAdhocCommand(RunAdhocCommandBuilder.builder() +1365 .setProject(project) +1366 .setCommand(command) +1367 .setNodeFilters(nodeFilters) +1368 .setNodeThreadcount(nodeThreadcount) +1369 .setNodeKeepgoing(nodeKeepgoing) +1370 .setAsUser(asUser) +1371 .build()); +1372 } +1373 /** +1374 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). +1375 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1376 * +1377 * @param command the RunAdhocCommand. Project and command are mandatory, see {@link RunAdhocCommandBuilder} +1378 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1379 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1380 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1381 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1382 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1383 * @see #triggerAdhocCommand(String, String) +1384 * @see #runAdhocCommand(String, String, Properties) +1385 */ +1386 public RundeckExecution triggerAdhocCommand(RunAdhocCommand command) throws RundeckApiException, RundeckApiLoginException, +1387 RundeckApiTokenException, IllegalArgumentException { +1388 AssertUtil.notBlank(command.getProject(), "project is mandatory to trigger an ad-hoc command !"); +1389 AssertUtil.notBlank(command.getCommand(), "command is mandatory to trigger an ad-hoc command !"); +1390 ApiPathBuilder apiPath = new ApiPathBuilder("/run/command").param("project", command.getProject()) +1391 .param("exec", command.getCommand()) +1392 .param("nodeThreadcount", +1393 command.getNodeThreadcount()) +1394 .param("nodeKeepgoing", +1395 command.getNodeKeepgoing()) +1396 .nodeFilters(command.getNodeFilters()); +1397 if(null!= command.getAsUser()) { +1398 apiPath.param("asUser", command.getAsUser()); +1399 } +1400 RundeckExecution execution = new ApiCall(this).get(apiPath, new ExecutionParser("result/execution")); +1401 // the first call just returns the ID of the execution, so we need another call to get a "real" execution +1402 return getExecution(execution.getId()); +1403 } +1404 +1405 /** +1406 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1407 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +1408 * running. The command will not be dispatched to nodes, but be executed on the RunDeck server. +1409 * +1410 * @param project name of the project - mandatory +1411 * @param command to be executed - mandatory +1412 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1413 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1414 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1415 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1416 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1417 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) +1418 * @see #triggerAdhocCommand(String, String) +1419 * @deprecated use {@link #runAdhocCommand(RunAdhocCommand)}, this method will +1420 * be removed in version 10 of this library +1421 */ +1422 public RundeckExecution runAdhocCommand(String project, String command) throws RundeckApiException, +1423 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1424 return runAdhocCommand(project, command, null); +1425 } +1426 +1427 /** +1428 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1429 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +1430 * finished (or aborted) or is still running. The command will not be dispatched to nodes, but be executed on the +1431 * RunDeck server. +1432 * 1433 * @param project name of the project - mandatory -1434 * @param script inputStream for reading the script to be executed - mandatory -1435 * @param options of the script - optional. See {@link OptionsBuilder}. -1436 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1437 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1434 * @param command to be executed - mandatory +1435 * @param poolingInterval for checking the status of the execution. Must be > 0. +1436 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1437 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null 1438 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) 1439 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 1440 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1441 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1442 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) -1443 * @see #runAdhocScript(String, InputStream, Properties, Properties) -1444 */ -1445 public RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options, -1446 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1447 IllegalArgumentException { -1448 return triggerAdhocScript(project, script, options, nodeFilters, null, null); -1449 } -1450 -1451 /** -1452 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1453 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1454 * -1455 * @param project name of the project - mandatory -1456 * @param script inputStream for reading the script to be executed - mandatory -1457 * @param options of the script - optional. See {@link OptionsBuilder}. -1458 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} -1459 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1460 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1461 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1462 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1463 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1464 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1465 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1466 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) -1467 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1468 */ -1469 public RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options, -1470 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, -1471 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1472 AssertUtil.notBlank(project, "project is mandatory to trigger an ad-hoc script !"); -1473 AssertUtil.notNull(script, "script is mandatory to trigger an ad-hoc script !"); -1474 RundeckExecution execution = new ApiCall(this).post(new ApiPathBuilder("/run/script").param("project", project) -1475 .attach("scriptFile", -1476 script) -1477 .param("argString", -1478 ParametersUtil.generateArgString(options)) -1479 .param("nodeThreadcount", -1480 nodeThreadcount) -1481 .param("nodeKeepgoing", -1482 nodeKeepgoing) -1483 .nodeFilters(nodeFilters), -1484 new ExecutionParser("result/execution")); -1485 // the first call just returns the ID of the execution, so we need another call to get a "real" execution -1486 return getExecution(execution.getId()); -1487 } -1488 -1489 /** -1490 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1491 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1492 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. -1493 * -1494 * @param project name of the project - mandatory -1495 * @param scriptFilename filename of the script to be executed - mandatory -1496 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1497 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1498 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1499 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1500 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1501 * @throws IOException if we failed to read the file -1502 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1503 * @see #triggerAdhocScript(String, String) -1504 */ -1505 public RundeckExecution runAdhocScript(String project, String scriptFilename) throws RundeckApiException, -1506 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1507 return runAdhocScript(project, scriptFilename, null); -1508 } -1509 -1510 /** -1511 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1512 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1513 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the -1514 * RunDeck server. -1515 * -1516 * @param project name of the project - mandatory -1517 * @param scriptFilename filename of the script to be executed - mandatory -1518 * @param poolingInterval for checking the status of the execution. Must be > 0. -1519 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1520 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1521 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1522 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1523 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1524 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1525 * @throws IOException if we failed to read the file -1526 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1527 * @see #triggerAdhocScript(String, String) -1528 */ -1529 public RundeckExecution runAdhocScript(String project, String scriptFilename, long poolingInterval, -1530 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1531 IllegalArgumentException, IOException { -1532 return runAdhocScript(project, scriptFilename, null, poolingInterval, poolingUnit); -1533 } -1534 -1535 /** -1536 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1537 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1538 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. -1539 * -1540 * @param project name of the project - mandatory -1541 * @param scriptFilename filename of the script to be executed - mandatory -1542 * @param options of the script - optional. See {@link OptionsBuilder}. -1543 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1544 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1545 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1546 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1547 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1548 * @throws IOException if we failed to read the file -1549 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1550 * @see #triggerAdhocScript(String, String, Properties) -1551 */ -1552 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options) -1553 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, -1554 IOException { -1555 return runAdhocScript(project, scriptFilename, options, null); -1556 } -1557 -1558 /** -1559 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1560 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1561 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the -1562 * RunDeck server. -1563 * -1564 * @param project name of the project - mandatory -1565 * @param scriptFilename filename of the script to be executed - mandatory -1566 * @param options of the script - optional. See {@link OptionsBuilder}. -1567 * @param poolingInterval for checking the status of the execution. Must be > 0. -1568 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1569 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1570 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1571 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1572 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1573 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1574 * @throws IOException if we failed to read the file -1575 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1576 * @see #triggerAdhocScript(String, String, Properties) -1577 */ -1578 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, -1579 long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, -1580 RundeckApiTokenException, IllegalArgumentException, IOException { -1581 return runAdhocScript(project, scriptFilename, options, null, poolingInterval, poolingUnit); -1582 } -1583 -1584 /** -1585 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1586 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1587 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1588 * -1589 * @param project name of the project - mandatory -1590 * @param scriptFilename filename of the script to be executed - mandatory -1591 * @param options of the script - optional. See {@link OptionsBuilder}. -1592 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1593 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1594 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1595 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1596 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1597 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1598 * @throws IOException if we failed to read the file -1599 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1600 * @see #triggerAdhocScript(String, String, Properties, Properties) -1601 */ -1602 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, -1603 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1604 IllegalArgumentException, IOException { -1605 return runAdhocScript(project, scriptFilename, options, nodeFilters, null, null); -1606 } -1607 -1608 /** -1609 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1610 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1611 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters -1612 * parameter. -1613 * -1614 * @param project name of the project - mandatory -1615 * @param scriptFilename filename of the script to be executed - mandatory -1616 * @param options of the script - optional. See {@link OptionsBuilder}. -1617 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1618 * @param poolingInterval for checking the status of the execution. Must be > 0. -1619 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1620 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1621 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1622 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1623 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1624 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1625 * @throws IOException if we failed to read the file -1626 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1627 * @see #triggerAdhocScript(String, String, Properties, Properties) -1628 */ -1629 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, -1630 Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, -1631 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1632 return runAdhocScript(project, scriptFilename, options, nodeFilters, null, null, poolingInterval, poolingUnit); -1633 } -1634 -1635 /** -1636 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1637 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1638 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1639 * -1640 * @param project name of the project - mandatory -1641 * @param scriptFilename filename of the script to be executed - mandatory -1642 * @param options of the script - optional. See {@link OptionsBuilder}. -1643 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1644 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1645 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1646 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1647 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1648 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1649 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1650 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1651 * @throws IOException if we failed to read the file -1652 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1653 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) -1654 */ -1655 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, -1656 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, -1657 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1658 return runAdhocScript(project, -1659 scriptFilename, -1660 options, -1661 nodeFilters, -1662 nodeThreadcount, -1663 nodeKeepgoing, -1664 DEFAULT_POOLING_INTERVAL, -1665 DEFAULT_POOLING_UNIT); -1666 } -1667 -1668 /** -1669 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1670 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1671 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters -1672 * parameter. -1673 * -1674 * @param project name of the project - mandatory -1675 * @param scriptFilename filename of the script to be executed - mandatory -1676 * @param options of the script - optional. See {@link OptionsBuilder}. -1677 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1678 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1679 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1680 * @param poolingInterval for checking the status of the execution. Must be > 0. -1681 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1682 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1683 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1684 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1685 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1686 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) -1687 * @throws IOException if we failed to read the file -1688 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1689 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) -1690 */ -1691 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, -1692 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, -1693 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1694 IllegalArgumentException, IOException { -1695 AssertUtil.notBlank(scriptFilename, "scriptFilename is mandatory to run an ad-hoc script !"); -1696 FileInputStream stream = null; -1697 try { -1698 stream = FileUtils.openInputStream(new File(scriptFilename)); -1699 return runAdhocScript(project, -1700 stream, -1701 options, -1702 nodeFilters, -1703 nodeThreadcount, -1704 nodeKeepgoing, -1705 poolingInterval, -1706 poolingUnit); -1707 } finally { -1708 IOUtils.closeQuietly(stream); -1709 } -1710 } -1711 -1712 /** -1713 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1714 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1715 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. -1716 * -1717 * @param project name of the project - mandatory -1718 * @param script inputStream for reading the script to be executed - mandatory -1719 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1720 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1721 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1722 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1723 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1724 * @throws IOException if we failed to read the file -1725 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1726 * @see #triggerAdhocScript(String, InputStream) -1727 */ -1728 public RundeckExecution runAdhocScript(String project, InputStream script) throws RundeckApiException, -1729 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1730 return runAdhocScript(project, script, null); -1731 } -1732 -1733 /** -1734 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1735 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1736 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the -1737 * RunDeck server. -1738 * -1739 * @param project name of the project - mandatory -1740 * @param script inputStream for reading the script to be executed - mandatory -1741 * @param poolingInterval for checking the status of the execution. Must be > 0. -1742 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1743 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1744 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1745 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1746 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1747 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1748 * @throws IOException if we failed to read the file -1749 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1750 * @see #triggerAdhocScript(String, InputStream) -1751 */ -1752 public RundeckExecution runAdhocScript(String project, InputStream script, long poolingInterval, -1753 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1754 IllegalArgumentException, IOException { -1755 return runAdhocScript(project, script, null, poolingInterval, poolingUnit); -1756 } -1757 +1441 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1442 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) +1443 * @see #triggerAdhocCommand(String, String) +1444 * @deprecated use {@link #runAdhocCommand(RunAdhocCommand, long, java.util.concurrent.TimeUnit)}, this method will +1445 * be removed in version 10 of this library +1446 */ +1447 public RundeckExecution runAdhocCommand(String project, String command, long poolingInterval, TimeUnit poolingUnit) +1448 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1449 return runAdhocCommand(project, command, null, poolingInterval, poolingUnit); +1450 } +1451 +1452 /** +1453 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1454 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +1455 * running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1456 * +1457 * @param project name of the project - mandatory +1458 * @param command to be executed - mandatory +1459 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1460 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1461 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1462 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1463 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1464 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1465 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) +1466 * @see #triggerAdhocCommand(String, String, Properties) +1467 * @deprecated use {@link #runAdhocCommand(RunAdhocCommand)}, this method will +1468 * be removed in version 10 of this library +1469 */ +1470 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters) +1471 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1472 return runAdhocCommand(project, command, nodeFilters, null, null); +1473 } +1474 +1475 /** +1476 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1477 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +1478 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the +1479 * nodeFilters parameter. +1480 * +1481 * @param project name of the project - mandatory +1482 * @param command to be executed - mandatory +1483 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1484 * @param poolingInterval for checking the status of the execution. Must be > 0. +1485 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1486 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1487 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1488 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1489 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1490 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1491 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) +1492 * @see #triggerAdhocCommand(String, String, Properties) +1493 * @deprecated use {@link #runAdhocCommand(RunAdhocCommand, long, java.util.concurrent.TimeUnit)}, this method will +1494 * be removed in version 10 of this library +1495 */ +1496 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, +1497 long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, +1498 RundeckApiTokenException, IllegalArgumentException { +1499 return runAdhocCommand(project, command, nodeFilters, null, null, poolingInterval, poolingUnit); +1500 } +1501 +1502 /** +1503 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1504 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +1505 * running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1506 * +1507 * @param project name of the project - mandatory +1508 * @param command to be executed - mandatory +1509 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1510 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1511 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1512 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1513 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1514 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1515 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1516 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1517 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) +1518 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) +1519 * @deprecated use {@link #runAdhocCommand(RunAdhocCommand)}, this method will +1520 * be removed in version 10 of this library +1521 */ +1522 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, +1523 Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, RundeckApiLoginException, +1524 RundeckApiTokenException, IllegalArgumentException { +1525 return runAdhocCommand(project, +1526 command, +1527 nodeFilters, +1528 nodeThreadcount, +1529 nodeKeepgoing, +1530 DEFAULT_POOLING_INTERVAL, +1531 DEFAULT_POOLING_UNIT); +1532 } +1533 +1534 /** +1535 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1536 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +1537 * running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1538 * +1539 * @param command the RunAdhocCommand, see {@link RunAdhocCommandBuilder} +1540 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1541 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1542 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1543 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1544 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1545 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) +1546 * @see #triggerAdhocCommand(RunAdhocCommand) +1547 */ +1548 public RundeckExecution runAdhocCommand(RunAdhocCommand command) throws RundeckApiException, RundeckApiLoginException, +1549 RundeckApiTokenException, IllegalArgumentException { +1550 return runAdhocCommand(command, +1551 DEFAULT_POOLING_INTERVAL, +1552 DEFAULT_POOLING_UNIT); +1553 } +1554 +1555 /** +1556 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1557 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +1558 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the +1559 * nodeFilters parameter. +1560 * +1561 * @param project name of the project - mandatory +1562 * @param command to be executed - mandatory +1563 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1564 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1565 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1566 * @param poolingInterval for checking the status of the execution. Must be > 0. +1567 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1568 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1569 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1570 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1571 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1572 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1573 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) +1574 * @deprecated use {@link #runAdhocCommand(RunAdhocCommand, long, java.util.concurrent.TimeUnit)}, this method will +1575 * be removed in version 10 of this library +1576 */ +1577 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, +1578 Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, TimeUnit poolingUnit) +1579 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1580 return runAdhocCommand(project, command, nodeFilters, nodeThreadcount, nodeKeepgoing, null, poolingInterval, poolingUnit); +1581 } +1582 +1583 /** +1584 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1585 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +1586 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the +1587 * nodeFilters parameter. +1588 * +1589 * @param project name of the project - mandatory +1590 * @param command to be executed - mandatory +1591 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1592 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1593 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1594 * @param poolingInterval for checking the status of the execution. Must be > 0. +1595 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1596 * +1597 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1598 * +1599 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1600 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1601 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1602 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1603 * @see #triggerAdhocCommand(String, String, Properties, Integer, Boolean) +1604 * @deprecated use {@link #runAdhocCommand(RunAdhocCommand, long, java.util.concurrent.TimeUnit)}, this method will +1605 * be removed in version 10 of this library +1606 */ +1607 public RundeckExecution runAdhocCommand(String project, String command, Properties nodeFilters, +1608 Integer nodeThreadcount, Boolean nodeKeepgoing, String asUser, long poolingInterval, TimeUnit poolingUnit) +1609 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1610 return runAdhocCommand(RunAdhocCommandBuilder.builder() +1611 .setProject(project) +1612 .setCommand(command) +1613 .setNodeFilters(nodeFilters) +1614 .setNodeThreadcount(nodeThreadcount) +1615 .setNodeKeepgoing(nodeKeepgoing) +1616 .setAsUser(asUser) +1617 .build(), poolingInterval, poolingUnit); +1618 } +1619 /** +1620 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1621 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +1622 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the +1623 * nodeFilters parameter. +1624 * +1625 * @param command the RunAdhocCommand, see {@link RunAdhocCommandBuilder} +1626 * @param poolingInterval for checking the status of the execution. Must be > 0. +1627 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1628 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1629 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1630 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1631 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1632 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1633 * @see #triggerAdhocCommand(RunAdhocCommand) +1634 */ +1635 public RundeckExecution runAdhocCommand(RunAdhocCommand command, long poolingInterval, TimeUnit poolingUnit) +1636 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1637 if (poolingInterval <= 0) { +1638 poolingInterval = DEFAULT_POOLING_INTERVAL; +1639 poolingUnit = DEFAULT_POOLING_UNIT; +1640 } +1641 if (poolingUnit == null) { +1642 poolingUnit = DEFAULT_POOLING_UNIT; +1643 } +1644 +1645 RundeckExecution execution = triggerAdhocCommand(command); +1646 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { +1647 try { +1648 Thread.sleep(poolingUnit.toMillis(poolingInterval)); +1649 } catch (InterruptedException e) { +1650 break; +1651 } +1652 execution = getExecution(execution.getId()); +1653 } +1654 return execution; +1655 } +1656 +1657 /* +1658 * Ad-hoc scripts +1659 */ +1660 +1661 /** +1662 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1663 * script will not be dispatched to nodes, but be executed on the RunDeck server. +1664 * +1665 * @param project name of the project - mandatory +1666 * @param scriptFilename filename of the script to be executed - mandatory +1667 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1668 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1669 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1670 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1671 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +1672 * @throws IOException if we failed to read the file +1673 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +1674 * @see #runAdhocScript(String, String) +1675 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1676 * removed in version 10 of this library +1677 */ +1678 public RundeckExecution triggerAdhocScript(String project, String scriptFilename) throws RundeckApiException, +1679 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +1680 return triggerAdhocScript(project, scriptFilename, null); +1681 } +1682 +1683 /** +1684 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1685 * script will not be dispatched to nodes, but be executed on the RunDeck server. +1686 * +1687 * @param project name of the project - mandatory +1688 * @param scriptFilename filename of the script to be executed - mandatory +1689 * @param options of the script - optional. See {@link OptionsBuilder}. +1690 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1691 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1692 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1693 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1694 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +1695 * @throws IOException if we failed to read the file +1696 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +1697 * @see #runAdhocScript(String, String, Properties) +1698 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1699 * removed in version 10 of this library +1700 */ +1701 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options) +1702 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, +1703 IOException { +1704 return triggerAdhocScript(project, scriptFilename, options, null); +1705 } +1706 +1707 /** +1708 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1709 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1710 * +1711 * @param project name of the project - mandatory +1712 * @param scriptFilename filename of the script to be executed - mandatory +1713 * @param options of the script - optional. See {@link OptionsBuilder}. +1714 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1715 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1716 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1717 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1718 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1719 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +1720 * @throws IOException if we failed to read the file +1721 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +1722 * @see #runAdhocScript(String, String, Properties, Properties) +1723 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1724 * removed in version 10 of this library +1725 */ +1726 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options, +1727 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +1728 IllegalArgumentException, IOException { +1729 return triggerAdhocScript(project, scriptFilename, options, nodeFilters, null, null); +1730 } +1731 +1732 /** +1733 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1734 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1735 * +1736 * @param project name of the project - mandatory +1737 * @param scriptFilename filename of the script to be executed - mandatory +1738 * @param options of the script - optional. See {@link OptionsBuilder}. +1739 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1740 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1741 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1742 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1743 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1744 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1745 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1746 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +1747 * @throws IOException if we failed to read the file +1748 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1749 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +1750 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1751 * removed in version 10 of this library +1752 */ +1753 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options, +1754 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, +1755 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +1756 return triggerAdhocScript(project, scriptFilename, options, nodeFilters, nodeThreadcount, nodeKeepgoing, null); +1757 } 1758 /** -1759 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1760 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1761 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. -1762 * -1763 * @param project name of the project - mandatory -1764 * @param script inputStream for reading the script to be executed - mandatory -1765 * @param options of the script - optional. See {@link OptionsBuilder}. -1766 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1767 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1768 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1769 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1770 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1771 * @throws IOException if we failed to read the file -1772 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1773 * @see #triggerAdhocScript(String, InputStream, Properties) -1774 */ -1775 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options) -1776 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, -1777 IOException { -1778 return runAdhocScript(project, script, options, null); -1779 } -1780 -1781 /** -1782 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1783 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1784 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the -1785 * RunDeck server. -1786 * -1787 * @param project name of the project - mandatory -1788 * @param script inputStream for reading the script to be executed - mandatory -1789 * @param options of the script - optional. See {@link OptionsBuilder}. -1790 * @param poolingInterval for checking the status of the execution. Must be > 0. -1791 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1792 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1793 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1794 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1795 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1796 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1797 * @throws IOException if we failed to read the file -1798 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1799 * @see #triggerAdhocScript(String, InputStream, Properties) -1800 */ -1801 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, -1802 long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, -1803 RundeckApiTokenException, IllegalArgumentException, IOException { -1804 return runAdhocScript(project, script, options, null, poolingInterval, poolingUnit); -1805 } -1806 -1807 /** -1808 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1809 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1810 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1811 * -1812 * @param project name of the project - mandatory -1813 * @param script inputStream for reading the script to be executed - mandatory -1814 * @param options of the script - optional. See {@link OptionsBuilder}. -1815 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1816 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1817 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1818 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1819 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1820 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1821 * @throws IOException if we failed to read the file -1822 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1823 * @see #triggerAdhocScript(String, InputStream, Properties, Properties) -1824 */ -1825 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, -1826 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1827 IllegalArgumentException, IOException { -1828 return runAdhocScript(project, script, options, nodeFilters, null, null); -1829 } -1830 -1831 /** -1832 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1833 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1834 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters -1835 * parameter. -1836 * -1837 * @param project name of the project - mandatory -1838 * @param script inputStream for reading the script to be executed - mandatory -1839 * @param options of the script - optional. See {@link OptionsBuilder}. -1840 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1841 * @param poolingInterval for checking the status of the execution. Must be > 0. -1842 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1843 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1844 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1845 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1846 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1847 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1848 * @throws IOException if we failed to read the file -1849 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1850 * @see #triggerAdhocScript(String, InputStream, Properties, Properties) -1851 */ -1852 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, -1853 Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, -1854 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1855 return runAdhocScript(project, script, options, nodeFilters, null, null, poolingInterval, poolingUnit); -1856 } -1857 -1858 /** -1859 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1860 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1861 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1862 * -1863 * @param project name of the project - mandatory -1864 * @param script inputStream for reading the script to be executed - mandatory -1865 * @param options of the script - optional. See {@link OptionsBuilder}. -1866 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1867 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1868 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1869 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1870 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1871 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1872 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1873 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1874 * @throws IOException if we failed to read the file -1875 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1876 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) -1877 */ -1878 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, -1879 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, -1880 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1881 return runAdhocScript(project, -1882 script, -1883 options, -1884 nodeFilters, -1885 nodeThreadcount, -1886 nodeKeepgoing, -1887 DEFAULT_POOLING_INTERVAL, -1888 DEFAULT_POOLING_UNIT); -1889 } -1890 -1891 /** -1892 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1893 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1894 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters -1895 * parameter. -1896 * -1897 * @param project name of the project - mandatory -1898 * @param script inputStream for reading the script to be executed - mandatory -1899 * @param options of the script - optional. See {@link OptionsBuilder}. -1900 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} -1901 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional -1902 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional -1903 * @param poolingInterval for checking the status of the execution. Must be > 0. -1904 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1905 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1906 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1907 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1908 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1909 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1910 * @throws IOException if we failed to read the file -1911 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1912 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1759 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1760 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1761 * +1762 * @param project name of the project - mandatory +1763 * @param scriptFilename filename of the script to be executed - mandatory +1764 * @param options of the script - optional. See {@link OptionsBuilder}. +1765 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1766 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1767 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1768 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1769 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1770 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1771 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1772 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +1773 * @throws IOException if we failed to read the file +1774 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1775 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +1776 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1777 * removed in version 10 of this library +1778 */ +1779 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, Properties options, +1780 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing,String asUser) throws RundeckApiException, +1781 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +1782 return triggerAdhocScript(project, scriptFilename, ParametersUtil.generateArgString(options), nodeFilters, +1783 nodeThreadcount, nodeKeepgoing, asUser); +1784 } +1785 /** +1786 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1787 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1788 * +1789 * @param project name of the project - mandatory +1790 * @param scriptFilename filename of the script to be executed - mandatory +1791 * @param argString arguments of the script - optional. +1792 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1793 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1794 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1795 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1796 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1797 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1798 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1799 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +1800 * @throws IOException if we failed to read the file +1801 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1802 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +1803 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1804 * removed in version 10 of this library +1805 */ +1806 public RundeckExecution triggerAdhocScript(String project, String scriptFilename, String argString, +1807 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing,String asUser) throws RundeckApiException, +1808 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +1809 AssertUtil.notBlank(scriptFilename, "scriptFilename is mandatory to trigger an ad-hoc script !"); +1810 FileInputStream stream = null; +1811 try { +1812 stream = FileUtils.openInputStream(new File(scriptFilename)); +1813 return triggerAdhocScript(RunAdhocScriptBuilder.builder() +1814 .setProject(project) +1815 .setScript(stream) +1816 .setNodeFilters(nodeFilters) +1817 .setArgString(argString) +1818 .setNodeThreadcount(nodeThreadcount) +1819 .setNodeKeepgoing(nodeKeepgoing) +1820 .setAsUser(asUser) +1821 .build()); +1822 } finally { +1823 IOUtils.closeQuietly(stream); +1824 } +1825 } +1826 +1827 /** +1828 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1829 * script will not be dispatched to nodes, but be executed on the RunDeck server. +1830 * +1831 * @param project name of the project - mandatory +1832 * @param script inputStream for reading the script to be executed - mandatory +1833 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1834 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1835 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1836 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1837 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1838 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1839 * @see #runAdhocScript(String, InputStream) +1840 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1841 * removed in version 10 of this library +1842 */ +1843 public RundeckExecution triggerAdhocScript(String project, InputStream script) throws RundeckApiException, +1844 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1845 return triggerAdhocScript(project, script, null); +1846 } +1847 +1848 /** +1849 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1850 * script will not be dispatched to nodes, but be executed on the RunDeck server. +1851 * +1852 * @param project name of the project - mandatory +1853 * @param script inputStream for reading the script to be executed - mandatory +1854 * @param options of the script - optional. See {@link OptionsBuilder}. +1855 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1856 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1857 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1858 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1859 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1860 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1861 * @see #runAdhocScript(String, InputStream, Properties) +1862 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1863 * removed in version 10 of this library +1864 */ +1865 public RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options) +1866 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1867 return triggerAdhocScript(project, script, options, null); +1868 } +1869 +1870 /** +1871 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1872 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1873 * +1874 * @param project name of the project - mandatory +1875 * @param script inputStream for reading the script to be executed - mandatory +1876 * @param options of the script - optional. See {@link OptionsBuilder}. +1877 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1878 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1879 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1880 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1881 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1882 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1883 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1884 * @see #runAdhocScript(String, InputStream, Properties, Properties) +1885 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1886 * removed in version 10 of this library +1887 */ +1888 public RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options, +1889 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +1890 IllegalArgumentException { +1891 return triggerAdhocScript(project, script, options, nodeFilters, null, null); +1892 } +1893 +1894 /** +1895 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1896 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1897 * +1898 * @param project name of the project - mandatory +1899 * @param script inputStream for reading the script to be executed - mandatory +1900 * @param options of the script - optional. See {@link OptionsBuilder}. +1901 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1902 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1903 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1904 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1905 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1906 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1907 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1908 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1909 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +1910 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +1911 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1912 * removed in version 10 of this library 1913 */ -1914 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, -1915 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, -1916 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1917 IllegalArgumentException { -1918 if (poolingInterval <= 0) { -1919 poolingInterval = DEFAULT_POOLING_INTERVAL; -1920 poolingUnit = DEFAULT_POOLING_UNIT; -1921 } -1922 if (poolingUnit == null) { -1923 poolingUnit = DEFAULT_POOLING_UNIT; -1924 } -1925 -1926 RundeckExecution execution = triggerAdhocScript(project, -1927 script, -1928 options, -1929 nodeFilters, -1930 nodeThreadcount, -1931 nodeKeepgoing); -1932 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { -1933 try { -1934 Thread.sleep(poolingUnit.toMillis(poolingInterval)); -1935 } catch (InterruptedException e) { -1936 break; -1937 } -1938 execution = getExecution(execution.getId()); -1939 } -1940 return execution; -1941 } -1942 -1943 /* -1944 * Executions -1945 */ -1946 -1947 /** -1948 * Get all running executions (for all projects) -1949 * -1950 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1951 * @throws RundeckApiException in case of error when calling the API -1952 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1953 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1954 * @see #getRunningExecutions(String) -1955 */ -1956 public List<RundeckExecution> getRunningExecutions() throws RundeckApiException, RundeckApiLoginException, -1957 RundeckApiTokenException { -1958 List<RundeckExecution> executions = new ArrayList<RundeckExecution>(); -1959 for (RundeckProject project : getProjects()) { -1960 executions.addAll(getRunningExecutions(project.getName())); -1961 } -1962 return executions; -1963 } -1964 -1965 /** -1966 * Get the running executions for the given project -1967 * -1968 * @param project name of the project - mandatory -1969 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1970 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1971 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1972 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1973 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1974 * @see #getRunningExecutions() -1975 */ -1976 public List<RundeckExecution> getRunningExecutions(String project) throws RundeckApiException, -1977 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1978 AssertUtil.notBlank(project, "project is mandatory get all running executions !"); -1979 return new ApiCall(this).get(new ApiPathBuilder("/executions/running").param("project", project), -1980 new ListParser<RundeckExecution>(new ExecutionParser(), -1981 "result/executions/execution")); -1982 } -1983 -1984 /** -1985 * Get the executions of the given job -1986 * -1987 * @param jobId identifier of the job - mandatory -1988 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1989 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1990 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1991 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1992 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1993 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) -1994 */ -1995 public List<RundeckExecution> getJobExecutions(String jobId) throws RundeckApiException, RundeckApiLoginException, -1996 RundeckApiTokenException, IllegalArgumentException { -1997 return getJobExecutions(jobId, (ExecutionStatus) null); -1998 } -1999 -2000 /** -2001 * Get the executions of the given job -2002 * -2003 * @param jobId identifier of the job - mandatory -2004 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -2005 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -2006 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2007 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2008 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2009 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is -2010 * invalid -2011 * @see #getJobExecutions(String, String, Long, Long) -2012 */ -2013 public List<RundeckExecution> getJobExecutions(String jobId, String status) throws RundeckApiException, -2014 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2015 return getJobExecutions(jobId, -2016 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status))); -2017 } -2018 -2019 /** -2020 * Get the executions of the given job -2021 * -2022 * @param jobId identifier of the job - mandatory -2023 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -2024 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -2025 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2026 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2027 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2028 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2029 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) -2030 */ -2031 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status) throws RundeckApiException, -2032 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2033 return getJobExecutions(jobId, status, null, null); -2034 } -2035 -2036 /** -2037 * Get the executions of the given job -2038 * -2039 * @param jobId identifier of the job - mandatory -2040 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -2041 * @param max number of results to return - optional (null for all) -2042 * @param offset the 0-indexed offset for the first result to return - optional -2043 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -2044 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2045 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2046 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2047 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is -2048 * invalid -2049 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) -2050 */ -2051 public List<RundeckExecution> getJobExecutions(String jobId, String status, Long max, Long offset) -2052 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2053 return getJobExecutions(jobId, -2054 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status)), -2055 max, -2056 offset); -2057 } -2058 -2059 /** -2060 * Get the executions of the given job -2061 * -2062 * @param jobId identifier of the job - mandatory -2063 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -2064 * @param max number of results to return - optional (null for all) -2065 * @param offset the 0-indexed offset for the first result to return - optional -2066 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -2067 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2068 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2069 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2070 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2071 */ -2072 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status, Long max, Long offset) -2073 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2074 AssertUtil.notBlank(jobId, "jobId is mandatory to get the executions of a job !"); -2075 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId, "/executions").param("status", status) -2076 .param("max", max) -2077 .param("offset", offset), -2078 new ListParser<RundeckExecution>(new ExecutionParser(), -2079 "result/executions/execution")); -2080 } -2081 -2082 /** -2083 * Get executions based on query parameters -2084 * -2085 * @param query query parameters for the request -2086 * @param max number of results to return - optional (null for all) -2087 * @param offset the 0-indexed offset for the first result to return - optional -2088 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -2089 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2090 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2091 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2092 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2093 */ -2094 public PagedResults<RundeckExecution> getExecutions(ExecutionQuery query, Long max, Long offset) -2095 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2096 if (!query.notBlank()) { -2097 throw new IllegalArgumentException("Some execution query parameter must be set"); -2098 } -2099 AssertUtil.notBlank(query.getProject(), "project is required for execution query"); -2100 return new ApiCall(this).get(new ApiPathBuilder("/executions") -2101 .param(new ExecutionQueryParameters(query)) -2102 .param("max", max) -2103 .param("offset", offset), -2104 new PagedResultParser<RundeckExecution>( -2105 new ListParser<RundeckExecution>(new ExecutionParser(), "execution"), -2106 "result/executions" -2107 ) -2108 ); -2109 } -2110 -2111 /** -2112 * Get a single execution, identified by the given ID -2113 * -2114 * @param executionId identifier of the execution - mandatory -2115 * @return a {@link RundeckExecution} instance - won't be null -2116 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) -2117 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2118 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2119 * @throws IllegalArgumentException if the executionId is null -2120 */ -2121 public RundeckExecution getExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, -2122 RundeckApiTokenException, IllegalArgumentException { -2123 AssertUtil.notNull(executionId, "executionId is mandatory to get the details of an execution !"); -2124 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString()), -2125 new ExecutionParser("result/executions/execution")); -2126 } -2127 -2128 /** -2129 * Abort an execution (identified by the given ID). The execution should be running... -2130 * -2131 * @param executionId identifier of the execution - mandatory -2132 * @return a {@link RundeckAbort} instance - won't be null -2133 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) -2134 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2135 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2136 * @throws IllegalArgumentException if the executionId is null -2137 */ -2138 public RundeckAbort abortExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, -2139 RundeckApiTokenException, IllegalArgumentException { -2140 AssertUtil.notNull(executionId, "executionId is mandatory to abort an execution !"); -2141 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/abort"), -2142 new AbortParser("result/abort")); -2143 } -2144 -2145 /* -2146 * History -2147 */ -2148 -2149 /** -2150 * Get the (events) history for the given project -2151 * -2152 * @param project name of the project - mandatory -2153 * @return a {@link RundeckHistory} instance - won't be null -2154 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2155 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2156 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2157 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2158 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2159 */ -2160 public RundeckHistory getHistory(String project) throws RundeckApiException, RundeckApiLoginException, -2161 RundeckApiTokenException, IllegalArgumentException { -2162 return getHistory(project, null, null,(String) null, (String) null, null, null, null, null); -2163 } -2164 -2165 /** -2166 * Get the (events) history for the given project -2167 * -2168 * @param project name of the project - mandatory -2169 * @param max number of results to return - optional (default to 20) -2170 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -2171 * @return a {@link RundeckHistory} instance - won't be null -2172 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2173 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2174 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2175 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2176 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2177 */ -2178 public RundeckHistory getHistory(String project, Long max, Long offset) throws RundeckApiException, -2179 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2180 return getHistory(project, null, null, (String)null, (String)null, null, null, max, offset); -2181 } -2182 -2183 /** -2184 * Get the (events) history for the given project -2185 * -2186 * @param project name of the project - mandatory -2187 * @param jobId include only events matching the given job ID - optional -2188 * @param reportId include only events matching the given report ID - optional -2189 * @param user include only events created by the given user - optional -2190 * @return a {@link RundeckHistory} instance - won't be null -2191 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2192 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2193 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2194 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2195 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2196 */ -2197 public RundeckHistory getHistory(String project, String jobId, String reportId, String user) -2198 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2199 return getHistory(project, jobId, reportId, user, null, null, null, null, null); -2200 } -2201 -2202 /** -2203 * Get the (events) history for the given project -2204 * -2205 * @param project name of the project - mandatory -2206 * @param jobId include only events matching the given job ID - optional -2207 * @param reportId include only events matching the given report ID - optional -2208 * @param user include only events created by the given user - optional -2209 * @param max number of results to return - optional (default to 20) -2210 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -2211 * @return a {@link RundeckHistory} instance - won't be null -2212 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2213 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2214 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2215 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2216 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2217 */ -2218 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, Long max, Long offset) -2219 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2220 return getHistory(project, jobId, reportId, user, null, null, null, max, offset); -2221 } -2222 -2223 /** -2224 * Get the (events) history for the given project -2225 * -2226 * @param project name of the project - mandatory -2227 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y -2228 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 -2229 * weeks), "5d" (= last 5 days), etc. Optional. -2230 * @return a {@link RundeckHistory} instance - won't be null -2231 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2232 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2233 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2234 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2235 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2236 */ -2237 public RundeckHistory getHistory(String project, String recent) throws RundeckApiException, -2238 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2239 return getHistory(project, null, null, null, recent, null, null, null, null); -2240 } -2241 -2242 /** -2243 * Get the (events) history for the given project -2244 * -2245 * @param project name of the project - mandatory -2246 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y -2247 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 -2248 * weeks), "5d" (= last 5 days), etc. Optional. -2249 * @param max number of results to return - optional (default to 20) -2250 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -2251 * @return a {@link RundeckHistory} instance - won't be null -2252 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2253 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2254 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2255 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2256 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2257 */ -2258 public RundeckHistory getHistory(String project, String recent, Long max, Long offset) throws RundeckApiException, -2259 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2260 return getHistory(project, null, null, null, recent, null, null, max, offset); -2261 } -2262 -2263 /** -2264 * Get the (events) history for the given project -2265 * -2266 * @param project name of the project - mandatory -2267 * @param begin date for the earlier events to retrieve - optional -2268 * @param end date for the latest events to retrieve - optional -2269 * @return a {@link RundeckHistory} instance - won't be null -2270 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2271 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2272 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2273 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2274 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2275 */ -2276 public RundeckHistory getHistory(String project, Date begin, Date end) throws RundeckApiException, -2277 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2278 return getHistory(project, null, null, (String)null, (String)null, begin, end, null, null); -2279 } -2280 -2281 /** -2282 * Get the (events) history for the given project -2283 * -2284 * @param project name of the project - mandatory -2285 * @param begin date for the earlier events to retrieve - optional -2286 * @param end date for the latest events to retrieve - optional -2287 * @param max number of results to return - optional (default to 20) -2288 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -2289 * @return a {@link RundeckHistory} instance - won't be null -2290 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2291 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2292 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2293 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2294 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -2295 */ -2296 public RundeckHistory getHistory(String project, Date begin, Date end, Long max, Long offset) -2297 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2298 return getHistory(project, null, null, (String)null, (String) null, begin, end, max, offset); -2299 } -2300 -2301 /** -2302 * Get the (events) history for the given project -2303 * -2304 * @param project name of the project - mandatory -2305 * @param jobId include only events matching the given job ID - optional -2306 * @param reportId include only events matching the given report ID - optional -2307 * @param user include only events created by the given user - optional -2308 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y -2309 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 -2310 * weeks), "5d" (= last 5 days), etc. Optional. -2311 * @param begin date for the earlier events to retrieve - optional -2312 * @param end date for the latest events to retrieve - optional -2313 * @param max number of results to return - optional (default to 20) -2314 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -2315 * @return a {@link RundeckHistory} instance - won't be null -2316 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2317 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2318 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2319 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2320 */ -2321 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, String recent, -2322 Date begin, Date end, Long max, Long offset) throws RundeckApiException, RundeckApiLoginException, -2323 RundeckApiTokenException, IllegalArgumentException { -2324 AssertUtil.notBlank(project, "project is mandatory to get the history !"); -2325 return new ApiCall(this).get(new ApiPathBuilder("/history").param("project", project) -2326 .param("jobIdFilter", jobId) -2327 .param("reportIdFilter", reportId) -2328 .param("userFilter", user) -2329 .param("recentFilter", recent) -2330 .param("begin", begin) -2331 .param("end", end) -2332 .param("max", max) -2333 .param("offset", offset), -2334 new HistoryParser("result/events")); -2335 } -2336 -2337 /** -2338 * Get the (events) history for the given project -2339 * -2340 * @param project name of the project - mandatory -2341 * @param includeJobNames list of job names ("group/name") to include results for -2342 * @param excludeJobNames list of job names ("group/name") to exclude results for -2343 * @param user include only events created by the given user - optional -2344 * @param recent include only events matching the given period of time. Format : "XY", where X is an -2345 * integer, and Y is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). -2346 * Example : "2w" (= last 2 weeks), "5d" (= last 5 days), etc. Optional. -2347 * @param begin date for the earlier events to retrieve - optional -2348 * @param end date for the latest events to retrieve - optional -2349 * @param max number of results to return - optional (default to 20) -2350 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -2351 * -2352 * @return a {@link RundeckHistory} instance - won't be null -2353 * -2354 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2355 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2356 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2357 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1914 public RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options, +1915 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, +1916 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1917 return triggerAdhocScript(project, script, options, nodeFilters, nodeThreadcount, nodeKeepgoing, null); +1918 } +1919 /** +1920 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1921 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1922 * +1923 * @param project name of the project - mandatory +1924 * @param script inputStream for reading the script to be executed - mandatory +1925 * @param options of the script - optional. See {@link OptionsBuilder}. +1926 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1927 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1928 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1929 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1930 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1931 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1932 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1933 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1934 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +1935 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +1936 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1937 * removed in version 10 of this library +1938 */ +1939 public RundeckExecution triggerAdhocScript(String project, InputStream script, Properties options, +1940 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, String asUser) throws RundeckApiException, +1941 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1942 return triggerAdhocScript(project, script, ParametersUtil.generateArgString(options), nodeFilters, +1943 nodeThreadcount, nodeKeepgoing, asUser); +1944 } +1945 /** +1946 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1947 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1948 * +1949 * @param project name of the project - mandatory +1950 * @param script inputStream for reading the script to be executed - mandatory +1951 * @param argString arguments of the script - optional. +1952 * @param nodeFilters for selecting nodes on which the command will be executed. See {@link NodeFiltersBuilder} +1953 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +1954 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +1955 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1956 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1957 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1958 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1959 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1960 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +1961 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +1962 * @deprecated use {@link #triggerAdhocScript(RunAdhocScript)}, this method will be +1963 * removed in version 10 of this library +1964 */ +1965 public RundeckExecution triggerAdhocScript(String project, InputStream script, String argString, +1966 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, String asUser) throws RundeckApiException, +1967 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1968 return triggerAdhocScript(RunAdhocScriptBuilder.builder() +1969 .setProject(project) +1970 .setScript(script) +1971 .setNodeFilters(nodeFilters) +1972 .setArgString(argString) +1973 .setNodeThreadcount(nodeThreadcount) +1974 .setNodeKeepgoing(nodeKeepgoing) +1975 .setAsUser(asUser) +1976 .build()); +1977 } +1978 +1979 /** +1980 * Trigger the execution of an ad-hoc script read from a file, and return immediately (without waiting the end of +1981 * the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1982 * +1983 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +1984 * @param scriptFilename a file to read as the input script stream +1985 * +1986 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1987 * +1988 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1989 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1990 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1991 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1992 * @throws IOException if an error occurs reading the script file +1993 * @see #triggerAdhocScript(RunAdhocScript) +1994 * @see #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit) +1995 */ +1996 public RundeckExecution triggerAdhocScript(final RunAdhocScript script, final String scriptFilename) throws +1997 RundeckApiException, +1998 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +1999 AssertUtil.notBlank(scriptFilename, "scriptFilename is mandatory to trigger an ad-hoc script !"); +2000 FileInputStream stream = null; +2001 try { +2002 stream = FileUtils.openInputStream(new File(scriptFilename)); +2003 return triggerAdhocScript(RunAdhocScriptBuilder.builder(script) +2004 .setScript(stream) +2005 .build()); +2006 } finally { +2007 IOUtils.closeQuietly(stream); +2008 } +2009 } +2010 /** +2011 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +2012 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +2013 * +2014 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +2015 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +2016 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2017 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2018 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2019 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2020 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +2021 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2022 */ +2023 public RundeckExecution triggerAdhocScript(RunAdhocScript script) throws RundeckApiException, +2024 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2025 AssertUtil.notBlank(script.getProject(), "project is mandatory to trigger an ad-hoc script !"); +2026 AssertUtil.notNull(script.getScript(), "script is mandatory to trigger an ad-hoc script !"); +2027 ApiPathBuilder apiPath = new ApiPathBuilder("/run/script").param("project", script.getProject()) +2028 .attach("scriptFile", +2029 script.getScript()) +2030 .param("argString",script.getArgString()) +2031 .param("nodeThreadcount", +2032 script.getNodeThreadcount()) +2033 .param("nodeKeepgoing", +2034 script.getNodeKeepgoing()) +2035 .param("scriptInterpreter", +2036 script.getScriptInterpreter()) +2037 .param("interpreterArgsQuoted", +2038 script.getInterpreterArgsQuoted()) +2039 .nodeFilters(script.getNodeFilters()); +2040 if(null!=script.getAsUser()) { +2041 apiPath.param("asUser", script.getAsUser()); +2042 } +2043 RundeckExecution execution = new ApiCall(this).post(apiPath, new ExecutionParser("result/execution")); +2044 // the first call just returns the ID of the execution, so we need another call to get a "real" execution +2045 return getExecution(execution.getId()); +2046 } +2047 +2048 /** +2049 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2050 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2051 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. +2052 * +2053 * @param project name of the project - mandatory +2054 * @param scriptFilename filename of the script to be executed - mandatory +2055 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2056 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2057 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2058 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2059 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2060 * @throws IOException if we failed to read the file +2061 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2062 * @see #triggerAdhocScript(String, String) +2063 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2064 * removed in version 10 of this library +2065 */ +2066 public RundeckExecution runAdhocScript(String project, String scriptFilename) throws RundeckApiException, +2067 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +2068 return runAdhocScript(project, scriptFilename, null); +2069 } +2070 +2071 /** +2072 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2073 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2074 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the +2075 * RunDeck server. +2076 * +2077 * @param project name of the project - mandatory +2078 * @param scriptFilename filename of the script to be executed - mandatory +2079 * @param poolingInterval for checking the status of the execution. Must be > 0. +2080 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2081 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2082 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2083 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2084 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2085 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2086 * @throws IOException if we failed to read the file +2087 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2088 * @see #triggerAdhocScript(String, String) +2089 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2090 * removed in version 10 of this library +2091 */ +2092 public RundeckExecution runAdhocScript(String project, String scriptFilename, long poolingInterval, +2093 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2094 IllegalArgumentException, IOException { +2095 return runAdhocScript(project, scriptFilename, null, poolingInterval, poolingUnit); +2096 } +2097 +2098 /** +2099 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2100 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2101 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. +2102 * +2103 * @param project name of the project - mandatory +2104 * @param scriptFilename filename of the script to be executed - mandatory +2105 * @param options of the script - optional. See {@link OptionsBuilder}. +2106 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2107 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2108 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2109 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2110 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2111 * @throws IOException if we failed to read the file +2112 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2113 * @see #triggerAdhocScript(String, String, Properties) +2114 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2115 * removed in version 10 of this library +2116 */ +2117 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options) +2118 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, +2119 IOException { +2120 return runAdhocScript(project, scriptFilename, options, null); +2121 } +2122 +2123 /** +2124 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2125 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2126 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the +2127 * RunDeck server. +2128 * +2129 * @param project name of the project - mandatory +2130 * @param scriptFilename filename of the script to be executed - mandatory +2131 * @param options of the script - optional. See {@link OptionsBuilder}. +2132 * @param poolingInterval for checking the status of the execution. Must be > 0. +2133 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2134 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2135 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2136 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2137 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2138 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2139 * @throws IOException if we failed to read the file +2140 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2141 * @see #triggerAdhocScript(String, String, Properties) +2142 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2143 * removed in version 10 of this library +2144 */ +2145 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, +2146 long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, +2147 RundeckApiTokenException, IllegalArgumentException, IOException { +2148 return runAdhocScript(project, scriptFilename, options, null, poolingInterval, poolingUnit); +2149 } +2150 +2151 /** +2152 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2153 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2154 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +2155 * +2156 * @param project name of the project - mandatory +2157 * @param scriptFilename filename of the script to be executed - mandatory +2158 * @param options of the script - optional. See {@link OptionsBuilder}. +2159 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2160 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2161 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2162 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2163 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2164 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2165 * @throws IOException if we failed to read the file +2166 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2167 * @see #triggerAdhocScript(String, String, Properties, Properties) +2168 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2169 * removed in version 10 of this library +2170 */ +2171 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, +2172 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2173 IllegalArgumentException, IOException { +2174 return runAdhocScript(project, scriptFilename, options, nodeFilters, null, null); +2175 } +2176 +2177 /** +2178 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2179 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2180 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters +2181 * parameter. +2182 * +2183 * @param project name of the project - mandatory +2184 * @param scriptFilename filename of the script to be executed - mandatory +2185 * @param options of the script - optional. See {@link OptionsBuilder}. +2186 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2187 * @param poolingInterval for checking the status of the execution. Must be > 0. +2188 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2189 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2190 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2191 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2192 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2193 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2194 * @throws IOException if we failed to read the file +2195 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2196 * @see #triggerAdhocScript(String, String, Properties, Properties) +2197 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2198 * removed in version 10 of this library +2199 */ +2200 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, +2201 Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, +2202 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +2203 return runAdhocScript(project, scriptFilename, options, nodeFilters, null, null, poolingInterval, poolingUnit); +2204 } +2205 +2206 /** +2207 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2208 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2209 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +2210 * +2211 * @param project name of the project - mandatory +2212 * @param scriptFilename filename of the script to be executed - mandatory +2213 * @param options of the script - optional. See {@link OptionsBuilder}. +2214 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2215 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +2216 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +2217 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2218 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2219 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2220 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2221 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2222 * @throws IOException if we failed to read the file +2223 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2224 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +2225 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2226 * removed in version 10 of this library +2227 */ +2228 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, +2229 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, +2230 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +2231 return runAdhocScript(project, +2232 scriptFilename, +2233 options, +2234 nodeFilters, +2235 nodeThreadcount, +2236 nodeKeepgoing, +2237 DEFAULT_POOLING_INTERVAL, +2238 DEFAULT_POOLING_UNIT); +2239 } +2240 +2241 /** +2242 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2243 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2244 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters +2245 * parameter. +2246 * +2247 * @param project name of the project - mandatory +2248 * @param scriptFilename filename of the script to be executed - mandatory +2249 * @param options of the script - optional. See {@link OptionsBuilder}. +2250 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2251 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +2252 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +2253 * @param poolingInterval for checking the status of the execution. Must be > 0. +2254 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2255 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2256 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2257 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2258 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2259 * @throws IllegalArgumentException if the project or scriptFilename is blank (null, empty or whitespace) +2260 * @throws IOException if we failed to read the file +2261 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2262 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +2263 * +2264 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2265 * removed in version 10 of this library +2266 */ +2267 public RundeckExecution runAdhocScript(String project, String scriptFilename, Properties options, +2268 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, +2269 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2270 IllegalArgumentException, IOException { +2271 AssertUtil.notBlank(scriptFilename, "scriptFilename is mandatory to run an ad-hoc script !"); +2272 FileInputStream stream = null; +2273 try { +2274 stream = FileUtils.openInputStream(new File(scriptFilename)); +2275 return runAdhocScript(RunAdhocScriptBuilder.builder() +2276 .setProject(project) +2277 .setScript(stream) +2278 .setNodeFilters(nodeFilters) +2279 .setArgString(ParametersUtil.generateArgString(options)) +2280 .setNodeThreadcount(nodeThreadcount) +2281 .setNodeKeepgoing(nodeKeepgoing) +2282 .build(), +2283 poolingInterval, +2284 poolingUnit); +2285 } finally { +2286 IOUtils.closeQuietly(stream); +2287 } +2288 } +2289 +2290 /** +2291 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2292 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2293 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. +2294 * +2295 * @param project name of the project - mandatory +2296 * @param script inputStream for reading the script to be executed - mandatory +2297 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2298 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2299 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2300 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2301 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2302 * @throws IOException if we failed to read the file +2303 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2304 * @see #triggerAdhocScript(String, InputStream) +2305 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2306 * removed in version 10 of this library +2307 */ +2308 public RundeckExecution runAdhocScript(String project, InputStream script) throws RundeckApiException, +2309 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +2310 return runAdhocScript(project, script, null); +2311 } +2312 +2313 /** +2314 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2315 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2316 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the +2317 * RunDeck server. +2318 * +2319 * @param project name of the project - mandatory +2320 * @param script inputStream for reading the script to be executed - mandatory +2321 * @param poolingInterval for checking the status of the execution. Must be > 0. +2322 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2323 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2324 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2325 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2326 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2327 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2328 * @throws IOException if we failed to read the file +2329 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2330 * @see #triggerAdhocScript(String, InputStream) +2331 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2332 * removed in version 10 of this library +2333 */ +2334 public RundeckExecution runAdhocScript(String project, InputStream script, long poolingInterval, +2335 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2336 IllegalArgumentException, IOException { +2337 return runAdhocScript(project, script, null, poolingInterval, poolingUnit); +2338 } +2339 +2340 /** +2341 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2342 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2343 * running. The script will not be dispatched to nodes, but be executed on the RunDeck server. +2344 * +2345 * @param project name of the project - mandatory +2346 * @param script inputStream for reading the script to be executed - mandatory +2347 * @param options of the script - optional. See {@link OptionsBuilder}. +2348 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2349 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2350 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2351 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2352 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2353 * @throws IOException if we failed to read the file +2354 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2355 * @see #triggerAdhocScript(String, InputStream, Properties) +2356 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2357 * removed in version 10 of this library 2358 */ -2359 public RundeckHistory getHistory(String project, -2360 String user, -2361 String recent, -2362 List<String> includeJobNames, -2363 List<String> excludeJobNames, -2364 Date begin, -2365 Date end, -2366 Long max, -2367 Long offset) -2368 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2369 -2370 AssertUtil.notBlank(project, "project is mandatory to get the history !"); -2371 final ApiPathBuilder builder = new ApiPathBuilder("/history").param("project", project) -2372 .field("jobListFilter", includeJobNames) -2373 .field("excludeJobListFilter", excludeJobNames) -2374 .param("userFilter", user) -2375 .param("recentFilter", recent) -2376 .param("begin", begin) -2377 .param("end", end) -2378 .param("max", max) -2379 .param("offset", offset); -2380 -2381 return new ApiCall(this).postOrGet(builder, new HistoryParser("result/events")); -2382 } -2383 -2384 /* -2385 * Nodes -2386 */ -2387 -2388 /** -2389 * List all nodes (for all projects) -2390 * -2391 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null -2392 * @throws RundeckApiException in case of error when calling the API -2393 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2394 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2395 */ -2396 public List<RundeckNode> getNodes() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { -2397 List<RundeckNode> nodes = new ArrayList<RundeckNode>(); -2398 for (RundeckProject project : getProjects()) { -2399 nodes.addAll(getNodes(project.getName())); -2400 } -2401 return nodes; -2402 } -2403 -2404 /** -2405 * List all nodes that belongs to the given project -2406 * -2407 * @param project name of the project - mandatory -2408 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null -2409 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2410 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2411 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2412 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2413 * @see #getNodes(String, Properties) -2414 */ -2415 public List<RundeckNode> getNodes(String project) throws RundeckApiException, RundeckApiLoginException, -2416 RundeckApiTokenException, IllegalArgumentException { -2417 return getNodes(project, null); -2418 } -2419 -2420 /** -2421 * List nodes that belongs to the given project -2422 * -2423 * @param project name of the project - mandatory -2424 * @param nodeFilters for filtering the nodes - optional. See {@link NodeFiltersBuilder} -2425 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null -2426 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -2427 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2428 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2429 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -2430 */ -2431 public List<RundeckNode> getNodes(String project, Properties nodeFilters) throws RundeckApiException, -2432 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2433 AssertUtil.notBlank(project, "project is mandatory to get all nodes !"); -2434 return new ApiCall(this).get(new ApiPathBuilder("/resources").param("project", project) -2435 .nodeFilters(nodeFilters), -2436 new ListParser<RundeckNode>(new NodeParser(), "project/node")); -2437 } -2438 -2439 /** -2440 * Get the definition of a single node -2441 * -2442 * @param name of the node - mandatory -2443 * @param project name of the project - mandatory -2444 * @return a {@link RundeckNode} instance - won't be null -2445 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -2446 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2447 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2448 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -2449 */ -2450 public RundeckNode getNode(String name, String project) throws RundeckApiException, RundeckApiLoginException, -2451 RundeckApiTokenException, IllegalArgumentException { -2452 AssertUtil.notBlank(name, "the name of the node is mandatory to get a node !"); -2453 AssertUtil.notBlank(project, "project is mandatory to get a node !"); -2454 return new ApiCall(this).get(new ApiPathBuilder("/resource/", name).param("project", project), -2455 new NodeParser("project/node")); -2456 } -2457 -2458 /** -2459 * Get the output of a job execution -2460 * -2461 * @param id of the execution - mandatory -2462 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -2463 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -2464 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2465 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2466 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -2467 */ -2468 public InputStream getOutput(String executionId) throws RundeckApiException, RundeckApiLoginException, -2469 RundeckApiTokenException, IllegalArgumentException { -2470 AssertUtil.notBlank(executionId, "the execution id is mandatory to get execution output !"); -2471 return new ApiCall(this).getNonApi(new ApiPathBuilder("/execution/downloadOutput/", executionId)); -2472 } -2473 -2474 /** -2475 * Get the html page of the user's profile -2476 * -2477 * @param username - mandatory -2478 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -2479 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -2480 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2481 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2482 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -2483 */ -2484 public InputStream getProfilePage(String username) throws RundeckApiException, RundeckApiLoginException, -2485 RundeckApiTokenException, IllegalArgumentException { -2486 AssertUtil.notBlank(username, "the username is mandatory to get profile page !"); -2487 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/profile?login=", username)); -2488 } -2489 -2490 -2491 /** -2492 * Generate a new token and get the result page (which is the html page of the user's profile) -2493 * -2494 * @param username - mandatory -2495 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -2496 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -2497 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2498 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2499 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -2500 */ -2501 public InputStream generateToken(String username) throws RundeckApiException, RundeckApiLoginException, -2502 RundeckApiTokenException, IllegalArgumentException { -2503 AssertUtil.notBlank(username, "the username is mandatory to generate the token"); -2504 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/generateApiToken?login=", username)); -2505 } -2506 -2507 -2508 /** -2509 * Get the execution output of the given job -2510 * -2511 * @param executionId identifier of the execution - mandatory -2512 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2513 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will override the offset value and return only the specified number of lines at the end of the log. -2514 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the specified date OR if more data is available at the given offset -2515 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2516 * @return {@link RundeckOutput} -2517 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2518 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2519 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2520 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2521 */ -2522 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, int lastlines, long lastmod, int maxlines) -2523 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2524 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2525 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/output.xml").param("offset", offset) -2526 .param("lastlines", lastlines) -2527 .param("lastmod", lastmod) -2528 .param("maxlines", maxlines), -2529 new OutputParser("result/output", createOutputEntryParser())); -2530 } -2531 -2532 -2533 /** -2534 * Get the execution output of the given job -2535 * -2536 * @param jobId identifier of the job - mandatory -2537 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2538 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the specified date OR if more data is available at the given offset -2539 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2540 * @return {@link RundeckOutput} -2541 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2542 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2543 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2544 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2545 */ -2546 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, long lastmod, int maxlines) -2547 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2548 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2549 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/output.xml").param("offset", offset) -2550 .param("lastmod", lastmod) -2551 .param("maxlines", maxlines), -2552 new OutputParser("result/output", createOutputEntryParser())); -2553 } -2554 -2555 private OutputEntryParser createOutputEntryParser() { -2556 if (getApiVersion() <= Version.V5.versionNumber) { -2557 return new OutputEntryParserV5(); -2558 }else{ -2559 return new OutputEntryParser(); -2560 } -2561 } -2562 -2563 -2564 /* -2565 * System Info -2566 */ -2567 -2568 /** -2569 * Get system informations about the RunDeck server -2570 * -2571 * @return a {@link RundeckSystemInfo} instance - won't be null -2572 * @throws RundeckApiException in case of error when calling the API -2573 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2574 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2575 */ -2576 public RundeckSystemInfo getSystemInfo() throws RundeckApiException, RundeckApiLoginException, -2577 RundeckApiTokenException { -2578 return new ApiCall(this).get(new ApiPathBuilder("/system/info"), new SystemInfoParser("result/system")); -2579 } -2580 -2581 /** -2582 * @return the URL of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) -2583 */ -2584 public String getUrl() { -2585 return url; -2586 } -2587 -2588 /** -2589 * @return the auth-token used for authentication on the RunDeck instance (null if using login-based or session-based auth) -2590 */ -2591 public String getToken() { -2592 return token; -2593 } -2594 -2595 /** -2596 * @return the login used for authentication on the RunDeck instance (null if using token-based or session-based auth) -2597 */ -2598 public String getLogin() { -2599 return login; -2600 } -2601 -2602 /** -2603 * @return the password used for authentication on the RunDeck instance (null if using token-based or session-based auth) -2604 */ -2605 public String getPassword() { -2606 return password; -2607 } -2608 -2609 /** -2610 * @return the sessionID used for authentication on the RunDeck instance (null if using login-based or token-based auth) -2611 */ -2612 public String getSessionID() { -2613 return sessionID; -2614 } -2615 -2616 @Override -2617 public String toString() { -2618 StringBuilder str = new StringBuilder(); -2619 str.append("RundeckClient ").append(API_VERSION); -2620 str.append(" [").append(url).append("] "); -2621 if (token != null) { -2622 str.append("(token=").append(token).append(")"); -2623 } else { -2624 str.append("(credentials=").append(login).append("|").append(password).append(")"); -2625 } -2626 return str.toString(); -2627 } -2628 -2629 @Override -2630 public int hashCode() { -2631 final int prime = 31; -2632 int result = 1; -2633 result = prime * result + ((login == null) ? 0 : login.hashCode()); -2634 result = prime * result + ((password == null) ? 0 : password.hashCode()); -2635 result = prime * result + ((token == null) ? 0 : token.hashCode()); -2636 result = prime * result + ((url == null) ? 0 : url.hashCode()); -2637 return result; -2638 } -2639 -2640 @Override -2641 public boolean equals(Object obj) { -2642 if (this == obj) -2643 return true; -2644 if (obj == null) -2645 return false; -2646 if (getClass() != obj.getClass()) -2647 return false; -2648 RundeckClient other = (RundeckClient) obj; -2649 if (login == null) { -2650 if (other.login != null) -2651 return false; -2652 } else if (!login.equals(other.login)) -2653 return false; -2654 if (password == null) { -2655 if (other.password != null) -2656 return false; -2657 } else if (!password.equals(other.password)) -2658 return false; -2659 if (token == null) { -2660 if (other.token != null) -2661 return false; -2662 } else if (!token.equals(other.token)) -2663 return false; -2664 if (url == null) { -2665 if (other.url != null) -2666 return false; -2667 } else if (!url.equals(other.url)) -2668 return false; -2669 return true; -2670 } -2671 -2672 } +2359 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options) +2360 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, +2361 IOException { +2362 return runAdhocScript(project, script, options, null); +2363 } +2364 +2365 /** +2366 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2367 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2368 * finished (or aborted) or is still running. The script will not be dispatched to nodes, but be executed on the +2369 * RunDeck server. +2370 * +2371 * @param project name of the project - mandatory +2372 * @param script inputStream for reading the script to be executed - mandatory +2373 * @param options of the script - optional. See {@link OptionsBuilder}. +2374 * @param poolingInterval for checking the status of the execution. Must be > 0. +2375 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2376 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2377 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2378 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2379 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2380 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2381 * @throws IOException if we failed to read the file +2382 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2383 * @see #triggerAdhocScript(String, InputStream, Properties) +2384 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2385 * removed in version 10 of this library +2386 */ +2387 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, +2388 long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, +2389 RundeckApiTokenException, IllegalArgumentException, IOException { +2390 return runAdhocScript(project, script, options, null, poolingInterval, poolingUnit); +2391 } +2392 +2393 /** +2394 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2395 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2396 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +2397 * +2398 * @param project name of the project - mandatory +2399 * @param script inputStream for reading the script to be executed - mandatory +2400 * @param options of the script - optional. See {@link OptionsBuilder}. +2401 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2402 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2403 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2404 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2405 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2406 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2407 * @throws IOException if we failed to read the file +2408 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2409 * @see #triggerAdhocScript(String, InputStream, Properties, Properties) +2410 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2411 * removed in version 10 of this library +2412 */ +2413 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, +2414 Properties nodeFilters) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2415 IllegalArgumentException, IOException { +2416 return runAdhocScript(project, script, options, nodeFilters, null, null); +2417 } +2418 +2419 /** +2420 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2421 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2422 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters +2423 * parameter. +2424 * +2425 * @param project name of the project - mandatory +2426 * @param script inputStream for reading the script to be executed - mandatory +2427 * @param options of the script - optional. See {@link OptionsBuilder}. +2428 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2429 * @param poolingInterval for checking the status of the execution. Must be > 0. +2430 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2431 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2432 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2433 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2434 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2435 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2436 * @throws IOException if we failed to read the file +2437 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2438 * @see #triggerAdhocScript(String, InputStream, Properties, Properties) +2439 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2440 * removed in version 10 of this library +2441 */ +2442 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, +2443 Properties nodeFilters, long poolingInterval, TimeUnit poolingUnit) throws RundeckApiException, +2444 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +2445 return runAdhocScript(project, script, options, nodeFilters, null, null, poolingInterval, poolingUnit); +2446 } +2447 +2448 /** +2449 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2450 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2451 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +2452 * +2453 * @param project name of the project - mandatory +2454 * @param script inputStream for reading the script to be executed - mandatory +2455 * @param options of the script - optional. See {@link OptionsBuilder}. +2456 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2457 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +2458 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +2459 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2460 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2461 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2462 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2463 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2464 * @throws IOException if we failed to read the file +2465 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +2466 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +2467 * @deprecated use {@link #runAdhocScript(RunAdhocScript)}, this method will be +2468 * removed in version 10 of this library +2469 */ +2470 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, +2471 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing) throws RundeckApiException, +2472 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +2473 return runAdhocScript(project, +2474 script, +2475 options, +2476 nodeFilters, +2477 nodeThreadcount, +2478 nodeKeepgoing, +2479 DEFAULT_POOLING_INTERVAL, +2480 DEFAULT_POOLING_UNIT); +2481 } +2482 +2483 /** +2484 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2485 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +2486 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +2487 * +2488 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +2489 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2490 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2491 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2492 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2493 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2494 * @throws IOException if we failed to read the file +2495 * @see #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit) +2496 * @see #triggerAdhocScript(RunAdhocScript) +2497 */ +2498 public RundeckExecution runAdhocScript(RunAdhocScript script) throws RundeckApiException, +2499 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +2500 return runAdhocScript(script, +2501 DEFAULT_POOLING_INTERVAL, +2502 DEFAULT_POOLING_UNIT); +2503 } +2504 +2505 /** +2506 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2507 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2508 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters +2509 * parameter. +2510 * +2511 * @param project name of the project - mandatory +2512 * @param script inputStream for reading the script to be executed - mandatory +2513 * @param options of the script - optional. See {@link OptionsBuilder}. +2514 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2515 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +2516 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +2517 * @param poolingInterval for checking the status of the execution. Must be > 0. +2518 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2519 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2520 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2521 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2522 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2523 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2524 * @throws IOException if we failed to read the file +2525 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2526 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +2527 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2528 * removed in version 10 of this library +2529 */ +2530 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, +2531 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, long poolingInterval, +2532 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2533 IllegalArgumentException { +2534 return runAdhocScript(project, script, options, nodeFilters, nodeThreadcount, nodeKeepgoing, null, poolingInterval, poolingUnit); +2535 } +2536 +2537 /** +2538 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2539 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2540 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters +2541 * parameter. +2542 * +2543 * @param project name of the project - mandatory +2544 * @param script inputStream for reading the script to be executed - mandatory +2545 * @param options of the script - optional. See {@link OptionsBuilder}. +2546 * @param nodeFilters for selecting nodes on which the script will be executed. See {@link NodeFiltersBuilder} +2547 * @param nodeThreadcount thread count to use (for parallelizing when running on multiple nodes) - optional +2548 * @param nodeKeepgoing if true, continue executing on other nodes even if some fail - optional +2549 * @param poolingInterval for checking the status of the execution. Must be > 0. +2550 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2551 * +2552 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2553 * +2554 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2555 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2556 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2557 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2558 * @throws IOException if we failed to read the file +2559 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2560 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +2561 * @deprecated use {@link #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit)}, this method will be +2562 * removed in version 10 of this library +2563 */ +2564 public RundeckExecution runAdhocScript(String project, InputStream script, Properties options, +2565 Properties nodeFilters, Integer nodeThreadcount, Boolean nodeKeepgoing, String asUser, long poolingInterval, +2566 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2567 IllegalArgumentException { +2568 return runAdhocScript(RunAdhocScriptBuilder.builder() +2569 .setProject(project) +2570 .setScript(script) +2571 .setNodeFilters(nodeFilters) +2572 .setArgString(ParametersUtil.generateArgString(options)) +2573 .setNodeThreadcount(nodeThreadcount) +2574 .setNodeKeepgoing(nodeKeepgoing) +2575 .setAsUser(asUser) +2576 .build(), poolingInterval, poolingUnit); +2577 } +2578 +2579 /** +2580 * Run an ad-hoc script read from a file, and wait until its execution is finished (or aborted) to return. We will +2581 * poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the +2582 * execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to +2583 * the nodeFilters parameter. +2584 * +2585 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +2586 * @param scriptFilename filename of a script to read +2587 * @param poolingInterval for checking the status of the execution. Must be > 0. +2588 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2589 * +2590 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2591 * +2592 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2593 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2594 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2595 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2596 * @throws IOException if we failed to read the file +2597 * @see #runAdhocScript(RunAdhocScript) +2598 * @see #triggerAdhocScript(RunAdhocScript, String) +2599 */ +2600 public RundeckExecution runAdhocScript(final RunAdhocScript script, final String scriptFilename, +2601 final long poolingInterval, final TimeUnit poolingUnit) throws RundeckApiException, +2602 RundeckApiLoginException, RundeckApiTokenException, +2603 IllegalArgumentException, IOException { +2604 FileInputStream stream = null; +2605 try { +2606 stream = FileUtils.openInputStream(new File(scriptFilename)); +2607 return runAdhocScript(RunAdhocScriptBuilder.builder(script) +2608 .setScript(stream) +2609 .build(), poolingInterval, poolingUnit); +2610 } finally { +2611 IOUtils.closeQuietly(stream); +2612 } +2613 } +2614 /** +2615 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +2616 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +2617 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters +2618 * parameter. +2619 * +2620 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +2621 * @param poolingInterval for checking the status of the execution. Must be > 0. +2622 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +2623 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +2624 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2625 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2626 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2627 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +2628 * @throws IOException if we failed to read the file +2629 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +2630 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +2631 */ +2632 public RundeckExecution runAdhocScript(final RunAdhocScript script, long poolingInterval, +2633 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +2634 IllegalArgumentException { +2635 if (poolingInterval <= 0) { +2636 poolingInterval = DEFAULT_POOLING_INTERVAL; +2637 poolingUnit = DEFAULT_POOLING_UNIT; +2638 } +2639 if (poolingUnit == null) { +2640 poolingUnit = DEFAULT_POOLING_UNIT; +2641 } +2642 +2643 RundeckExecution execution = triggerAdhocScript(script); +2644 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { +2645 try { +2646 Thread.sleep(poolingUnit.toMillis(poolingInterval)); +2647 } catch (InterruptedException e) { +2648 break; +2649 } +2650 execution = getExecution(execution.getId()); +2651 } +2652 return execution; +2653 } +2654 +2655 /* +2656 * Executions +2657 */ +2658 +2659 /** +2660 * Get all running executions (for all projects) +2661 * +2662 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2663 * @throws RundeckApiException in case of error when calling the API +2664 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2665 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2666 * @see #getRunningExecutions(String) +2667 */ +2668 public List<RundeckExecution> getRunningExecutions() throws RundeckApiException, RundeckApiLoginException, +2669 RundeckApiTokenException { +2670 List<RundeckExecution> executions = new ArrayList<RundeckExecution>(); +2671 for (RundeckProject project : getProjects()) { +2672 executions.addAll(getRunningExecutions(project.getName())); +2673 } +2674 return executions; +2675 } +2676 +2677 /** +2678 * Get the running executions for the given project +2679 * +2680 * @param project name of the project - mandatory +2681 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2682 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2683 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2684 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2685 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2686 * @see #getRunningExecutions() +2687 */ +2688 public List<RundeckExecution> getRunningExecutions(String project) throws RundeckApiException, +2689 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2690 AssertUtil.notBlank(project, "project is mandatory get all running executions !"); +2691 return new ApiCall(this).get(new ApiPathBuilder("/executions/running").param("project", project), +2692 new ListParser<RundeckExecution>(new ExecutionParser(), +2693 "result/executions/execution")); +2694 } +2695 +2696 /** +2697 * Get the executions of the given job +2698 * +2699 * @param jobId identifier of the job - mandatory +2700 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2701 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2702 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2703 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2704 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2705 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) +2706 */ +2707 public List<RundeckExecution> getJobExecutions(String jobId) throws RundeckApiException, RundeckApiLoginException, +2708 RundeckApiTokenException, IllegalArgumentException { +2709 return getJobExecutions(jobId, (ExecutionStatus) null); +2710 } +2711 +2712 /** +2713 * Get the executions of the given job +2714 * +2715 * @param jobId identifier of the job - mandatory +2716 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +2717 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2718 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2719 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2720 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2721 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is +2722 * invalid +2723 * @see #getJobExecutions(String, String, Long, Long) +2724 */ +2725 public List<RundeckExecution> getJobExecutions(String jobId, String status) throws RundeckApiException, +2726 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2727 return getJobExecutions(jobId, +2728 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status))); +2729 } +2730 +2731 /** +2732 * Get the executions of the given job +2733 * +2734 * @param jobId identifier of the job - mandatory +2735 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +2736 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2737 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2738 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2739 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2740 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2741 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) +2742 */ +2743 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status) throws RundeckApiException, +2744 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2745 return getJobExecutions(jobId, status, null, null); +2746 } +2747 +2748 /** +2749 * Get the executions of the given job +2750 * +2751 * @param jobId identifier of the job - mandatory +2752 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +2753 * @param max number of results to return - optional (null for all) +2754 * @param offset the 0-indexed offset for the first result to return - optional +2755 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2756 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2757 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2758 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2759 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is +2760 * invalid +2761 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) +2762 */ +2763 public List<RundeckExecution> getJobExecutions(String jobId, String status, Long max, Long offset) +2764 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2765 return getJobExecutions(jobId, +2766 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status)), +2767 max, +2768 offset); +2769 } +2770 +2771 /** +2772 * Get the executions of the given job +2773 * +2774 * @param jobId identifier of the job - mandatory +2775 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +2776 * @param max number of results to return - optional (null for all) +2777 * @param offset the 0-indexed offset for the first result to return - optional +2778 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2779 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2780 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2781 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2782 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2783 */ +2784 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status, Long max, Long offset) +2785 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2786 AssertUtil.notBlank(jobId, "jobId is mandatory to get the executions of a job !"); +2787 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId, "/executions").param("status", status) +2788 .param("max", max) +2789 .param("offset", offset), +2790 new ListParser<RundeckExecution>(new ExecutionParser(), +2791 "result/executions/execution")); +2792 } +2793 +2794 /** +2795 * Get executions based on query parameters +2796 * +2797 * @param query query parameters for the request +2798 * @param max number of results to return - optional (null for all) +2799 * @param offset the 0-indexed offset for the first result to return - optional +2800 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +2801 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2802 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2803 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2804 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2805 */ +2806 public PagedResults<RundeckExecution> getExecutions(ExecutionQuery query, Long max, Long offset) +2807 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2808 if (!query.notBlank()) { +2809 throw new IllegalArgumentException("Some execution query parameter must be set"); +2810 } +2811 AssertUtil.notBlank(query.getProject(), "project is required for execution query"); +2812 return new ApiCall(this).get(new ApiPathBuilder("/executions") +2813 .param(new ExecutionQueryParameters(query)) +2814 .param("max", max) +2815 .param("offset", offset), +2816 new PagedResultParser<RundeckExecution>( +2817 new ListParser<RundeckExecution>(new ExecutionParser(), "execution"), +2818 "result/executions" +2819 ) +2820 ); +2821 } +2822 +2823 /** +2824 * Get a single execution, identified by the given ID +2825 * +2826 * @param executionId identifier of the execution - mandatory +2827 * @return a {@link RundeckExecution} instance - won't be null +2828 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) +2829 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2830 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2831 * @throws IllegalArgumentException if the executionId is null +2832 */ +2833 public RundeckExecution getExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, +2834 RundeckApiTokenException, IllegalArgumentException { +2835 AssertUtil.notNull(executionId, "executionId is mandatory to get the details of an execution !"); +2836 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString()), +2837 new ExecutionParser("result/executions/execution")); +2838 } +2839 +2840 /** +2841 * Abort an execution (identified by the given ID). The execution should be running... +2842 * +2843 * @param executionId identifier of the execution - mandatory +2844 * @return a {@link RundeckAbort} instance - won't be null +2845 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) +2846 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2847 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2848 * @throws IllegalArgumentException if the executionId is null +2849 */ +2850 public RundeckAbort abortExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, +2851 RundeckApiTokenException, IllegalArgumentException { +2852 return abortExecution(executionId, null); +2853 } +2854 /** +2855 * Abort an execution (identified by the given ID). The execution should be running... +2856 * +2857 * @param executionId identifier of the execution - mandatory +2858 * @param asUser specify a user name to abort the job as, must have 'killAs' permission +2859 * @return a {@link RundeckAbort} instance - won't be null +2860 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) +2861 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2862 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2863 * @throws IllegalArgumentException if the executionId is null +2864 */ +2865 public RundeckAbort abortExecution(Long executionId, final String asUser) throws RundeckApiException, RundeckApiLoginException, +2866 RundeckApiTokenException, IllegalArgumentException { +2867 AssertUtil.notNull(executionId, "executionId is mandatory to abort an execution !"); +2868 ApiPathBuilder apiPath = new ApiPathBuilder("/execution/", executionId.toString(), "/abort"); +2869 if(null!=asUser) { +2870 apiPath.param("asUser", asUser); +2871 } +2872 return new ApiCall(this).get(apiPath, new AbortParser("result/abort")); +2873 } +2874 +2875 /* +2876 * History +2877 */ +2878 +2879 /** +2880 * Get the (events) history for the given project +2881 * +2882 * @param project name of the project - mandatory +2883 * @return a {@link RundeckHistory} instance - won't be null +2884 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2885 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2886 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2887 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2888 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +2889 */ +2890 public RundeckHistory getHistory(String project) throws RundeckApiException, RundeckApiLoginException, +2891 RundeckApiTokenException, IllegalArgumentException { +2892 return getHistory(project, null, null,(String) null, (String) null, null, null, null, null); +2893 } +2894 +2895 /** +2896 * Get the (events) history for the given project +2897 * +2898 * @param project name of the project - mandatory +2899 * @param max number of results to return - optional (default to 20) +2900 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +2901 * @return a {@link RundeckHistory} instance - won't be null +2902 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2903 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2904 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2905 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2906 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +2907 */ +2908 public RundeckHistory getHistory(String project, Long max, Long offset) throws RundeckApiException, +2909 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2910 return getHistory(project, null, null, (String)null, (String)null, null, null, max, offset); +2911 } +2912 +2913 /** +2914 * Get the (events) history for the given project +2915 * +2916 * @param project name of the project - mandatory +2917 * @param jobId include only events matching the given job ID - optional +2918 * @param reportId include only events matching the given report ID - optional +2919 * @param user include only events created by the given user - optional +2920 * @return a {@link RundeckHistory} instance - won't be null +2921 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2922 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2923 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2924 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2925 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +2926 */ +2927 public RundeckHistory getHistory(String project, String jobId, String reportId, String user) +2928 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2929 return getHistory(project, jobId, reportId, user, null, null, null, null, null); +2930 } +2931 +2932 /** +2933 * Get the (events) history for the given project +2934 * +2935 * @param project name of the project - mandatory +2936 * @param jobId include only events matching the given job ID - optional +2937 * @param reportId include only events matching the given report ID - optional +2938 * @param user include only events created by the given user - optional +2939 * @param max number of results to return - optional (default to 20) +2940 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +2941 * @return a {@link RundeckHistory} instance - won't be null +2942 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2943 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2944 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2945 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2946 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +2947 */ +2948 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, Long max, Long offset) +2949 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2950 return getHistory(project, jobId, reportId, user, null, null, null, max, offset); +2951 } +2952 +2953 /** +2954 * Get the (events) history for the given project +2955 * +2956 * @param project name of the project - mandatory +2957 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y +2958 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 +2959 * weeks), "5d" (= last 5 days), etc. Optional. +2960 * @return a {@link RundeckHistory} instance - won't be null +2961 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2962 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2963 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2964 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2965 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +2966 */ +2967 public RundeckHistory getHistory(String project, String recent) throws RundeckApiException, +2968 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2969 return getHistory(project, null, null, null, recent, null, null, null, null); +2970 } +2971 +2972 /** +2973 * Get the (events) history for the given project +2974 * +2975 * @param project name of the project - mandatory +2976 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y +2977 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 +2978 * weeks), "5d" (= last 5 days), etc. Optional. +2979 * @param max number of results to return - optional (default to 20) +2980 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +2981 * @return a {@link RundeckHistory} instance - won't be null +2982 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2983 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2984 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2985 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2986 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +2987 */ +2988 public RundeckHistory getHistory(String project, String recent, Long max, Long offset) throws RundeckApiException, +2989 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2990 return getHistory(project, null, null, null, recent, null, null, max, offset); +2991 } +2992 +2993 /** +2994 * Get the (events) history for the given project +2995 * +2996 * @param project name of the project - mandatory +2997 * @param begin date for the earlier events to retrieve - optional +2998 * @param end date for the latest events to retrieve - optional +2999 * @return a {@link RundeckHistory} instance - won't be null +3000 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +3001 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3002 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3003 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +3004 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +3005 */ +3006 public RundeckHistory getHistory(String project, Date begin, Date end) throws RundeckApiException, +3007 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +3008 return getHistory(project, null, null, (String)null, (String)null, begin, end, null, null); +3009 } +3010 +3011 /** +3012 * Get the (events) history for the given project +3013 * +3014 * @param project name of the project - mandatory +3015 * @param begin date for the earlier events to retrieve - optional +3016 * @param end date for the latest events to retrieve - optional +3017 * @param max number of results to return - optional (default to 20) +3018 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +3019 * @return a {@link RundeckHistory} instance - won't be null +3020 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +3021 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3022 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3023 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +3024 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +3025 */ +3026 public RundeckHistory getHistory(String project, Date begin, Date end, Long max, Long offset) +3027 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +3028 return getHistory(project, null, null, (String)null, (String) null, begin, end, max, offset); +3029 } +3030 +3031 /** +3032 * Get the (events) history for the given project +3033 * +3034 * @param project name of the project - mandatory +3035 * @param jobId include only events matching the given job ID - optional +3036 * @param reportId include only events matching the given report ID - optional +3037 * @param user include only events created by the given user - optional +3038 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y +3039 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 +3040 * weeks), "5d" (= last 5 days), etc. Optional. +3041 * @param begin date for the earlier events to retrieve - optional +3042 * @param end date for the latest events to retrieve - optional +3043 * @param max number of results to return - optional (default to 20) +3044 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +3045 * @return a {@link RundeckHistory} instance - won't be null +3046 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +3047 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3048 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3049 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +3050 */ +3051 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, String recent, +3052 Date begin, Date end, Long max, Long offset) throws RundeckApiException, RundeckApiLoginException, +3053 RundeckApiTokenException, IllegalArgumentException { +3054 AssertUtil.notBlank(project, "project is mandatory to get the history !"); +3055 return new ApiCall(this).get(new ApiPathBuilder("/history").param("project", project) +3056 .param("jobIdFilter", jobId) +3057 .param("reportIdFilter", reportId) +3058 .param("userFilter", user) +3059 .param("recentFilter", recent) +3060 .param("begin", begin) +3061 .param("end", end) +3062 .param("max", max) +3063 .param("offset", offset), +3064 new HistoryParser("result/events")); +3065 } +3066 +3067 /** +3068 * Get the (events) history for the given project +3069 * +3070 * @param project name of the project - mandatory +3071 * @param includeJobNames list of job names ("group/name") to include results for +3072 * @param excludeJobNames list of job names ("group/name") to exclude results for +3073 * @param user include only events created by the given user - optional +3074 * @param recent include only events matching the given period of time. Format : "XY", where X is an +3075 * integer, and Y is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). +3076 * Example : "2w" (= last 2 weeks), "5d" (= last 5 days), etc. Optional. +3077 * @param begin date for the earlier events to retrieve - optional +3078 * @param end date for the latest events to retrieve - optional +3079 * @param max number of results to return - optional (default to 20) +3080 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +3081 * +3082 * @return a {@link RundeckHistory} instance - won't be null +3083 * +3084 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +3085 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3086 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3087 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +3088 */ +3089 public RundeckHistory getHistory(String project, +3090 String user, +3091 String recent, +3092 List<String> includeJobNames, +3093 List<String> excludeJobNames, +3094 Date begin, +3095 Date end, +3096 Long max, +3097 Long offset) +3098 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +3099 +3100 AssertUtil.notBlank(project, "project is mandatory to get the history !"); +3101 final ApiPathBuilder builder = new ApiPathBuilder("/history").param("project", project) +3102 .field("jobListFilter", includeJobNames) +3103 .field("excludeJobListFilter", excludeJobNames) +3104 .param("userFilter", user) +3105 .param("recentFilter", recent) +3106 .param("begin", begin) +3107 .param("end", end) +3108 .param("max", max) +3109 .param("offset", offset); +3110 +3111 return new ApiCall(this).postOrGet(builder, new HistoryParser("result/events")); +3112 } +3113 +3114 /* +3115 * Nodes +3116 */ +3117 +3118 /** +3119 * List all nodes (for all projects) +3120 * +3121 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null +3122 * @throws RundeckApiException in case of error when calling the API +3123 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3124 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3125 */ +3126 public List<RundeckNode> getNodes() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { +3127 List<RundeckNode> nodes = new ArrayList<RundeckNode>(); +3128 for (RundeckProject project : getProjects()) { +3129 nodes.addAll(getNodes(project.getName())); +3130 } +3131 return nodes; +3132 } +3133 +3134 /** +3135 * List all nodes that belongs to the given project +3136 * +3137 * @param project name of the project - mandatory +3138 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null +3139 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +3140 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3141 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3142 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +3143 * @see #getNodes(String, Properties) +3144 */ +3145 public List<RundeckNode> getNodes(String project) throws RundeckApiException, RundeckApiLoginException, +3146 RundeckApiTokenException, IllegalArgumentException { +3147 return getNodes(project, null); +3148 } +3149 +3150 /** +3151 * List nodes that belongs to the given project +3152 * +3153 * @param project name of the project - mandatory +3154 * @param nodeFilters for filtering the nodes - optional. See {@link NodeFiltersBuilder} +3155 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null +3156 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +3157 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3158 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3159 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +3160 */ +3161 public List<RundeckNode> getNodes(String project, Properties nodeFilters) throws RundeckApiException, +3162 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +3163 AssertUtil.notBlank(project, "project is mandatory to get all nodes !"); +3164 return new ApiCall(this).get(new ApiPathBuilder("/resources").param("project", project) +3165 .nodeFilters(nodeFilters), +3166 new ListParser<RundeckNode>(new NodeParser(), "project/node")); +3167 } +3168 +3169 /** +3170 * Get the definition of a single node +3171 * +3172 * @param name of the node - mandatory +3173 * @param project name of the project - mandatory +3174 * @return a {@link RundeckNode} instance - won't be null +3175 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +3176 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3177 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3178 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +3179 */ +3180 public RundeckNode getNode(String name, String project) throws RundeckApiException, RundeckApiLoginException, +3181 RundeckApiTokenException, IllegalArgumentException { +3182 AssertUtil.notBlank(name, "the name of the node is mandatory to get a node !"); +3183 AssertUtil.notBlank(project, "project is mandatory to get a node !"); +3184 return new ApiCall(this).get(new ApiPathBuilder("/resource/", name).param("project", project), +3185 new NodeParser("project/node")); +3186 } +3187 +3188 /** +3189 * Get the output of a job execution +3190 * +3191 * @param executionId id of the execution - mandatory +3192 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +3193 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +3194 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3195 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3196 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +3197 */ +3198 public InputStream getOutput(String executionId) throws RundeckApiException, RundeckApiLoginException, +3199 RundeckApiTokenException, IllegalArgumentException { +3200 AssertUtil.notBlank(executionId, "the execution id is mandatory to get execution output !"); +3201 return new ApiCall(this).getNonApi(new ApiPathBuilder("/execution/downloadOutput/", executionId)); +3202 } +3203 +3204 /** +3205 * Get the html page of the user's profile +3206 * +3207 * @param username - mandatory +3208 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +3209 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +3210 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3211 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3212 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +3213 */ +3214 public InputStream getProfilePage(String username) throws RundeckApiException, RundeckApiLoginException, +3215 RundeckApiTokenException, IllegalArgumentException { +3216 AssertUtil.notBlank(username, "the username is mandatory to get profile page !"); +3217 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/profile?login=", username)); +3218 } +3219 +3220 +3221 /** +3222 * Generate a new token and get the result page (which is the html page of the user's profile) +3223 * +3224 * @param username - mandatory +3225 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +3226 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +3227 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3228 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3229 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +3230 */ +3231 public InputStream generateToken(String username) throws RundeckApiException, RundeckApiLoginException, +3232 RundeckApiTokenException, IllegalArgumentException { +3233 AssertUtil.notBlank(username, "the username is mandatory to generate the token"); +3234 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/generateApiToken?login=", username)); +3235 } +3236 +3237 +3238 /** +3239 * Get the execution output of the given job +3240 * +3241 * @param executionId identifier of the execution - mandatory +3242 * @param offset byte offset to read from in the file. 0 indicates the beginning. +3243 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will override the offset value and return only the specified number of lines at the end of the log. +3244 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the specified date OR if more data is available at the given offset +3245 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +3246 * @return {@link RundeckOutput} +3247 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +3248 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3249 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3250 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +3251 */ +3252 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, int lastlines, long lastmod, int maxlines) +3253 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +3254 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +3255 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/output.xml").param("offset", offset) +3256 .param("lastlines", lastlines) +3257 .param("lastmod", lastmod) +3258 .param("maxlines", maxlines), +3259 new OutputParser("result/output", createOutputEntryParser())); +3260 } +3261 +3262 +3263 /** +3264 * Get the execution output of the given job +3265 * +3266 * @param executionId identifier of the execution - mandatory +3267 * @param offset byte offset to read from in the file. 0 indicates the beginning. +3268 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the specified date OR if more data is available at the given offset +3269 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +3270 * @return {@link RundeckOutput} +3271 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +3272 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3273 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3274 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +3275 */ +3276 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, long lastmod, int maxlines) +3277 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +3278 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +3279 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString(), "/output.xml").param("offset", offset) +3280 .param("lastmod", lastmod) +3281 .param("maxlines", maxlines), +3282 new OutputParser("result/output", createOutputEntryParser())); +3283 } +3284 +3285 private OutputEntryParser createOutputEntryParser() { +3286 if (getApiVersion() <= Version.V5.versionNumber) { +3287 return new OutputEntryParserV5(); +3288 }else{ +3289 return new OutputEntryParser(); +3290 } +3291 } +3292 +3293 +3294 /* +3295 * System Info +3296 */ +3297 +3298 /** +3299 * Get system informations about the RunDeck server +3300 * +3301 * @return a {@link RundeckSystemInfo} instance - won't be null +3302 * @throws RundeckApiException in case of error when calling the API +3303 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +3304 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +3305 */ +3306 public RundeckSystemInfo getSystemInfo() throws RundeckApiException, RundeckApiLoginException, +3307 RundeckApiTokenException { +3308 return new ApiCall(this).get(new ApiPathBuilder("/system/info"), new SystemInfoParser("result/system")); +3309 } +3310 +3311 /** +3312 * @return the URL of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) +3313 */ +3314 public String getUrl() { +3315 return url; +3316 } +3317 +3318 /** +3319 * @return the auth-token used for authentication on the RunDeck instance (null if using login-based or session-based auth) +3320 */ +3321 public String getToken() { +3322 return token; +3323 } +3324 +3325 /** +3326 * @return the login used for authentication on the RunDeck instance (null if using token-based or session-based auth) +3327 */ +3328 public String getLogin() { +3329 return login; +3330 } +3331 +3332 /** +3333 * @return the password used for authentication on the RunDeck instance (null if using token-based or session-based auth) +3334 */ +3335 public String getPassword() { +3336 return password; +3337 } +3338 +3339 /** +3340 * @return the sessionID used for authentication on the RunDeck instance (null if using login-based or token-based auth) +3341 */ +3342 public String getSessionID() { +3343 return sessionID; +3344 } +3345 +3346 @Override +3347 public String toString() { +3348 StringBuilder str = new StringBuilder(); +3349 str.append("RundeckClient ").append(API_VERSION); +3350 str.append(" [").append(url).append("] "); +3351 if (token != null) { +3352 str.append("(token=").append(token).append(")"); +3353 } else { +3354 str.append("(credentials=").append(login).append("|").append(password).append(")"); +3355 } +3356 return str.toString(); +3357 } +3358 +3359 @Override +3360 public int hashCode() { +3361 final int prime = 31; +3362 int result = 1; +3363 result = prime * result + ((login == null) ? 0 : login.hashCode()); +3364 result = prime * result + ((password == null) ? 0 : password.hashCode()); +3365 result = prime * result + ((token == null) ? 0 : token.hashCode()); +3366 result = prime * result + ((url == null) ? 0 : url.hashCode()); +3367 return result; +3368 } +3369 +3370 @Override +3371 public boolean equals(Object obj) { +3372 if (this == obj) +3373 return true; +3374 if (obj == null) +3375 return false; +3376 if (getClass() != obj.getClass()) +3377 return false; +3378 RundeckClient other = (RundeckClient) obj; +3379 if (login == null) { +3380 if (other.login != null) +3381 return false; +3382 } else if (!login.equals(other.login)) +3383 return false; +3384 if (password == null) { +3385 if (other.password != null) +3386 return false; +3387 } else if (!password.equals(other.password)) +3388 return false; +3389 if (token == null) { +3390 if (other.token != null) +3391 return false; +3392 } else if (!token.equals(other.token)) +3393 return false; +3394 if (url == null) { +3395 if (other.url != null) +3396 return false; +3397 } else if (!url.equals(other.url)) +3398 return false; +3399 return true; +3400 } +3401 +3402 }
    diff --git a/xref/org/rundeck/api/RundeckClientBuilder.html b/xref/org/rundeck/api/RundeckClientBuilder.html index b0c4452..707e237 100644 --- a/xref/org/rundeck/api/RundeckClientBuilder.html +++ b/xref/org/rundeck/api/RundeckClientBuilder.html @@ -14,7 +14,7 @@ 4 5 6 /** -7 * Builder to create a {@link RundeckClient}, you must specify a url, and at least one of (login, password), token, or +7 * Builder to build a {@link RundeckClient}, you must specify a url, and at least one of (login, password), token, or 8 * sessionId. 9 */ 10 public class RundeckClientBuilder { diff --git a/xref/org/rundeck/api/RundeckJobsImport.html b/xref/org/rundeck/api/RundeckJobsImport.html new file mode 100644 index 0000000..d03c90e --- /dev/null +++ b/xref/org/rundeck/api/RundeckJobsImport.html @@ -0,0 +1,48 @@ + + + + +RundeckJobsImport xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import org.rundeck.api.domain.RundeckJobsImportMethod;
    +4   
    +5   import java.io.InputStream;
    +6   
    +7   /**
    +8    * Request to import a set of Job definitions
    +9    */
    +10  public interface RundeckJobsImport {
    +11      /**
    +12       * Return the input stream
    +13       * @return
    +14       */
    +15      public InputStream getStream();
    +16  
    +17      /**
    +18       * Return the file type
    +19       * @return
    +20       */
    +21      public FileType getFileType();
    +22  
    +23      /**
    +24       * Return the import behavior
    +25       * @return
    +26       */
    +27      public RundeckJobsImportMethod getImportMethod();
    +28  
    +29      /**
    +30       * Return the project name
    +31       * @return
    +32       */
    +33      public String getProject();
    +34  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/RundeckJobsImportBuilder.html b/xref/org/rundeck/api/RundeckJobsImportBuilder.html new file mode 100644 index 0000000..1e4a52d --- /dev/null +++ b/xref/org/rundeck/api/RundeckJobsImportBuilder.html @@ -0,0 +1,81 @@ + + + + +RundeckJobsImportBuilder xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import org.rundeck.api.domain.RundeckJobsImportMethod;
    +4   
    +5   import java.io.InputStream;
    +6   
    +7   /**
    +8    * Builds a {@link RundeckJobsImport}
    +9    */
    +10  public class RundeckJobsImportBuilder {
    +11      private DefaultJobsImport jobsImport;
    +12  
    +13      public RundeckJobsImportBuilder() {
    +14          jobsImport = new DefaultJobsImport();
    +15      }
    +16  
    +17      public RundeckJobsImportBuilder(final RundeckJobsImport original) {
    +18          jobsImport = new DefaultJobsImport();
    +19          jobsImport.setStream(original.getStream());
    +20          jobsImport.setFileType(original.getFileType());
    +21          jobsImport.setProject(original.getProject());
    +22          jobsImport.setImportMethod(original.getImportMethod());
    +23      }
    +24  
    +25      /**
    +26       * Create a new builder
    +27       * @return
    +28       */
    +29      public static RundeckJobsImportBuilder builder() {
    +30          return new RundeckJobsImportBuilder();
    +31      }
    +32  
    +33      /**
    +34       * Create a builder initialized with an existing {@link RundeckJobsImport}
    +35       * @param original
    +36       * @return
    +37       */
    +38      public static RundeckJobsImportBuilder builder(final RundeckJobsImport original) {
    +39          return new RundeckJobsImportBuilder(original);
    +40      }
    +41  
    +42      public RundeckJobsImportBuilder setProject(final String project) {
    +43          jobsImport.setProject(project);
    +44          return this;
    +45      }
    +46  
    +47      public RundeckJobsImportBuilder setStream(final InputStream stream) {
    +48          jobsImport.setStream(stream);
    +49          return this;
    +50      }
    +51  
    +52      public RundeckJobsImportBuilder setFileType(final FileType filetype) {
    +53          jobsImport.setFileType(filetype);
    +54          return this;
    +55      }
    +56  
    +57      public RundeckJobsImportBuilder setJobsImportMethod(final RundeckJobsImportMethod behavior) {
    +58          jobsImport.setImportMethod(behavior);
    +59          return this;
    +60      }
    +61  
    +62      public RundeckJobsImport build() {
    +63          final RundeckJobsImport built = jobsImport;
    +64          jobsImport = new DefaultJobsImport();
    +65          return built;
    +66      }
    +67  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/domain/package-frame.html b/xref/org/rundeck/api/domain/package-frame.html index 28efeef..330cefd 100644 --- a/xref/org/rundeck/api/domain/package-frame.html +++ b/xref/org/rundeck/api/domain/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.domain + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.domain diff --git a/xref/org/rundeck/api/domain/package-summary.html b/xref/org/rundeck/api/domain/package-summary.html index c86ba77..62d5c24 100644 --- a/xref/org/rundeck/api/domain/package-summary.html +++ b/xref/org/rundeck/api/domain/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.domain + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.domain diff --git a/xref/org/rundeck/api/package-frame.html b/xref/org/rundeck/api/package-frame.html index d31b05f..e1ad5b7 100644 --- a/xref/org/rundeck/api/package-frame.html +++ b/xref/org/rundeck/api/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api @@ -23,6 +23,21 @@
  • BuildsParameters +
  • +
  • + DefaultJobsImport +
  • +
  • + DefaultRunAdhoc +
  • +
  • + DefaultRunAdhocCommand +
  • +
  • + DefaultRunAdhocScript +
  • +
  • + DefaultRunJob
  • ExecutionQueryParameters @@ -38,6 +53,27 @@
  • QueryParameterBuilder +
  • +
  • + RunAdhoc +
  • +
  • + RunAdhocCommand +
  • +
  • + RunAdhocCommandBuilder +
  • +
  • + RunAdhocScript +
  • +
  • + RunAdhocScriptBuilder +
  • +
  • + RunJob +
  • +
  • + RunJobBuilder
  • RundeckApiAuthException @@ -56,6 +92,12 @@
  • RundeckClientBuilder +
  • +
  • + RundeckJobsImport +
  • +
  • + RundeckJobsImportBuilder
  • Version diff --git a/xref/org/rundeck/api/package-summary.html b/xref/org/rundeck/api/package-summary.html index 7a701ae..b37e085 100644 --- a/xref/org/rundeck/api/package-summary.html +++ b/xref/org/rundeck/api/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api @@ -49,6 +49,31 @@
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    BuildsParameters
    + DefaultJobsImport +
    + DefaultRunAdhoc +
    + DefaultRunAdhocCommand +
    + DefaultRunAdhocScript +
    + DefaultRunJob +
    @@ -74,6 +99,41 @@ QueryParameterBuilder
    + RunAdhoc +
    + RunAdhocCommand +
    + RunAdhocCommandBuilder +
    + RunAdhocScript +
    + RunAdhocScriptBuilder +
    + RunJob +
    + RunJobBuilder +
    @@ -104,6 +164,16 @@ RundeckClientBuilder
    + RundeckJobsImport +
    + RundeckJobsImportBuilder +
    diff --git a/xref/org/rundeck/api/parser/package-frame.html b/xref/org/rundeck/api/parser/package-frame.html index 98d9afb..0f193af 100644 --- a/xref/org/rundeck/api/parser/package-frame.html +++ b/xref/org/rundeck/api/parser/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.parser + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.parser diff --git a/xref/org/rundeck/api/parser/package-summary.html b/xref/org/rundeck/api/parser/package-summary.html index 236a984..3a23da1 100644 --- a/xref/org/rundeck/api/parser/package-summary.html +++ b/xref/org/rundeck/api/parser/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.parser + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.parser diff --git a/xref/org/rundeck/api/query/ExecutionQuery.html b/xref/org/rundeck/api/query/ExecutionQuery.html index 0f81615..6ca0be6 100644 --- a/xref/org/rundeck/api/query/ExecutionQuery.html +++ b/xref/org/rundeck/api/query/ExecutionQuery.html @@ -41,7 +41,7 @@ 31 32 33 /** -34 * ExecutionQuery contains the query parameters for the /executions api, create one with the {@link Builder} class, e.g. +34 * ExecutionQuery contains the query parameters for the /executions api, build one with the {@link Builder} class, e.g. 35 * using the {@link #builder()} method. 36 * 37 * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a> diff --git a/xref/org/rundeck/api/query/package-frame.html b/xref/org/rundeck/api/query/package-frame.html index ca5d2b1..4603298 100644 --- a/xref/org/rundeck/api/query/package-frame.html +++ b/xref/org/rundeck/api/query/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.query + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.query diff --git a/xref/org/rundeck/api/query/package-summary.html b/xref/org/rundeck/api/query/package-summary.html index ba1f937..7a619b1 100644 --- a/xref/org/rundeck/api/query/package-summary.html +++ b/xref/org/rundeck/api/query/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.query + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.query diff --git a/xref/org/rundeck/api/util/package-frame.html b/xref/org/rundeck/api/util/package-frame.html index 798e854..a39de6c 100644 --- a/xref/org/rundeck/api/util/package-frame.html +++ b/xref/org/rundeck/api/util/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.util + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.util diff --git a/xref/org/rundeck/api/util/package-summary.html b/xref/org/rundeck/api/util/package-summary.html index cf2fb6b..d2b54d9 100644 --- a/xref/org/rundeck/api/util/package-summary.html +++ b/xref/org/rundeck/api/util/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference Package org.rundeck.api.util + RunDeck API - Java Client 8.0 Reference Package org.rundeck.api.util diff --git a/xref/overview-frame.html b/xref/overview-frame.html index dd074d5..75a8448 100644 --- a/xref/overview-frame.html +++ b/xref/overview-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference + RunDeck API - Java Client 8.0 Reference diff --git a/xref/overview-summary.html b/xref/overview-summary.html index 821dec3..2818225 100644 --- a/xref/overview-summary.html +++ b/xref/overview-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 6.0 Reference + RunDeck API - Java Client 8.0 Reference @@ -24,7 +24,7 @@ -

    RunDeck API - Java Client 6.0 Reference

    +

    RunDeck API - Java Client 8.0 Reference