diff --git a/apidocs/assets/navtree_data.js b/apidocs/assets/navtree_data.js index 585e3e1..67e3610 100644 --- a/apidocs/assets/navtree_data.js +++ b/apidocs/assets/navtree_data.js @@ -5,14 +5,14 @@ var NAVTREE_DATA = , "" ], [ "Exceptions", null, [ [ "RundeckApiException", "org/rundeck/api/RundeckApiException.html", null, "" ], [ "RundeckApiException.RundeckApiAuthException", "org/rundeck/api/RundeckApiException.RundeckApiAuthException.html", null, "" ], [ "RundeckApiException.RundeckApiHttpContentTypeException", "org/rundeck/api/RundeckApiException.RundeckApiHttpContentTypeException.html", null, "" ], [ "RundeckApiException.RundeckApiHttpStatusException", "org/rundeck/api/RundeckApiException.RundeckApiHttpStatusException.html", null, "" ], [ "RundeckApiException.RundeckApiLoginException", "org/rundeck/api/RundeckApiException.RundeckApiLoginException.html", null, "" ], [ "RundeckApiException.RundeckApiTokenException", "org/rundeck/api/RundeckApiException.RundeckApiTokenException.html", null, "" ] ] , "" ] ] , "" ], [ "org.rundeck.api.domain", "org/rundeck/api/domain/package-summary.html", [ [ "Description", "org/rundeck/api/domain/package-descr.html", null, "" ], [ "Interfaces", null, [ [ "KeyResource", "org/rundeck/api/domain/KeyResource.html", null, "" ], [ "RundeckNodeIdentity", "org/rundeck/api/domain/RundeckNodeIdentity.html", null, "" ], [ "StorageResource", "org/rundeck/api/domain/StorageResource.html", null, "" ] ] -, "" ], [ "Classes", null, [ [ "ArchiveImport", "org/rundeck/api/domain/ArchiveImport.html", null, "" ], [ "BaseKeyResource", "org/rundeck/api/domain/BaseKeyResource.html", null, "" ], [ "BaseState", "org/rundeck/api/domain/BaseState.html", null, "" ], [ "BaseStorageResource", "org/rundeck/api/domain/BaseStorageResource.html", null, "" ], [ "ConfigProperty", "org/rundeck/api/domain/ConfigProperty.html", null, "" ], [ "ProjectConfig", "org/rundeck/api/domain/ProjectConfig.html", null, "" ], [ "RundeckAbort", "org/rundeck/api/domain/RundeckAbort.html", null, "" ], [ "RundeckEvent", "org/rundeck/api/domain/RundeckEvent.html", null, "" ], [ "RundeckEvent.NodeSummary", "org/rundeck/api/domain/RundeckEvent.NodeSummary.html", null, "" ], [ "RundeckExecution", "org/rundeck/api/domain/RundeckExecution.html", null, "" ], [ "RundeckExecutionState", "org/rundeck/api/domain/RundeckExecutionState.html", null, "" ], [ "RundeckHistory", "org/rundeck/api/domain/RundeckHistory.html", null, "" ], [ "RundeckJob", "org/rundeck/api/domain/RundeckJob.html", null, "" ], [ "RundeckJobDelete", "org/rundeck/api/domain/RundeckJobDelete.html", null, "" ], [ "RundeckJobDeleteBulk", "org/rundeck/api/domain/RundeckJobDeleteBulk.html", null, "" ], [ "RundeckJobsImportResult", "org/rundeck/api/domain/RundeckJobsImportResult.html", null, "" ], [ "RundeckNode", "org/rundeck/api/domain/RundeckNode.html", null, "" ], [ "RundeckOutput", "org/rundeck/api/domain/RundeckOutput.html", null, "" ], [ "RundeckOutputEntry", "org/rundeck/api/domain/RundeckOutputEntry.html", null, "" ], [ "RundeckProject", "org/rundeck/api/domain/RundeckProject.html", null, "" ], [ "RundeckSystemInfo", "org/rundeck/api/domain/RundeckSystemInfo.html", null, "" ], [ "RundeckToken", "org/rundeck/api/domain/RundeckToken.html", null, "" ], [ "WorkflowState", "org/rundeck/api/domain/WorkflowState.html", null, "" ], [ "WorkflowStepContextState", "org/rundeck/api/domain/WorkflowStepContextState.html", null, "" ], [ "WorkflowStepState", "org/rundeck/api/domain/WorkflowStepState.html", null, "" ] ] +, "" ], [ "Classes", null, [ [ "ArchiveImport", "org/rundeck/api/domain/ArchiveImport.html", null, "" ], [ "BaseKeyResource", "org/rundeck/api/domain/BaseKeyResource.html", null, "" ], [ "BaseState", "org/rundeck/api/domain/BaseState.html", null, "" ], [ "BaseStorageResource", "org/rundeck/api/domain/BaseStorageResource.html", null, "" ], [ "ConfigProperty", "org/rundeck/api/domain/ConfigProperty.html", null, "" ], [ "DeleteExecutionsResponse", "org/rundeck/api/domain/DeleteExecutionsResponse.html", null, "" ], [ "DeleteExecutionsResponse.DeleteFailure", "org/rundeck/api/domain/DeleteExecutionsResponse.DeleteFailure.html", null, "" ], [ "ProjectConfig", "org/rundeck/api/domain/ProjectConfig.html", null, "" ], [ "RundeckAbort", "org/rundeck/api/domain/RundeckAbort.html", null, "" ], [ "RundeckEvent", "org/rundeck/api/domain/RundeckEvent.html", null, "" ], [ "RundeckEvent.NodeSummary", "org/rundeck/api/domain/RundeckEvent.NodeSummary.html", null, "" ], [ "RundeckExecution", "org/rundeck/api/domain/RundeckExecution.html", null, "" ], [ "RundeckExecutionState", "org/rundeck/api/domain/RundeckExecutionState.html", null, "" ], [ "RundeckHistory", "org/rundeck/api/domain/RundeckHistory.html", null, "" ], [ "RundeckJob", "org/rundeck/api/domain/RundeckJob.html", null, "" ], [ "RundeckJobDelete", "org/rundeck/api/domain/RundeckJobDelete.html", null, "" ], [ "RundeckJobDeleteBulk", "org/rundeck/api/domain/RundeckJobDeleteBulk.html", null, "" ], [ "RundeckJobsImportResult", "org/rundeck/api/domain/RundeckJobsImportResult.html", null, "" ], [ "RundeckNode", "org/rundeck/api/domain/RundeckNode.html", null, "" ], [ "RundeckOutput", "org/rundeck/api/domain/RundeckOutput.html", null, "" ], [ "RundeckOutputEntry", "org/rundeck/api/domain/RundeckOutputEntry.html", null, "" ], [ "RundeckProject", "org/rundeck/api/domain/RundeckProject.html", null, "" ], [ "RundeckSystemInfo", "org/rundeck/api/domain/RundeckSystemInfo.html", null, "" ], [ "RundeckToken", "org/rundeck/api/domain/RundeckToken.html", null, "" ], [ "WorkflowState", "org/rundeck/api/domain/WorkflowState.html", null, "" ], [ "WorkflowStepContextState", "org/rundeck/api/domain/WorkflowStepContextState.html", null, "" ], [ "WorkflowStepState", "org/rundeck/api/domain/WorkflowStepState.html", null, "" ] ] , "" ], [ "Enums", null, [ [ "RundeckAbort.AbortStatus", "org/rundeck/api/domain/RundeckAbort.AbortStatus.html", null, "" ], [ "RundeckEvent.EventStatus", "org/rundeck/api/domain/RundeckEvent.EventStatus.html", null, "" ], [ "RundeckExecution.ExecutionStatus", "org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html", null, "" ], [ "RundeckJobsImportMethod", "org/rundeck/api/domain/RundeckJobsImportMethod.html", null, "" ], [ "RundeckJobsUUIDImportBehavior", "org/rundeck/api/domain/RundeckJobsUUIDImportBehavior.html", null, "" ], [ "RundeckOutputEntry.RundeckLogLevel", "org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html", null, "" ], [ "RundeckWFExecState", "org/rundeck/api/domain/RundeckWFExecState.html", null, "" ] ] , "" ] ] , "" ], [ "org.rundeck.api.generator", "org/rundeck/api/generator/package-summary.html", [ [ "Description", "org/rundeck/api/generator/package-descr.html", null, "" ], [ "Interfaces", null, [ [ "XmlDocumentGenerator", "org/rundeck/api/generator/XmlDocumentGenerator.html", null, "" ] ] -, "" ], [ "Classes", null, [ [ "BaseDocGenerator", "org/rundeck/api/generator/BaseDocGenerator.html", null, "" ], [ "ProjectConfigGenerator", "org/rundeck/api/generator/ProjectConfigGenerator.html", null, "" ], [ "ProjectConfigPropertyGenerator", "org/rundeck/api/generator/ProjectConfigPropertyGenerator.html", null, "" ], [ "ProjectGenerator", "org/rundeck/api/generator/ProjectGenerator.html", null, "" ] ] +, "" ], [ "Classes", null, [ [ "BaseDocGenerator", "org/rundeck/api/generator/BaseDocGenerator.html", null, "" ], [ "DeleteExecutionsGenerator", "org/rundeck/api/generator/DeleteExecutionsGenerator.html", null, "" ], [ "ProjectConfigGenerator", "org/rundeck/api/generator/ProjectConfigGenerator.html", null, "" ], [ "ProjectConfigPropertyGenerator", "org/rundeck/api/generator/ProjectConfigPropertyGenerator.html", null, "" ], [ "ProjectGenerator", "org/rundeck/api/generator/ProjectGenerator.html", null, "" ] ] , "" ] ] , "" ], [ "org.rundeck.api.parser", "org/rundeck/api/parser/package-summary.html", [ [ "Description", "org/rundeck/api/parser/package-descr.html", null, "" ], [ "Interfaces", null, [ [ "XmlNodeParser", "org/rundeck/api/parser/XmlNodeParser.html", null, "" ] ] -, "" ], [ "Classes", null, [ [ "AbortParser", "org/rundeck/api/parser/AbortParser.html", null, "" ], [ "ArchiveImportParser", "org/rundeck/api/parser/ArchiveImportParser.html", null, "" ], [ "BaseStateParser", "org/rundeck/api/parser/BaseStateParser.html", null, "" ], [ "BaseXpathParser", "org/rundeck/api/parser/BaseXpathParser.html", null, "" ], [ "BulkDeleteParser", "org/rundeck/api/parser/BulkDeleteParser.html", null, "" ], [ "DeleteParser", "org/rundeck/api/parser/DeleteParser.html", null, "" ], [ "EventParser", "org/rundeck/api/parser/EventParser.html", null, "" ], [ "ExecutionParser", "org/rundeck/api/parser/ExecutionParser.html", null, "" ], [ "ExecutionStateParser", "org/rundeck/api/parser/ExecutionStateParser.html", null, "" ], [ "HistoryParser", "org/rundeck/api/parser/HistoryParser.html", null, "" ], [ "IndexedWorkflowStepStateParser", "org/rundeck/api/parser/IndexedWorkflowStepStateParser.html", null, "" ], [ "JobParser", "org/rundeck/api/parser/JobParser.html", null, "" ], [ "JobsImportResultParser", "org/rundeck/api/parser/JobsImportResultParser.html", null, "" ], [ "ListParser", "org/rundeck/api/parser/ListParser.html", null, "" ], [ "NodeParser", "org/rundeck/api/parser/NodeParser.html", null, "" ], [ "OutputEntryParser", "org/rundeck/api/parser/OutputEntryParser.html", null, "" ], [ "OutputEntryParserV5", "org/rundeck/api/parser/OutputEntryParserV5.html", null, "" ], [ "OutputParser", "org/rundeck/api/parser/OutputParser.html", null, "" ], [ "PagedResultParser", "org/rundeck/api/parser/PagedResultParser.html", null, "" ], [ "ParserHelper", "org/rundeck/api/parser/ParserHelper.html", null, "" ], [ "ProjectConfigParser", "org/rundeck/api/parser/ProjectConfigParser.html", null, "" ], [ "ProjectConfigPropertyParser", "org/rundeck/api/parser/ProjectConfigPropertyParser.html", null, "" ], [ "ProjectParser", "org/rundeck/api/parser/ProjectParser.html", null, "" ], [ "ProjectParserV11", "org/rundeck/api/parser/ProjectParserV11.html", null, "" ], [ "RundeckTokenParser", "org/rundeck/api/parser/RundeckTokenParser.html", null, "" ], [ "SSHKeyResourceParser", "org/rundeck/api/parser/SSHKeyResourceParser.html", null, "" ], [ "StorageResourceParser", "org/rundeck/api/parser/StorageResourceParser.html", null, "" ], [ "StringParser", "org/rundeck/api/parser/StringParser.html", null, "" ], [ "SystemInfoParser", "org/rundeck/api/parser/SystemInfoParser.html", null, "" ], [ "WorkflowStateParser", "org/rundeck/api/parser/WorkflowStateParser.html", null, "" ], [ "WorkflowStepContextStateParser", "org/rundeck/api/parser/WorkflowStepContextStateParser.html", null, "" ], [ "WorkflowStepStateParser", "org/rundeck/api/parser/WorkflowStepStateParser.html", null, "" ] ] +, "" ], [ "Classes", null, [ [ "APIV11Helper", "org/rundeck/api/parser/APIV11Helper.html", null, "" ], [ "AbortParser", "org/rundeck/api/parser/AbortParser.html", null, "" ], [ "ArchiveImportParser", "org/rundeck/api/parser/ArchiveImportParser.html", null, "" ], [ "BaseStateParser", "org/rundeck/api/parser/BaseStateParser.html", null, "" ], [ "BaseXpathParser", "org/rundeck/api/parser/BaseXpathParser.html", null, "" ], [ "BulkDeleteParser", "org/rundeck/api/parser/BulkDeleteParser.html", null, "" ], [ "DeleteExecutionsResponseParser", "org/rundeck/api/parser/DeleteExecutionsResponseParser.html", null, "" ], [ "DeleteParser", "org/rundeck/api/parser/DeleteParser.html", null, "" ], [ "EventParser", "org/rundeck/api/parser/EventParser.html", null, "" ], [ "ExecutionParser", "org/rundeck/api/parser/ExecutionParser.html", null, "" ], [ "ExecutionStateParser", "org/rundeck/api/parser/ExecutionStateParser.html", null, "" ], [ "HistoryParser", "org/rundeck/api/parser/HistoryParser.html", null, "" ], [ "IndexedWorkflowStepStateParser", "org/rundeck/api/parser/IndexedWorkflowStepStateParser.html", null, "" ], [ "JobParser", "org/rundeck/api/parser/JobParser.html", null, "" ], [ "JobsImportResultParser", "org/rundeck/api/parser/JobsImportResultParser.html", null, "" ], [ "ListParser", "org/rundeck/api/parser/ListParser.html", null, "" ], [ "NodeParser", "org/rundeck/api/parser/NodeParser.html", null, "" ], [ "OutputEntryParser", "org/rundeck/api/parser/OutputEntryParser.html", null, "" ], [ "OutputEntryParserV5", "org/rundeck/api/parser/OutputEntryParserV5.html", null, "" ], [ "OutputParser", "org/rundeck/api/parser/OutputParser.html", null, "" ], [ "PagedResultParser", "org/rundeck/api/parser/PagedResultParser.html", null, "" ], [ "ParserHelper", "org/rundeck/api/parser/ParserHelper.html", null, "" ], [ "ProjectConfigParser", "org/rundeck/api/parser/ProjectConfigParser.html", null, "" ], [ "ProjectConfigPropertyParser", "org/rundeck/api/parser/ProjectConfigPropertyParser.html", null, "" ], [ "ProjectParser", "org/rundeck/api/parser/ProjectParser.html", null, "" ], [ "ProjectParserV11", "org/rundeck/api/parser/ProjectParserV11.html", null, "" ], [ "RundeckTokenParser", "org/rundeck/api/parser/RundeckTokenParser.html", null, "" ], [ "SSHKeyResourceParser", "org/rundeck/api/parser/SSHKeyResourceParser.html", null, "" ], [ "StorageResourceParser", "org/rundeck/api/parser/StorageResourceParser.html", null, "" ], [ "StringParser", "org/rundeck/api/parser/StringParser.html", null, "" ], [ "SystemInfoParser", "org/rundeck/api/parser/SystemInfoParser.html", null, "" ], [ "WorkflowStateParser", "org/rundeck/api/parser/WorkflowStateParser.html", null, "" ], [ "WorkflowStepContextStateParser", "org/rundeck/api/parser/WorkflowStepContextStateParser.html", null, "" ], [ "WorkflowStepStateParser", "org/rundeck/api/parser/WorkflowStepStateParser.html", null, "" ] ] , "" ] ] , "" ], [ "org.rundeck.api.query", "org/rundeck/api/query/package-summary.html", [ [ "Description", "org/rundeck/api/query/package-descr.html", null, "" ], [ "Classes", null, [ [ "ExecutionQuery", "org/rundeck/api/query/ExecutionQuery.html", null, "" ], [ "ExecutionQuery.Builder", "org/rundeck/api/query/ExecutionQuery.Builder.html", null, "" ] ] , "" ] ] diff --git a/apidocs/options b/apidocs/options index c575be6..24827bd 100644 --- a/apidocs/options +++ b/apidocs/options @@ -1,7 +1,7 @@ -bootclasspath '/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/classes' -classpath -'/Users/greg/devel/rundeck-api-java-client/target/checkout/target/classes:/Users/greg/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/greg/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar:/Users/greg/.m2/repository/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar:/Users/greg/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/greg/.m2/repository/commons-io/commons-io/2.1/commons-io-2.1.jar:/Users/greg/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar:/Users/greg/.m2/repository/xom/xom/1.0/xom-1.0.jar:/Users/greg/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpmime/4.1.2/httpmime-4.1.2.jar:/Users/greg/.m2/repository/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar:/Users/greg/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar:/Users/greg/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar:/Users/greg/.m2/repository/xalan/xalan/2.6.0/xalan-2.6.0.jar:/Users/greg/.m2/repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar' +'/Users/greg/devel/rundeck-api-java-client/target/checkout/target/classes:/Users/greg/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/greg/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.jar:/Users/greg/.m2/repository/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar:/Users/greg/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/greg/.m2/repository/commons-io/commons-io/2.1/commons-io-2.1.jar:/Users/greg/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar:/Users/greg/.m2/repository/xom/xom/1.0/xom-1.0.jar:/Users/greg/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpmime/4.3.6/httpmime-4.3.6.jar:/Users/greg/.m2/repository/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar:/Users/greg/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar:/Users/greg/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar:/Users/greg/.m2/repository/xalan/xalan/2.6.0/xalan-2.6.0.jar:/Users/greg/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar' -doclet 'com.google.doclava.Doclava' -docletpath diff --git a/apidocs/proof-read.txt b/apidocs/proof-read.txt index 2f85fba..54cd97d 100644 --- a/apidocs/proof-read.txt +++ b/apidocs/proof-read.txt @@ -181,9 +181,15 @@ METHOD: builder Create a builder for RundeckClient METHOD: createProject Create a new project, and return the new definition +METHOD: deleteAllJobExecutions + Delete all executions for a job specified by a job ID METHOD: deleteApiToken Delete an existing token @return +METHOD: deleteExecution + Delete a single execution, identified by the given ID +METHOD: deleteExecutions + Delete a set of executions, identified by the given IDs METHOD: deleteJob Delete a single job, identified by the given ID METHOD: deleteJobs @@ -410,6 +416,7 @@ METHOD: triggerJob Supported version numbers ENUM: V10 ENUM: V11 +ENUM: V12 ENUM: V5 ENUM: V6 ENUM: V7 @@ -1158,6 +1165,29 @@ METHOD: isPrivateKey Return true if this is a file and is a private SSH key file. +=== org/rundeck/api/domain/DeleteExecutionsResponse.html === + DeleteExecutionsResponse is ... +CONSTRUCTOR: DeleteExecutionsResponse +METHOD: getFailedCount +METHOD: getFailures +METHOD: getRequestCount +METHOD: getSuccessCount +METHOD: isAllsuccessful +METHOD: setAllsuccessful +METHOD: setFailedCount +METHOD: setFailures +METHOD: setRequestCount +METHOD: setSuccessCount + + +=== org/rundeck/api/domain/DeleteExecutionsResponse.DeleteFailure.html === +CONSTRUCTOR: DeleteExecutionsResponse.DeleteFailure +METHOD: getExecutionId +METHOD: getMessage +METHOD: setExecutionId +METHOD: setMessage + + === org/rundeck/api/domain/ConfigProperty.html === ConfigProperty is a single configuration property key and value. CONSTRUCTOR: ConfigProperty @@ -1257,6 +1287,14 @@ CONSTRUCTOR: ProjectConfigGenerator METHOD: generateXmlElement +=== org/rundeck/api/generator/DeleteExecutionsGenerator.html === + DeleteExecutionsGenerator is ... +CONSTRUCTOR: DeleteExecutionsGenerator +METHOD: generateXmlElement +METHOD: getExecutionIds +METHOD: setExecutionIds + + === org/rundeck/api/generator/BaseDocGenerator.html === BaseDocGenerator generates a document using the element as the root. CONSTRUCTOR: BaseDocGenerator @@ -1383,6 +1421,7 @@ METHOD: loadDocument PagedResultParser extracts paging data from an xpath node, and includes the List result from a ListParser CONSTRUCTOR: PagedResultParser Create a PagedResultParser +METHOD: getXpath METHOD: parseXmlNode @@ -1486,6 +1525,12 @@ CONSTRUCTOR: DeleteParser METHOD: parseXmlNode +=== org/rundeck/api/parser/DeleteExecutionsResponseParser.html === + DeleteExecutionsResponseParser is ... +CONSTRUCTOR: DeleteExecutionsResponseParser +METHOD: parseXmlNode + + === org/rundeck/api/parser/BulkDeleteParser.html === BulkDeleteParser is ... CONSTRUCTOR: BulkDeleteParser @@ -1516,6 +1561,16 @@ CONSTRUCTOR: ArchiveImportParser METHOD: parseXmlNode +=== org/rundeck/api/parser/APIV11Helper.html === + Utility to handle API v11 responses with <result> wrapper element. +CONSTRUCTOR: APIV11Helper +METHOD: unwrapIfNeeded + Detect and remove extra <result> wrapper around xml response. +METHOD: unwrapResultElement + Test the node for matching the xpath string, if it doesnt match, attempt to prefix it with + "result" and match that. If that matches, return the first child of the 'result' element. + + === org/rundeck/api/parser/AbortParser.html === Parser for a single {@link ... RundeckAbort} diff --git a/apidocs/reference/classes.html b/apidocs/reference/classes.html index 82e35e1..475209c 100644 --- a/apidocs/reference/classes.html +++ b/apidocs/reference/classes.html @@ -233,18 +233,24 @@ + APIV11Helper + Utility to handle API v11 responses with <result> wrapper element.  + + + + ArchiveImport ArchiveImport describes the result of an importArchive(String, java.io.File, boolean, boolean) request.  - + ArchiveImportParser ArchiveImportParser is ...  - + AssertUtil Utility class for assertions  @@ -326,6 +332,30 @@ + + DeleteExecutionsGenerator + DeleteExecutionsGenerator is ...  + + + + + DeleteExecutionsResponse + DeleteExecutionsResponse is ...  + + + + + DeleteExecutionsResponse.DeleteFailure +   + + + + + DeleteExecutionsResponseParser + DeleteExecutionsResponseParser is ...  + + + DeleteParser DeleteParser is ...  diff --git a/apidocs/reference/current.xml b/apidocs/reference/current.xml index 8752806..0f65f9f 100644 --- a/apidocs/reference/current.xml +++ b/apidocs/reference/current.xml @@ -1416,6 +1416,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DeleteExecutionsResponse + + + + + + Serializable +    + +   + + + + + + + + + + + DeleteExecutionsResponse.DeleteFailure + + + + + + Serializable +    + +   + + + + + + @@ -873,6 +913,22 @@ + + + + + DeleteExecutionsGenerator + + + + +   + + + + + + @@ -923,6 +979,22 @@ + + + + + APIV11Helper + + + + +   + + + + + + @@ -1059,6 +1131,26 @@ + + + + + DeleteExecutionsResponseParser + + + + + + XmlNodeParser +    + +   + + + + + + diff --git a/apidocs/reference/lists.js b/apidocs/reference/lists.js index 1c5269f..99ad431 100644 --- a/apidocs/reference/lists.js +++ b/apidocs/reference/lists.js @@ -28,83 +28,88 @@ var DATA = [ { id:26, label:"org.rundeck.api.domain.BaseState", link:"org/rundeck/api/domain/BaseState.html", type:"class" }, { id:27, label:"org.rundeck.api.domain.BaseStorageResource", link:"org/rundeck/api/domain/BaseStorageResource.html", type:"class" }, { id:28, label:"org.rundeck.api.domain.ConfigProperty", link:"org/rundeck/api/domain/ConfigProperty.html", type:"class" }, - { id:29, label:"org.rundeck.api.domain.KeyResource", link:"org/rundeck/api/domain/KeyResource.html", type:"class" }, - { id:30, label:"org.rundeck.api.domain.ProjectConfig", link:"org/rundeck/api/domain/ProjectConfig.html", type:"class" }, - { id:31, label:"org.rundeck.api.domain.RundeckAbort", link:"org/rundeck/api/domain/RundeckAbort.html", type:"class" }, - { id:32, label:"org.rundeck.api.domain.RundeckAbort.AbortStatus", link:"org/rundeck/api/domain/RundeckAbort.AbortStatus.html", type:"class" }, - { id:33, label:"org.rundeck.api.domain.RundeckEvent", link:"org/rundeck/api/domain/RundeckEvent.html", type:"class" }, - { id:34, label:"org.rundeck.api.domain.RundeckEvent.EventStatus", link:"org/rundeck/api/domain/RundeckEvent.EventStatus.html", type:"class" }, - { id:35, label:"org.rundeck.api.domain.RundeckEvent.NodeSummary", link:"org/rundeck/api/domain/RundeckEvent.NodeSummary.html", type:"class" }, - { id:36, label:"org.rundeck.api.domain.RundeckExecution", link:"org/rundeck/api/domain/RundeckExecution.html", type:"class" }, - { id:37, label:"org.rundeck.api.domain.RundeckExecution.ExecutionStatus", link:"org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html", type:"class" }, - { id:38, label:"org.rundeck.api.domain.RundeckExecutionState", link:"org/rundeck/api/domain/RundeckExecutionState.html", type:"class" }, - { id:39, label:"org.rundeck.api.domain.RundeckHistory", link:"org/rundeck/api/domain/RundeckHistory.html", type:"class" }, - { id:40, label:"org.rundeck.api.domain.RundeckJob", link:"org/rundeck/api/domain/RundeckJob.html", type:"class" }, - { id:41, label:"org.rundeck.api.domain.RundeckJobDelete", link:"org/rundeck/api/domain/RundeckJobDelete.html", type:"class" }, - { id:42, label:"org.rundeck.api.domain.RundeckJobDeleteBulk", link:"org/rundeck/api/domain/RundeckJobDeleteBulk.html", type:"class" }, - { id:43, label:"org.rundeck.api.domain.RundeckJobsImportMethod", link:"org/rundeck/api/domain/RundeckJobsImportMethod.html", type:"class" }, - { id:44, label:"org.rundeck.api.domain.RundeckJobsImportResult", link:"org/rundeck/api/domain/RundeckJobsImportResult.html", type:"class" }, - { id:45, label:"org.rundeck.api.domain.RundeckJobsUUIDImportBehavior", link:"org/rundeck/api/domain/RundeckJobsUUIDImportBehavior.html", type:"class" }, - { id:46, label:"org.rundeck.api.domain.RundeckNode", link:"org/rundeck/api/domain/RundeckNode.html", type:"class" }, - { id:47, label:"org.rundeck.api.domain.RundeckNodeIdentity", link:"org/rundeck/api/domain/RundeckNodeIdentity.html", type:"class" }, - { id:48, label:"org.rundeck.api.domain.RundeckOutput", link:"org/rundeck/api/domain/RundeckOutput.html", type:"class" }, - { id:49, label:"org.rundeck.api.domain.RundeckOutputEntry", link:"org/rundeck/api/domain/RundeckOutputEntry.html", type:"class" }, - { id:50, label:"org.rundeck.api.domain.RundeckOutputEntry.RundeckLogLevel", link:"org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html", type:"class" }, - { id:51, label:"org.rundeck.api.domain.RundeckProject", link:"org/rundeck/api/domain/RundeckProject.html", type:"class" }, - { id:52, label:"org.rundeck.api.domain.RundeckSystemInfo", link:"org/rundeck/api/domain/RundeckSystemInfo.html", type:"class" }, - { id:53, label:"org.rundeck.api.domain.RundeckToken", link:"org/rundeck/api/domain/RundeckToken.html", type:"class" }, - { id:54, label:"org.rundeck.api.domain.RundeckWFExecState", link:"org/rundeck/api/domain/RundeckWFExecState.html", type:"class" }, - { id:55, label:"org.rundeck.api.domain.StorageResource", link:"org/rundeck/api/domain/StorageResource.html", type:"class" }, - { id:56, label:"org.rundeck.api.domain.WorkflowState", link:"org/rundeck/api/domain/WorkflowState.html", type:"class" }, - { id:57, label:"org.rundeck.api.domain.WorkflowStepContextState", link:"org/rundeck/api/domain/WorkflowStepContextState.html", type:"class" }, - { id:58, label:"org.rundeck.api.domain.WorkflowStepState", link:"org/rundeck/api/domain/WorkflowStepState.html", type:"class" }, - { id:59, label:"org.rundeck.api.generator", link:"org/rundeck/api/generator/package-summary.html", type:"package" }, - { id:60, label:"org.rundeck.api.generator.BaseDocGenerator", link:"org/rundeck/api/generator/BaseDocGenerator.html", type:"class" }, - { id:61, label:"org.rundeck.api.generator.ProjectConfigGenerator", link:"org/rundeck/api/generator/ProjectConfigGenerator.html", type:"class" }, - { id:62, label:"org.rundeck.api.generator.ProjectConfigPropertyGenerator", link:"org/rundeck/api/generator/ProjectConfigPropertyGenerator.html", type:"class" }, - { id:63, label:"org.rundeck.api.generator.ProjectGenerator", link:"org/rundeck/api/generator/ProjectGenerator.html", type:"class" }, - { id:64, label:"org.rundeck.api.generator.XmlDocumentGenerator", link:"org/rundeck/api/generator/XmlDocumentGenerator.html", type:"class" }, - { id:65, label:"org.rundeck.api.parser", link:"org/rundeck/api/parser/package-summary.html", type:"package" }, - { id:66, label:"org.rundeck.api.parser.AbortParser", link:"org/rundeck/api/parser/AbortParser.html", type:"class" }, - { id:67, label:"org.rundeck.api.parser.ArchiveImportParser", link:"org/rundeck/api/parser/ArchiveImportParser.html", type:"class" }, - { id:68, label:"org.rundeck.api.parser.BaseStateParser", link:"org/rundeck/api/parser/BaseStateParser.html", type:"class" }, - { id:69, label:"org.rundeck.api.parser.BaseXpathParser", link:"org/rundeck/api/parser/BaseXpathParser.html", type:"class" }, - { id:70, label:"org.rundeck.api.parser.BulkDeleteParser", link:"org/rundeck/api/parser/BulkDeleteParser.html", type:"class" }, - { id:71, label:"org.rundeck.api.parser.DeleteParser", link:"org/rundeck/api/parser/DeleteParser.html", type:"class" }, - { id:72, label:"org.rundeck.api.parser.EventParser", link:"org/rundeck/api/parser/EventParser.html", type:"class" }, - { id:73, label:"org.rundeck.api.parser.ExecutionParser", link:"org/rundeck/api/parser/ExecutionParser.html", type:"class" }, - { id:74, label:"org.rundeck.api.parser.ExecutionStateParser", link:"org/rundeck/api/parser/ExecutionStateParser.html", type:"class" }, - { id:75, label:"org.rundeck.api.parser.HistoryParser", link:"org/rundeck/api/parser/HistoryParser.html", type:"class" }, - { id:76, label:"org.rundeck.api.parser.IndexedWorkflowStepStateParser", link:"org/rundeck/api/parser/IndexedWorkflowStepStateParser.html", type:"class" }, - { id:77, label:"org.rundeck.api.parser.JobParser", link:"org/rundeck/api/parser/JobParser.html", type:"class" }, - { id:78, label:"org.rundeck.api.parser.JobsImportResultParser", link:"org/rundeck/api/parser/JobsImportResultParser.html", type:"class" }, - { id:79, label:"org.rundeck.api.parser.ListParser", link:"org/rundeck/api/parser/ListParser.html", type:"class" }, - { id:80, label:"org.rundeck.api.parser.NodeParser", link:"org/rundeck/api/parser/NodeParser.html", type:"class" }, - { id:81, label:"org.rundeck.api.parser.OutputEntryParser", link:"org/rundeck/api/parser/OutputEntryParser.html", type:"class" }, - { id:82, label:"org.rundeck.api.parser.OutputEntryParserV5", link:"org/rundeck/api/parser/OutputEntryParserV5.html", type:"class" }, - { id:83, label:"org.rundeck.api.parser.OutputParser", link:"org/rundeck/api/parser/OutputParser.html", type:"class" }, - { id:84, label:"org.rundeck.api.parser.PagedResultParser", link:"org/rundeck/api/parser/PagedResultParser.html", type:"class" }, - { id:85, label:"org.rundeck.api.parser.ParserHelper", link:"org/rundeck/api/parser/ParserHelper.html", type:"class" }, - { id:86, label:"org.rundeck.api.parser.ProjectConfigParser", link:"org/rundeck/api/parser/ProjectConfigParser.html", type:"class" }, - { id:87, label:"org.rundeck.api.parser.ProjectConfigPropertyParser", link:"org/rundeck/api/parser/ProjectConfigPropertyParser.html", type:"class" }, - { id:88, label:"org.rundeck.api.parser.ProjectParser", link:"org/rundeck/api/parser/ProjectParser.html", type:"class" }, - { id:89, label:"org.rundeck.api.parser.ProjectParserV11", link:"org/rundeck/api/parser/ProjectParserV11.html", type:"class" }, - { id:90, label:"org.rundeck.api.parser.RundeckTokenParser", link:"org/rundeck/api/parser/RundeckTokenParser.html", type:"class" }, - { id:91, label:"org.rundeck.api.parser.SSHKeyResourceParser", link:"org/rundeck/api/parser/SSHKeyResourceParser.html", type:"class" }, - { id:92, label:"org.rundeck.api.parser.StorageResourceParser", link:"org/rundeck/api/parser/StorageResourceParser.html", type:"class" }, - { id:93, label:"org.rundeck.api.parser.StringParser", link:"org/rundeck/api/parser/StringParser.html", type:"class" }, - { id:94, label:"org.rundeck.api.parser.SystemInfoParser", link:"org/rundeck/api/parser/SystemInfoParser.html", type:"class" }, - { id:95, label:"org.rundeck.api.parser.WorkflowStateParser", link:"org/rundeck/api/parser/WorkflowStateParser.html", type:"class" }, - { id:96, label:"org.rundeck.api.parser.WorkflowStepContextStateParser", link:"org/rundeck/api/parser/WorkflowStepContextStateParser.html", type:"class" }, - { id:97, label:"org.rundeck.api.parser.WorkflowStepStateParser", link:"org/rundeck/api/parser/WorkflowStepStateParser.html", type:"class" }, - { id:98, label:"org.rundeck.api.parser.XmlNodeParser", link:"org/rundeck/api/parser/XmlNodeParser.html", type:"class" }, - { id:99, label:"org.rundeck.api.query", link:"org/rundeck/api/query/package-summary.html", type:"package" }, - { id:100, label:"org.rundeck.api.query.ExecutionQuery", link:"org/rundeck/api/query/ExecutionQuery.html", type:"class" }, - { id:101, label:"org.rundeck.api.query.ExecutionQuery.Builder", link:"org/rundeck/api/query/ExecutionQuery.Builder.html", type:"class" }, - { id:102, label:"org.rundeck.api.util", link:"org/rundeck/api/util/package-summary.html", type:"package" }, - { id:103, label:"org.rundeck.api.util.AssertUtil", link:"org/rundeck/api/util/AssertUtil.html", type:"class" }, - { id:104, label:"org.rundeck.api.util.DocumentContentProducer", link:"org/rundeck/api/util/DocumentContentProducer.html", type:"class" }, - { id:105, label:"org.rundeck.api.util.PagedResults", link:"org/rundeck/api/util/PagedResults.html", type:"class" }, - { id:106, label:"org.rundeck.api.util.ParametersUtil", link:"org/rundeck/api/util/ParametersUtil.html", type:"class" } + { id:29, label:"org.rundeck.api.domain.DeleteExecutionsResponse", link:"org/rundeck/api/domain/DeleteExecutionsResponse.html", type:"class" }, + { id:30, label:"org.rundeck.api.domain.DeleteExecutionsResponse.DeleteFailure", link:"org/rundeck/api/domain/DeleteExecutionsResponse.DeleteFailure.html", type:"class" }, + { id:31, label:"org.rundeck.api.domain.KeyResource", link:"org/rundeck/api/domain/KeyResource.html", type:"class" }, + { id:32, label:"org.rundeck.api.domain.ProjectConfig", link:"org/rundeck/api/domain/ProjectConfig.html", type:"class" }, + { id:33, label:"org.rundeck.api.domain.RundeckAbort", link:"org/rundeck/api/domain/RundeckAbort.html", type:"class" }, + { id:34, label:"org.rundeck.api.domain.RundeckAbort.AbortStatus", link:"org/rundeck/api/domain/RundeckAbort.AbortStatus.html", type:"class" }, + { id:35, label:"org.rundeck.api.domain.RundeckEvent", link:"org/rundeck/api/domain/RundeckEvent.html", type:"class" }, + { id:36, label:"org.rundeck.api.domain.RundeckEvent.EventStatus", link:"org/rundeck/api/domain/RundeckEvent.EventStatus.html", type:"class" }, + { id:37, label:"org.rundeck.api.domain.RundeckEvent.NodeSummary", link:"org/rundeck/api/domain/RundeckEvent.NodeSummary.html", type:"class" }, + { id:38, label:"org.rundeck.api.domain.RundeckExecution", link:"org/rundeck/api/domain/RundeckExecution.html", type:"class" }, + { id:39, label:"org.rundeck.api.domain.RundeckExecution.ExecutionStatus", link:"org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html", type:"class" }, + { id:40, label:"org.rundeck.api.domain.RundeckExecutionState", link:"org/rundeck/api/domain/RundeckExecutionState.html", type:"class" }, + { id:41, label:"org.rundeck.api.domain.RundeckHistory", link:"org/rundeck/api/domain/RundeckHistory.html", type:"class" }, + { id:42, label:"org.rundeck.api.domain.RundeckJob", link:"org/rundeck/api/domain/RundeckJob.html", type:"class" }, + { id:43, label:"org.rundeck.api.domain.RundeckJobDelete", link:"org/rundeck/api/domain/RundeckJobDelete.html", type:"class" }, + { id:44, label:"org.rundeck.api.domain.RundeckJobDeleteBulk", link:"org/rundeck/api/domain/RundeckJobDeleteBulk.html", type:"class" }, + { id:45, label:"org.rundeck.api.domain.RundeckJobsImportMethod", link:"org/rundeck/api/domain/RundeckJobsImportMethod.html", type:"class" }, + { id:46, label:"org.rundeck.api.domain.RundeckJobsImportResult", link:"org/rundeck/api/domain/RundeckJobsImportResult.html", type:"class" }, + { id:47, label:"org.rundeck.api.domain.RundeckJobsUUIDImportBehavior", link:"org/rundeck/api/domain/RundeckJobsUUIDImportBehavior.html", type:"class" }, + { id:48, label:"org.rundeck.api.domain.RundeckNode", link:"org/rundeck/api/domain/RundeckNode.html", type:"class" }, + { id:49, label:"org.rundeck.api.domain.RundeckNodeIdentity", link:"org/rundeck/api/domain/RundeckNodeIdentity.html", type:"class" }, + { id:50, label:"org.rundeck.api.domain.RundeckOutput", link:"org/rundeck/api/domain/RundeckOutput.html", type:"class" }, + { id:51, label:"org.rundeck.api.domain.RundeckOutputEntry", link:"org/rundeck/api/domain/RundeckOutputEntry.html", type:"class" }, + { id:52, label:"org.rundeck.api.domain.RundeckOutputEntry.RundeckLogLevel", link:"org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html", type:"class" }, + { id:53, label:"org.rundeck.api.domain.RundeckProject", link:"org/rundeck/api/domain/RundeckProject.html", type:"class" }, + { id:54, label:"org.rundeck.api.domain.RundeckSystemInfo", link:"org/rundeck/api/domain/RundeckSystemInfo.html", type:"class" }, + { id:55, label:"org.rundeck.api.domain.RundeckToken", link:"org/rundeck/api/domain/RundeckToken.html", type:"class" }, + { id:56, label:"org.rundeck.api.domain.RundeckWFExecState", link:"org/rundeck/api/domain/RundeckWFExecState.html", type:"class" }, + { id:57, label:"org.rundeck.api.domain.StorageResource", link:"org/rundeck/api/domain/StorageResource.html", type:"class" }, + { id:58, label:"org.rundeck.api.domain.WorkflowState", link:"org/rundeck/api/domain/WorkflowState.html", type:"class" }, + { id:59, label:"org.rundeck.api.domain.WorkflowStepContextState", link:"org/rundeck/api/domain/WorkflowStepContextState.html", type:"class" }, + { id:60, label:"org.rundeck.api.domain.WorkflowStepState", link:"org/rundeck/api/domain/WorkflowStepState.html", type:"class" }, + { id:61, label:"org.rundeck.api.generator", link:"org/rundeck/api/generator/package-summary.html", type:"package" }, + { id:62, label:"org.rundeck.api.generator.BaseDocGenerator", link:"org/rundeck/api/generator/BaseDocGenerator.html", type:"class" }, + { id:63, label:"org.rundeck.api.generator.DeleteExecutionsGenerator", link:"org/rundeck/api/generator/DeleteExecutionsGenerator.html", type:"class" }, + { id:64, label:"org.rundeck.api.generator.ProjectConfigGenerator", link:"org/rundeck/api/generator/ProjectConfigGenerator.html", type:"class" }, + { id:65, label:"org.rundeck.api.generator.ProjectConfigPropertyGenerator", link:"org/rundeck/api/generator/ProjectConfigPropertyGenerator.html", type:"class" }, + { id:66, label:"org.rundeck.api.generator.ProjectGenerator", link:"org/rundeck/api/generator/ProjectGenerator.html", type:"class" }, + { id:67, label:"org.rundeck.api.generator.XmlDocumentGenerator", link:"org/rundeck/api/generator/XmlDocumentGenerator.html", type:"class" }, + { id:68, label:"org.rundeck.api.parser", link:"org/rundeck/api/parser/package-summary.html", type:"package" }, + { id:69, label:"org.rundeck.api.parser.APIV11Helper", link:"org/rundeck/api/parser/APIV11Helper.html", type:"class" }, + { id:70, label:"org.rundeck.api.parser.AbortParser", link:"org/rundeck/api/parser/AbortParser.html", type:"class" }, + { id:71, label:"org.rundeck.api.parser.ArchiveImportParser", link:"org/rundeck/api/parser/ArchiveImportParser.html", type:"class" }, + { id:72, label:"org.rundeck.api.parser.BaseStateParser", link:"org/rundeck/api/parser/BaseStateParser.html", type:"class" }, + { id:73, label:"org.rundeck.api.parser.BaseXpathParser", link:"org/rundeck/api/parser/BaseXpathParser.html", type:"class" }, + { id:74, label:"org.rundeck.api.parser.BulkDeleteParser", link:"org/rundeck/api/parser/BulkDeleteParser.html", type:"class" }, + { id:75, label:"org.rundeck.api.parser.DeleteExecutionsResponseParser", link:"org/rundeck/api/parser/DeleteExecutionsResponseParser.html", type:"class" }, + { id:76, label:"org.rundeck.api.parser.DeleteParser", link:"org/rundeck/api/parser/DeleteParser.html", type:"class" }, + { id:77, label:"org.rundeck.api.parser.EventParser", link:"org/rundeck/api/parser/EventParser.html", type:"class" }, + { id:78, label:"org.rundeck.api.parser.ExecutionParser", link:"org/rundeck/api/parser/ExecutionParser.html", type:"class" }, + { id:79, label:"org.rundeck.api.parser.ExecutionStateParser", link:"org/rundeck/api/parser/ExecutionStateParser.html", type:"class" }, + { id:80, label:"org.rundeck.api.parser.HistoryParser", link:"org/rundeck/api/parser/HistoryParser.html", type:"class" }, + { id:81, label:"org.rundeck.api.parser.IndexedWorkflowStepStateParser", link:"org/rundeck/api/parser/IndexedWorkflowStepStateParser.html", type:"class" }, + { id:82, label:"org.rundeck.api.parser.JobParser", link:"org/rundeck/api/parser/JobParser.html", type:"class" }, + { id:83, label:"org.rundeck.api.parser.JobsImportResultParser", link:"org/rundeck/api/parser/JobsImportResultParser.html", type:"class" }, + { id:84, label:"org.rundeck.api.parser.ListParser", link:"org/rundeck/api/parser/ListParser.html", type:"class" }, + { id:85, label:"org.rundeck.api.parser.NodeParser", link:"org/rundeck/api/parser/NodeParser.html", type:"class" }, + { id:86, label:"org.rundeck.api.parser.OutputEntryParser", link:"org/rundeck/api/parser/OutputEntryParser.html", type:"class" }, + { id:87, label:"org.rundeck.api.parser.OutputEntryParserV5", link:"org/rundeck/api/parser/OutputEntryParserV5.html", type:"class" }, + { id:88, label:"org.rundeck.api.parser.OutputParser", link:"org/rundeck/api/parser/OutputParser.html", type:"class" }, + { id:89, label:"org.rundeck.api.parser.PagedResultParser", link:"org/rundeck/api/parser/PagedResultParser.html", type:"class" }, + { id:90, label:"org.rundeck.api.parser.ParserHelper", link:"org/rundeck/api/parser/ParserHelper.html", type:"class" }, + { id:91, label:"org.rundeck.api.parser.ProjectConfigParser", link:"org/rundeck/api/parser/ProjectConfigParser.html", type:"class" }, + { id:92, label:"org.rundeck.api.parser.ProjectConfigPropertyParser", link:"org/rundeck/api/parser/ProjectConfigPropertyParser.html", type:"class" }, + { id:93, label:"org.rundeck.api.parser.ProjectParser", link:"org/rundeck/api/parser/ProjectParser.html", type:"class" }, + { id:94, label:"org.rundeck.api.parser.ProjectParserV11", link:"org/rundeck/api/parser/ProjectParserV11.html", type:"class" }, + { id:95, label:"org.rundeck.api.parser.RundeckTokenParser", link:"org/rundeck/api/parser/RundeckTokenParser.html", type:"class" }, + { id:96, label:"org.rundeck.api.parser.SSHKeyResourceParser", link:"org/rundeck/api/parser/SSHKeyResourceParser.html", type:"class" }, + { id:97, label:"org.rundeck.api.parser.StorageResourceParser", link:"org/rundeck/api/parser/StorageResourceParser.html", type:"class" }, + { id:98, label:"org.rundeck.api.parser.StringParser", link:"org/rundeck/api/parser/StringParser.html", type:"class" }, + { id:99, label:"org.rundeck.api.parser.SystemInfoParser", link:"org/rundeck/api/parser/SystemInfoParser.html", type:"class" }, + { id:100, label:"org.rundeck.api.parser.WorkflowStateParser", link:"org/rundeck/api/parser/WorkflowStateParser.html", type:"class" }, + { id:101, label:"org.rundeck.api.parser.WorkflowStepContextStateParser", link:"org/rundeck/api/parser/WorkflowStepContextStateParser.html", type:"class" }, + { id:102, label:"org.rundeck.api.parser.WorkflowStepStateParser", link:"org/rundeck/api/parser/WorkflowStepStateParser.html", type:"class" }, + { id:103, label:"org.rundeck.api.parser.XmlNodeParser", link:"org/rundeck/api/parser/XmlNodeParser.html", type:"class" }, + { id:104, label:"org.rundeck.api.query", link:"org/rundeck/api/query/package-summary.html", type:"package" }, + { id:105, label:"org.rundeck.api.query.ExecutionQuery", link:"org/rundeck/api/query/ExecutionQuery.html", type:"class" }, + { id:106, label:"org.rundeck.api.query.ExecutionQuery.Builder", link:"org/rundeck/api/query/ExecutionQuery.Builder.html", type:"class" }, + { id:107, label:"org.rundeck.api.util", link:"org/rundeck/api/util/package-summary.html", type:"package" }, + { id:108, label:"org.rundeck.api.util.AssertUtil", link:"org/rundeck/api/util/AssertUtil.html", type:"class" }, + { id:109, label:"org.rundeck.api.util.DocumentContentProducer", link:"org/rundeck/api/util/DocumentContentProducer.html", type:"class" }, + { id:110, label:"org.rundeck.api.util.PagedResults", link:"org/rundeck/api/util/PagedResults.html", type:"class" }, + { id:111, label:"org.rundeck.api.util.ParametersUtil", link:"org/rundeck/api/util/ParametersUtil.html", type:"class" } ]; diff --git a/apidocs/reference/org/rundeck/api/RundeckClient.Version.html b/apidocs/reference/org/rundeck/api/RundeckClient.Version.html index d1a2db1..2112328 100644 --- a/apidocs/reference/org/rundeck/api/RundeckClient.Version.html +++ b/apidocs/reference/org/rundeck/api/RundeckClient.Version.html @@ -435,33 +435,40 @@ Summary: RundeckClient.Version  - V5  + V12    + RundeckClient.Version  + V5  +   + + + + RundeckClient.Version  V6    - + RundeckClient.Version  V7    - + RundeckClient.Version  V8    - + RundeckClient.Version  V9    @@ -1076,6 +1083,36 @@ From interface + +
+ +

+ + +
+ + + + + + +
+

+ + public + static + final + RundeckClient.Version + + V12 +

+
+ + + + + +
diff --git a/apidocs/reference/org/rundeck/api/RundeckClient.html b/apidocs/reference/org/rundeck/api/RundeckClient.html index e34622c..d047a2c 100644 --- a/apidocs/reference/org/rundeck/api/RundeckClient.html +++ b/apidocs/reference/org/rundeck/api/RundeckClient.html @@ -670,6 +670,24 @@ Summary: + DeleteExecutionsResponse + + + deleteAllJobExecutions(String jobId) + +
Delete all executions for a job specified by a job ID
+ + + + + + + + + + + + boolean @@ -681,6 +699,24 @@ Summary: + + + + + + + + void + + + deleteExecution(Long executionId) + +
Delete a single execution, identified by the given ID
+ + + + + @@ -688,6 +724,24 @@ Summary: + DeleteExecutionsResponse + + + deleteExecutions(Set<Long> executionIds) + +
Delete a set of executions, identified by the given IDs
+ + + + + + + + + + + + String @@ -699,7 +753,7 @@ Summary: - + @@ -717,7 +771,7 @@ Summary: - + @@ -735,7 +789,7 @@ Summary: - + @@ -753,7 +807,7 @@ Summary: - + @@ -771,7 +825,7 @@ Summary: - + @@ -787,7 +841,7 @@ Summary: - + @@ -805,7 +859,7 @@ Summary: - + @@ -823,7 +877,7 @@ Summary: - + @@ -841,7 +895,7 @@ Summary: - + @@ -859,7 +913,7 @@ Summary: - + @@ -877,7 +931,7 @@ Summary: - + @@ -896,7 +950,7 @@ Summary: - + @@ -914,7 +968,7 @@ Summary: - + @@ -933,7 +987,7 @@ Summary: - + @@ -951,7 +1005,7 @@ Summary: - + @@ -970,7 +1024,7 @@ Summary: - + @@ -988,7 +1042,7 @@ Summary: - + @@ -1007,7 +1061,7 @@ Summary: - + @@ -1025,7 +1079,7 @@ Summary: - + @@ -1043,7 +1097,7 @@ Summary: - + @@ -1061,7 +1115,7 @@ Summary: - + @@ -1079,7 +1133,7 @@ Summary: - + @@ -1097,7 +1151,7 @@ Summary: - + @@ -1115,7 +1169,7 @@ Summary: - + @@ -1133,7 +1187,7 @@ Summary: - + @@ -1151,7 +1205,7 @@ Summary: - + @@ -1169,7 +1223,7 @@ Summary: - + @@ -1187,7 +1241,7 @@ Summary: - + @@ -1205,7 +1259,7 @@ Summary: - + @@ -1223,7 +1277,7 @@ Summary: - + @@ -1241,7 +1295,7 @@ Summary: - + @@ -1259,7 +1313,7 @@ Summary: - + @@ -1277,7 +1331,7 @@ Summary: - + @@ -1295,7 +1349,7 @@ Summary: - + @@ -1313,7 +1367,7 @@ Summary: - + @@ -1331,7 +1385,7 @@ Summary: - + @@ -1349,7 +1403,7 @@ Summary: - + @@ -1367,7 +1421,7 @@ Summary: - + @@ -1385,7 +1439,7 @@ Summary: - + @@ -1403,7 +1457,7 @@ Summary: - + @@ -1421,7 +1475,7 @@ Summary: - + @@ -1439,7 +1493,7 @@ Summary: - + @@ -1457,7 +1511,7 @@ Summary: - + @@ -1475,7 +1529,7 @@ Summary: - + @@ -1498,7 +1552,7 @@ Summary: - + @@ -1521,7 +1575,7 @@ Summary: - + @@ -1539,7 +1593,7 @@ Summary: - + @@ -1557,7 +1611,7 @@ Summary: - + @@ -1575,7 +1629,7 @@ Summary: - + @@ -1593,7 +1647,7 @@ Summary: - + @@ -1611,7 +1665,7 @@ Summary: - + @@ -1629,7 +1683,7 @@ Summary: - + @@ -1647,7 +1701,7 @@ Summary: - + @@ -1665,7 +1719,7 @@ Summary: - + @@ -1683,7 +1737,7 @@ Summary: - + @@ -1699,7 +1753,7 @@ Summary: - + @@ -1717,7 +1771,7 @@ Summary: - + @@ -1735,7 +1789,7 @@ Summary: - + @@ -1753,7 +1807,7 @@ Summary: - + @@ -1771,7 +1825,7 @@ Summary: - + @@ -1789,7 +1843,7 @@ Summary: - + @@ -1805,7 +1859,7 @@ Summary: - + @@ -1823,7 +1877,7 @@ Summary: - + @@ -1841,7 +1895,7 @@ Summary: - + @@ -1859,7 +1913,7 @@ Summary: - + @@ -1877,7 +1931,7 @@ Summary: - + @@ -1895,7 +1949,7 @@ Summary: - + @@ -1913,7 +1967,7 @@ Summary: - + @@ -1931,7 +1985,7 @@ Summary: - + @@ -1949,7 +2003,7 @@ Summary: - + @@ -1967,7 +2021,7 @@ Summary: - + @@ -1983,7 +2037,7 @@ Summary: - + @@ -2001,7 +2055,7 @@ Summary: - + @@ -2017,7 +2071,7 @@ Summary: - + @@ -2033,7 +2087,7 @@ Summary: - + @@ -2049,7 +2103,7 @@ Summary: - + @@ -2067,7 +2121,7 @@ Summary: - + @@ -2085,7 +2139,7 @@ Summary: - + @@ -2103,7 +2157,7 @@ Summary: - + @@ -2121,7 +2175,7 @@ Summary: - + @@ -2139,7 +2193,7 @@ Summary: - + @@ -2157,7 +2211,7 @@ Summary: - + @@ -2175,7 +2229,7 @@ Summary: - + @@ -2193,7 +2247,7 @@ Summary: - + @@ -2211,7 +2265,7 @@ Summary: - + @@ -2229,7 +2283,7 @@ Summary: - + @@ -2247,7 +2301,7 @@ Summary: - + @@ -2265,7 +2319,7 @@ Summary: - + @@ -2283,7 +2337,7 @@ Summary: - + @@ -2301,7 +2355,7 @@ Summary: - + @@ -2319,7 +2373,7 @@ Summary: - + @@ -2337,7 +2391,7 @@ Summary: - + @@ -2355,7 +2409,7 @@ Summary: - + @@ -2373,7 +2427,7 @@ Summary: - + @@ -2391,7 +2445,7 @@ Summary: - + @@ -2412,7 +2466,7 @@ Summary: - + @@ -2428,7 +2482,7 @@ Summary: - + @@ -2446,7 +2500,7 @@ Summary: - + @@ -2464,7 +2518,7 @@ Summary: - + @@ -2483,7 +2537,7 @@ Summary: - + @@ -3385,6 +3439,74 @@ From class
+ + +
+

+ + public + + + + + DeleteExecutionsResponse + + deleteAllJobExecutions + (String jobId) +

+
+
+ +
+ + + +
+
+ +

Delete all executions for a job specified by a job ID

+
+
Parameters
+ + + + +
jobId + Identifier for the job
+
+
+
Returns
+ +
+
+
Throws
+ + + + + + + + + + + + + +
RundeckApiException + in case of error when calling the API (non-existent + execution with this ID)
RundeckApiException.RundeckApiLoginException + if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException + if the token is invalid (in case of token-based + authentication)
IllegalArgumentException + if the executionIds is null +
+
+ +
+
+ +
@@ -3425,6 +3547,134 @@ From class
+ + +
+

+ + public + + + + + void + + deleteExecution + (Long executionId) +

+
+
+ +
+ + + +
+
+ +

Delete a single execution, identified by the given ID

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

+ + public + + + + + DeleteExecutionsResponse + + deleteExecutions + (Set<Long> executionIds) +

+
+
+ +
+ + + +
+
+ +

Delete a set of executions, identified by the given IDs

+
+
Parameters
+ + + + +
executionIds + set of identifiers for the executions - mandatory
+
+
+
Returns
+ +
+
+
Throws
+ + + + + + + + + + + + + +
RundeckApiException + in case of error when calling the API (non-existent execution with this ID)
RundeckApiException.RundeckApiLoginException + if the login fails (in case of login-based authentication)
RundeckApiException.RundeckApiTokenException + if the token is invalid (in case of token-based authentication)
IllegalArgumentException + if the executionIds is null +
+
+ +
+
+ +
diff --git a/apidocs/reference/org/rundeck/api/domain/ArchiveImport.html b/apidocs/reference/org/rundeck/api/domain/ArchiveImport.html index 30124e8..f0c2db0 100644 --- a/apidocs/reference/org/rundeck/api/domain/ArchiveImport.html +++ b/apidocs/reference/org/rundeck/api/domain/ArchiveImport.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/BaseKeyResource.html b/apidocs/reference/org/rundeck/api/domain/BaseKeyResource.html index 66da9c0..605ad08 100644 --- a/apidocs/reference/org/rundeck/api/domain/BaseKeyResource.html +++ b/apidocs/reference/org/rundeck/api/domain/BaseKeyResource.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/BaseState.html b/apidocs/reference/org/rundeck/api/domain/BaseState.html index 9d53962..cce8d4f 100644 --- a/apidocs/reference/org/rundeck/api/domain/BaseState.html +++ b/apidocs/reference/org/rundeck/api/domain/BaseState.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/BaseStorageResource.html b/apidocs/reference/org/rundeck/api/domain/BaseStorageResource.html index d76660a..81acc7d 100644 --- a/apidocs/reference/org/rundeck/api/domain/BaseStorageResource.html +++ b/apidocs/reference/org/rundeck/api/domain/BaseStorageResource.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/ConfigProperty.html b/apidocs/reference/org/rundeck/api/domain/ConfigProperty.html index 9587a19..957d238 100644 --- a/apidocs/reference/org/rundeck/api/domain/ConfigProperty.html +++ b/apidocs/reference/org/rundeck/api/domain/ConfigProperty.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/DeleteExecutionsResponse.DeleteFailure.html b/apidocs/reference/org/rundeck/api/domain/DeleteExecutionsResponse.DeleteFailure.html new file mode 100644 index 0000000..c613fce --- /dev/null +++ b/apidocs/reference/org/rundeck/api/domain/DeleteExecutionsResponse.DeleteFailure.html @@ -0,0 +1,959 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DeleteExecutionsResponse.DeleteFailure + + +| RunDeck API - Java Client + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + + + +
    +
    + + + + +
    + public + static + + + class +

    DeleteExecutionsResponse.DeleteFailure

    + + + + + extends Object
    + + + + + + + implements + + Serializable + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳org.rundeck.api.domain.DeleteExecutionsResponse.DeleteFailure
    + + + + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + +
    + + +

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + DeleteExecutionsResponse.DeleteFailure() + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + + + Long + + getExecutionId() + +
    + + + + + + String + + getMessage() + +
    + + + + + + void + + setExecutionId(Long executionId) + +
    + + + + + + void + + setMessage(String message) + +
    + + + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + DeleteExecutionsResponse.DeleteFailure + () +

    +
    +
    + +
    + + + +
    +
    + +

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

    Public Methods

    + + + + + +
    +

    + + public + + + + + Long + + getExecutionId + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + String + + getMessage + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setExecutionId + (Long executionId) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setMessage + (String message) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + diff --git a/apidocs/reference/org/rundeck/api/domain/DeleteExecutionsResponse.html b/apidocs/reference/org/rundeck/api/domain/DeleteExecutionsResponse.html new file mode 100644 index 0000000..97bf788 --- /dev/null +++ b/apidocs/reference/org/rundeck/api/domain/DeleteExecutionsResponse.html @@ -0,0 +1,1267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DeleteExecutionsResponse + + +| RunDeck API - Java Client + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + +
    + + + + + + +
    +
    + + + + +
    + public + + + + class +

    DeleteExecutionsResponse

    + + + + + extends Object
    + + + + + + + implements + + Serializable + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳org.rundeck.api.domain.DeleteExecutionsResponse
    + + + + + + + +
    + + +

    Class Overview

    +

    DeleteExecutionsResponse is ...

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

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Nested Classes
    + + + + + classDeleteExecutionsResponse.DeleteFailure 
    + + + + + + + + + + +
    Public Constructors
    + + + + + + + + DeleteExecutionsResponse() + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + + + int + + getFailedCount() + +
    + + + + + + List<DeleteExecutionsResponse.DeleteFailure> + + getFailures() + +
    + + + + + + int + + getRequestCount() + +
    + + + + + + int + + getSuccessCount() + +
    + + + + + + boolean + + isAllsuccessful() + +
    + + + + + + void + + setAllsuccessful(boolean allsuccessful) + +
    + + + + + + void + + setFailedCount(int failedCount) + +
    + + + + + + void + + setFailures(List<DeleteExecutionsResponse.DeleteFailure> failures) + +
    + + + + + + void + + setRequestCount(int requestCount) + +
    + + + + + + void + + setSuccessCount(int successCount) + +
    + + + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + DeleteExecutionsResponse + () +

    +
    +
    + +
    + + + +
    +
    + +

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

    Public Methods

    + + + + + +
    +

    + + public + + + + + int + + getFailedCount + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + List<DeleteExecutionsResponse.DeleteFailure> + + getFailures + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + int + + getRequestCount + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + int + + getSuccessCount + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + boolean + + isAllsuccessful + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setAllsuccessful + (boolean allsuccessful) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setFailedCount + (int failedCount) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setFailures + (List<DeleteExecutionsResponse.DeleteFailure> failures) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setRequestCount + (int requestCount) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setSuccessCount + (int successCount) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + diff --git a/apidocs/reference/org/rundeck/api/domain/KeyResource.html b/apidocs/reference/org/rundeck/api/domain/KeyResource.html index bf0a13e..976ad87 100644 --- a/apidocs/reference/org/rundeck/api/domain/KeyResource.html +++ b/apidocs/reference/org/rundeck/api/domain/KeyResource.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/ProjectConfig.html b/apidocs/reference/org/rundeck/api/domain/ProjectConfig.html index da161c2..3024c3a 100644 --- a/apidocs/reference/org/rundeck/api/domain/ProjectConfig.html +++ b/apidocs/reference/org/rundeck/api/domain/ProjectConfig.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckAbort.AbortStatus.html b/apidocs/reference/org/rundeck/api/domain/RundeckAbort.AbortStatus.html index 6b9f79a..31d1dc6 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckAbort.AbortStatus.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckAbort.AbortStatus.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckAbort.html b/apidocs/reference/org/rundeck/api/domain/RundeckAbort.html index 24bfdde..26a3ade 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckAbort.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckAbort.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckEvent.EventStatus.html b/apidocs/reference/org/rundeck/api/domain/RundeckEvent.EventStatus.html index f466d98..53226d0 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckEvent.EventStatus.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckEvent.EventStatus.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckEvent.NodeSummary.html b/apidocs/reference/org/rundeck/api/domain/RundeckEvent.NodeSummary.html index f77e0bf..18d2e93 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckEvent.NodeSummary.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckEvent.NodeSummary.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckEvent.html b/apidocs/reference/org/rundeck/api/domain/RundeckEvent.html index cc611b7..358ad5d 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckEvent.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckEvent.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html b/apidocs/reference/org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html index b18576a..06e3673 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckExecution.ExecutionStatus.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckExecution.html b/apidocs/reference/org/rundeck/api/domain/RundeckExecution.html index f421981..b166840 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckExecution.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckExecution.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckExecutionState.html b/apidocs/reference/org/rundeck/api/domain/RundeckExecutionState.html index 4ae24ae..a525e02 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckExecutionState.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckExecutionState.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckHistory.html b/apidocs/reference/org/rundeck/api/domain/RundeckHistory.html index 256eddf..9f7b2c5 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckHistory.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckHistory.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckJob.html b/apidocs/reference/org/rundeck/api/domain/RundeckJob.html index d403770..ea25d19 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckJob.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckJob.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckJobDelete.html b/apidocs/reference/org/rundeck/api/domain/RundeckJobDelete.html index 2ed9966..b420ac2 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckJobDelete.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckJobDelete.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckJobDeleteBulk.html b/apidocs/reference/org/rundeck/api/domain/RundeckJobDeleteBulk.html index 40079bf..2765f04 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckJobDeleteBulk.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckJobDeleteBulk.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportMethod.html b/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportMethod.html index c5cbd9d..e73483e 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportMethod.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportMethod.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportResult.html b/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportResult.html index 379da60..cf7f10f 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportResult.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckJobsImportResult.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckJobsUUIDImportBehavior.html b/apidocs/reference/org/rundeck/api/domain/RundeckJobsUUIDImportBehavior.html index 2a791a6..41607bb 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckJobsUUIDImportBehavior.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckJobsUUIDImportBehavior.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckNode.html b/apidocs/reference/org/rundeck/api/domain/RundeckNode.html index 6d13960..0e2084a 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckNode.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckNode.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckNodeIdentity.html b/apidocs/reference/org/rundeck/api/domain/RundeckNodeIdentity.html index 9187548..5af3c5d 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckNodeIdentity.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckNodeIdentity.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckOutput.html b/apidocs/reference/org/rundeck/api/domain/RundeckOutput.html index 34279c0..ae13ee6 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckOutput.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckOutput.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html b/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html index 4d9e3f5..0d54694 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.RundeckLogLevel.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.html b/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.html index 69f8465..6fd1f25 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckOutputEntry.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckProject.html b/apidocs/reference/org/rundeck/api/domain/RundeckProject.html index 9461c7b..8e69fdd 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckProject.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckProject.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckSystemInfo.html b/apidocs/reference/org/rundeck/api/domain/RundeckSystemInfo.html index 29e7378..36ffd56 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckSystemInfo.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckSystemInfo.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckToken.html b/apidocs/reference/org/rundeck/api/domain/RundeckToken.html index 6c90338..bcb0bf1 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckToken.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckToken.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/RundeckWFExecState.html b/apidocs/reference/org/rundeck/api/domain/RundeckWFExecState.html index 83baa10..23c6788 100644 --- a/apidocs/reference/org/rundeck/api/domain/RundeckWFExecState.html +++ b/apidocs/reference/org/rundeck/api/domain/RundeckWFExecState.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/StorageResource.html b/apidocs/reference/org/rundeck/api/domain/StorageResource.html index aae1587..ab7ca6b 100644 --- a/apidocs/reference/org/rundeck/api/domain/StorageResource.html +++ b/apidocs/reference/org/rundeck/api/domain/StorageResource.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/WorkflowState.html b/apidocs/reference/org/rundeck/api/domain/WorkflowState.html index 02556b1..6857dce 100644 --- a/apidocs/reference/org/rundeck/api/domain/WorkflowState.html +++ b/apidocs/reference/org/rundeck/api/domain/WorkflowState.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/WorkflowStepContextState.html b/apidocs/reference/org/rundeck/api/domain/WorkflowStepContextState.html index 3c1dd17..f034b17 100644 --- a/apidocs/reference/org/rundeck/api/domain/WorkflowStepContextState.html +++ b/apidocs/reference/org/rundeck/api/domain/WorkflowStepContextState.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/WorkflowStepState.html b/apidocs/reference/org/rundeck/api/domain/WorkflowStepState.html index d89af4f..c370a03 100644 --- a/apidocs/reference/org/rundeck/api/domain/WorkflowStepState.html +++ b/apidocs/reference/org/rundeck/api/domain/WorkflowStepState.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/package-descr.html b/apidocs/reference/org/rundeck/api/domain/package-descr.html index ebd61b3..029a744 100644 --- a/apidocs/reference/org/rundeck/api/domain/package-descr.html +++ b/apidocs/reference/org/rundeck/api/domain/package-descr.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • diff --git a/apidocs/reference/org/rundeck/api/domain/package-summary.html b/apidocs/reference/org/rundeck/api/domain/package-summary.html index 6abfd14..266ca61 100644 --- a/apidocs/reference/org/rundeck/api/domain/package-summary.html +++ b/apidocs/reference/org/rundeck/api/domain/package-summary.html @@ -175,6 +175,8 @@
  • BaseState
  • BaseStorageResource
  • ConfigProperty
  • +
  • DeleteExecutionsResponse
  • +
  • DeleteExecutionsResponse.DeleteFailure
  • ProjectConfig
  • RundeckAbort
  • RundeckEvent
  • @@ -331,6 +333,14 @@ ConfigProperty ConfigProperty is a single configuration property key and value.  + + DeleteExecutionsResponse + DeleteExecutionsResponse is ...  + + + DeleteExecutionsResponse.DeleteFailure +   + ProjectConfig ProjectConfig is ...  diff --git a/apidocs/reference/org/rundeck/api/generator/BaseDocGenerator.html b/apidocs/reference/org/rundeck/api/generator/BaseDocGenerator.html index b15a7fc..1ae0772 100644 --- a/apidocs/reference/org/rundeck/api/generator/BaseDocGenerator.html +++ b/apidocs/reference/org/rundeck/api/generator/BaseDocGenerator.html @@ -169,6 +169,7 @@
  • Classes

    • BaseDocGenerator
    • +
    • DeleteExecutionsGenerator
    • ProjectConfigGenerator
    • ProjectConfigPropertyGenerator
    • ProjectGenerator
    • @@ -337,6 +338,8 @@ Summary: > + DeleteExecutionsGenerator, + ProjectConfigGenerator, ProjectConfigPropertyGenerator, @@ -350,14 +353,18 @@ Summary: > + + + + - + - + diff --git a/apidocs/reference/org/rundeck/api/generator/DeleteExecutionsGenerator.html b/apidocs/reference/org/rundeck/api/generator/DeleteExecutionsGenerator.html new file mode 100644 index 0000000..087396d --- /dev/null +++ b/apidocs/reference/org/rundeck/api/generator/DeleteExecutionsGenerator.html @@ -0,0 +1,1002 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DeleteExecutionsGenerator + + +| RunDeck API - Java Client + + + + + + + + + + + + + + + + + +
      DeleteExecutionsGeneratorDeleteExecutionsGenerator is ... 
      ProjectConfigGenerator ProjectConfigGenerator is ... 
      ProjectConfigPropertyGenerator ProjectConfigPropertyGenerator generates a <property/> element representing a configuration property. 
      ProjectGenerator ProjectGenerator is ... 
      + + + + + + + +
  • +
    + + + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    +
    + + + + +
    + public + + + + class +

    DeleteExecutionsGenerator

    + + + + + + + + + extends BaseDocGenerator
    + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳org.rundeck.api.generator.BaseDocGenerator
        ↳org.rundeck.api.generator.DeleteExecutionsGenerator
    + + + + + + + +
    + + +

    Class Overview

    +

    DeleteExecutionsGenerator is ...

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

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + DeleteExecutionsGenerator(Set<Long> executionIds) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + + + Element + + generateXmlElement() + +
    + + + + + + Set<Long> + + getExecutionIds() + +
    + + + + + + void + + setExecutionIds(Set<Long> executionIds) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + org.rundeck.api.generator.BaseDocGenerator + +
    + + +
    +
    + +From class + + java.lang.Object + +
    + + +
    +
    + +From interface + + org.rundeck.api.generator.XmlDocumentGenerator + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + DeleteExecutionsGenerator + (Set<Long> executionIds) +

    +
    +
    + +
    + + + +
    +
    + +

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

    Public Methods

    + + + + + +
    +

    + + public + + + + + Element + + generateXmlElement + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + Set<Long> + + getExecutionIds + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + setExecutionIds + (Set<Long> executionIds) +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + diff --git a/apidocs/reference/org/rundeck/api/generator/ProjectConfigGenerator.html b/apidocs/reference/org/rundeck/api/generator/ProjectConfigGenerator.html index c5830ed..c7a8da2 100644 --- a/apidocs/reference/org/rundeck/api/generator/ProjectConfigGenerator.html +++ b/apidocs/reference/org/rundeck/api/generator/ProjectConfigGenerator.html @@ -169,6 +169,7 @@
  • Classes

    • BaseDocGenerator
    • +
    • DeleteExecutionsGenerator
    • ProjectConfigGenerator
    • ProjectConfigPropertyGenerator
    • ProjectGenerator
    • diff --git a/apidocs/reference/org/rundeck/api/generator/ProjectConfigPropertyGenerator.html b/apidocs/reference/org/rundeck/api/generator/ProjectConfigPropertyGenerator.html index 94ce70f..3ca5fc6 100644 --- a/apidocs/reference/org/rundeck/api/generator/ProjectConfigPropertyGenerator.html +++ b/apidocs/reference/org/rundeck/api/generator/ProjectConfigPropertyGenerator.html @@ -169,6 +169,7 @@
    • Classes

      • BaseDocGenerator
      • +
      • DeleteExecutionsGenerator
      • ProjectConfigGenerator
      • ProjectConfigPropertyGenerator
      • ProjectGenerator
      • diff --git a/apidocs/reference/org/rundeck/api/generator/ProjectGenerator.html b/apidocs/reference/org/rundeck/api/generator/ProjectGenerator.html index 2fad08a..8a664c2 100644 --- a/apidocs/reference/org/rundeck/api/generator/ProjectGenerator.html +++ b/apidocs/reference/org/rundeck/api/generator/ProjectGenerator.html @@ -169,6 +169,7 @@
      • Classes

        • BaseDocGenerator
        • +
        • DeleteExecutionsGenerator
        • ProjectConfigGenerator
        • ProjectConfigPropertyGenerator
        • ProjectGenerator
        • diff --git a/apidocs/reference/org/rundeck/api/generator/XmlDocumentGenerator.html b/apidocs/reference/org/rundeck/api/generator/XmlDocumentGenerator.html index 2c0e688..5a82e64 100644 --- a/apidocs/reference/org/rundeck/api/generator/XmlDocumentGenerator.html +++ b/apidocs/reference/org/rundeck/api/generator/XmlDocumentGenerator.html @@ -169,6 +169,7 @@
        • Classes

          • BaseDocGenerator
          • +
          • DeleteExecutionsGenerator
          • ProjectConfigGenerator
          • ProjectConfigPropertyGenerator
          • ProjectGenerator
          • @@ -303,6 +304,8 @@ Summary: BaseDocGenerator, + DeleteExecutionsGenerator, + ProjectConfigGenerator, ProjectConfigPropertyGenerator, @@ -320,14 +323,18 @@ Summary: BaseDocGenerator generates a document using the element as the root.  + DeleteExecutionsGenerator + DeleteExecutionsGenerator is ...  + + ProjectConfigGenerator ProjectConfigGenerator is ...  - + ProjectConfigPropertyGenerator ProjectConfigPropertyGenerator generates a <property/> element representing a configuration property.  - + ProjectGenerator ProjectGenerator is ...  diff --git a/apidocs/reference/org/rundeck/api/generator/package-descr.html b/apidocs/reference/org/rundeck/api/generator/package-descr.html index fd58144..79e977e 100644 --- a/apidocs/reference/org/rundeck/api/generator/package-descr.html +++ b/apidocs/reference/org/rundeck/api/generator/package-descr.html @@ -169,6 +169,7 @@
          • Classes

            • BaseDocGenerator
            • +
            • DeleteExecutionsGenerator
            • ProjectConfigGenerator
            • ProjectConfigPropertyGenerator
            • ProjectGenerator
            • diff --git a/apidocs/reference/org/rundeck/api/generator/package-summary.html b/apidocs/reference/org/rundeck/api/generator/package-summary.html index 4626022..a298c8b 100644 --- a/apidocs/reference/org/rundeck/api/generator/package-summary.html +++ b/apidocs/reference/org/rundeck/api/generator/package-summary.html @@ -169,6 +169,7 @@
            • Classes

              • BaseDocGenerator
              • +
              • DeleteExecutionsGenerator
              • ProjectConfigGenerator
              • ProjectConfigPropertyGenerator
              • ProjectGenerator
              • @@ -263,14 +264,18 @@ BaseDocGenerator generates a document using the element as the root.  + DeleteExecutionsGenerator + DeleteExecutionsGenerator is ...  + + ProjectConfigGenerator ProjectConfigGenerator is ...  - + ProjectConfigPropertyGenerator ProjectConfigPropertyGenerator generates a <property/> element representing a configuration property.  - + ProjectGenerator ProjectGenerator is ...  diff --git a/apidocs/reference/org/rundeck/api/parser/APIV11Helper.html b/apidocs/reference/org/rundeck/api/parser/APIV11Helper.html new file mode 100644 index 0000000..2e380a4 --- /dev/null +++ b/apidocs/reference/org/rundeck/api/parser/APIV11Helper.html @@ -0,0 +1,856 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + APIV11Helper + + +| RunDeck API - Java Client + + + + + + + + + + + + + + + + + + + + +
                + + + + + +
                + +
                + + + + + + + + + + + + +
                + + + + + + +
                +
                + + + + +
                + public + + + + class +

                APIV11Helper

                + + + + + extends Object
                + + + + + + + + + +
                + +
                + +
                + + + + + + + + + + + + + + + + + +
                java.lang.Object
                   ↳org.rundeck.api.parser.APIV11Helper
                + + + + + + + +
                + + +

                Class Overview

                +

                Utility to handle API v11 responses with <result> wrapper element.

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

                Summary

                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                Public Constructors
                + + + + + + + + APIV11Helper() + +
                + + + + + + + + + + + + + + + + + + + + + + + + +
                Public Methods
                + + + + static + <T> + XmlNodeParser<T> + + unwrapIfNeeded(XmlNodeParser<T> parser, String xpath) + +
                Detect and remove extra <result> wrapper around xml response.
                + +
                + + + + static + + Node + + unwrapResultElement(Node node, String xpath) + +
                Test the node for matching the xpath string, if it doesnt match, attempt to prefix it with + "result" and match that.
                + +
                + + + + + + + + + + + + + + + +
                + [Expand] +
                Inherited Methods
                + +From class + + java.lang.Object + +
                + + +
                +
                + + +
                + + + + + + + + + + + + + + + + + + + + + + + + + + +

                Public Constructors

                + + + + + +
                +

                + + public + + + + + + + APIV11Helper + () +

                +
                +
                + +
                + + + +
                +
                + +

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

                Public Methods

                + + + + + +
                +

                + + public + static + + + + XmlNodeParser<T> + + unwrapIfNeeded + (XmlNodeParser<T> parser, String xpath) +

                +
                +
                + +
                + + + +
                +
                + +

                Detect and remove extra <result> wrapper around xml response.

                + +
                +
                + + + + +
                +

                + + public + static + + + + Node + + unwrapResultElement + (Node node, String xpath) +

                +
                +
                + +
                + + + +
                +
                + +

                Test the node for matching the xpath string, if it doesnt match, attempt to prefix it with + "result" and match that. If that matches, return the first child of the 'result' element.

                + +
                +
                + + + + + + + + + + + + + + +
                + +
                + +
                + + + + + diff --git a/apidocs/reference/org/rundeck/api/parser/AbortParser.html b/apidocs/reference/org/rundeck/api/parser/AbortParser.html index a4198a4..baec0ca 100644 --- a/apidocs/reference/org/rundeck/api/parser/AbortParser.html +++ b/apidocs/reference/org/rundeck/api/parser/AbortParser.html @@ -168,11 +168,13 @@
              • Classes

                  +
                • APIV11Helper
                • AbortParser
                • ArchiveImportParser
                • BaseStateParser
                • BaseXpathParser<T>
                • BulkDeleteParser
                • +
                • DeleteExecutionsResponseParser
                • DeleteParser
                • EventParser
                • ExecutionParser
                • diff --git a/apidocs/reference/org/rundeck/api/parser/ArchiveImportParser.html b/apidocs/reference/org/rundeck/api/parser/ArchiveImportParser.html index f74142e..5885fdf 100644 --- a/apidocs/reference/org/rundeck/api/parser/ArchiveImportParser.html +++ b/apidocs/reference/org/rundeck/api/parser/ArchiveImportParser.html @@ -168,11 +168,13 @@
                • Classes

                    +
                  • APIV11Helper
                  • AbortParser
                  • ArchiveImportParser
                  • BaseStateParser
                  • BaseXpathParser<T>
                  • BulkDeleteParser
                  • +
                  • DeleteExecutionsResponseParser
                  • DeleteParser
                  • EventParser
                  • ExecutionParser
                  • diff --git a/apidocs/reference/org/rundeck/api/parser/BaseStateParser.html b/apidocs/reference/org/rundeck/api/parser/BaseStateParser.html index 9980341..2a91966 100644 --- a/apidocs/reference/org/rundeck/api/parser/BaseStateParser.html +++ b/apidocs/reference/org/rundeck/api/parser/BaseStateParser.html @@ -168,11 +168,13 @@
                  • Classes

                      +
                    • APIV11Helper
                    • AbortParser
                    • ArchiveImportParser
                    • BaseStateParser
                    • BaseXpathParser<T>
                    • BulkDeleteParser
                    • +
                    • DeleteExecutionsResponseParser
                    • DeleteParser
                    • EventParser
                    • ExecutionParser
                    • diff --git a/apidocs/reference/org/rundeck/api/parser/BaseXpathParser.html b/apidocs/reference/org/rundeck/api/parser/BaseXpathParser.html index e12d32e..919c554 100644 --- a/apidocs/reference/org/rundeck/api/parser/BaseXpathParser.html +++ b/apidocs/reference/org/rundeck/api/parser/BaseXpathParser.html @@ -168,11 +168,13 @@
                    • Classes

                        +
                      • APIV11Helper
                      • AbortParser
                      • ArchiveImportParser
                      • BaseStateParser
                      • BaseXpathParser<T>
                      • BulkDeleteParser
                      • +
                      • DeleteExecutionsResponseParser
                      • DeleteParser
                      • EventParser
                      • ExecutionParser
                      • diff --git a/apidocs/reference/org/rundeck/api/parser/BulkDeleteParser.html b/apidocs/reference/org/rundeck/api/parser/BulkDeleteParser.html index 7be68dd..e137142 100644 --- a/apidocs/reference/org/rundeck/api/parser/BulkDeleteParser.html +++ b/apidocs/reference/org/rundeck/api/parser/BulkDeleteParser.html @@ -168,11 +168,13 @@
                      • Classes

                          +
                        • APIV11Helper
                        • AbortParser
                        • ArchiveImportParser
                        • BaseStateParser
                        • BaseXpathParser<T>
                        • BulkDeleteParser
                        • +
                        • DeleteExecutionsResponseParser
                        • DeleteParser
                        • EventParser
                        • ExecutionParser
                        • diff --git a/apidocs/reference/org/rundeck/api/parser/DeleteExecutionsResponseParser.html b/apidocs/reference/org/rundeck/api/parser/DeleteExecutionsResponseParser.html new file mode 100644 index 0000000..9c43a10 --- /dev/null +++ b/apidocs/reference/org/rundeck/api/parser/DeleteExecutionsResponseParser.html @@ -0,0 +1,866 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DeleteExecutionsResponseParser + + +| RunDeck API - Java Client + + + + + + + + + + + + + + + + + + + + +
                          + + + + + +
                          + +
                          + + + + + + + + + + + + + + + + + + + +
                          + + + + + + +
                          +
                          + + + + +
                          + public + + + + class +

                          DeleteExecutionsResponseParser

                          + + + + + extends Object
                          + + + + + + + implements + + XmlNodeParser<T> + + + + + +
                          + +
                          + +
                          + + + + + + + + + + + + + + + + + +
                          java.lang.Object
                             ↳org.rundeck.api.parser.DeleteExecutionsResponseParser
                          + + + + + + + +
                          + + +

                          Class Overview

                          +

                          DeleteExecutionsResponseParser is ...

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

                          Summary

                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          Public Constructors
                          + + + + + + + + DeleteExecutionsResponseParser(String xpath) + +
                          + + + + + + + + + + + + + + + + + + +
                          Public Methods
                          + + + + + + DeleteExecutionsResponse + + parseXmlNode(Node node) + +
                          Parse the given XML Node
                          + +
                          + + + + + + + + + + + + + + + + + + + + +
                          + [Expand] +
                          Inherited Methods
                          + +From class + + java.lang.Object + +
                          + + +
                          +
                          + +From interface + + org.rundeck.api.parser.XmlNodeParser + +
                          + + +
                          +
                          + + +
                          + + + + + + + + + + + + + + + + + + + + + + + + + + +

                          Public Constructors

                          + + + + + +
                          +

                          + + public + + + + + + + DeleteExecutionsResponseParser + (String xpath) +

                          +
                          +
                          + +
                          + + + +
                          +
                          + +

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

                          Public Methods

                          + + + + + +
                          +

                          + + public + + + + + DeleteExecutionsResponse + + parseXmlNode + (Node node) +

                          +
                          +
                          + +
                          + + + +
                          +
                          + +

                          Parse the given XML Node

                          +
                          +
                          Returns
                          +
                          • any object holding the converted value +
                          +
                          + +
                          +
                          + + + + + + + + + + + + + + +
                          + +
                          + +
                          + + + + + diff --git a/apidocs/reference/org/rundeck/api/parser/DeleteParser.html b/apidocs/reference/org/rundeck/api/parser/DeleteParser.html index 7c22dea..2bcb73e 100644 --- a/apidocs/reference/org/rundeck/api/parser/DeleteParser.html +++ b/apidocs/reference/org/rundeck/api/parser/DeleteParser.html @@ -168,11 +168,13 @@
                        • Classes

                            +
                          • APIV11Helper
                          • AbortParser
                          • ArchiveImportParser
                          • BaseStateParser
                          • BaseXpathParser<T>
                          • BulkDeleteParser
                          • +
                          • DeleteExecutionsResponseParser
                          • DeleteParser
                          • EventParser
                          • ExecutionParser
                          • diff --git a/apidocs/reference/org/rundeck/api/parser/EventParser.html b/apidocs/reference/org/rundeck/api/parser/EventParser.html index 285ac66..6c628d2 100644 --- a/apidocs/reference/org/rundeck/api/parser/EventParser.html +++ b/apidocs/reference/org/rundeck/api/parser/EventParser.html @@ -168,11 +168,13 @@
                          • Classes

                              +
                            • APIV11Helper
                            • AbortParser
                            • ArchiveImportParser
                            • BaseStateParser
                            • BaseXpathParser<T>
                            • BulkDeleteParser
                            • +
                            • DeleteExecutionsResponseParser
                            • DeleteParser
                            • EventParser
                            • ExecutionParser
                            • diff --git a/apidocs/reference/org/rundeck/api/parser/ExecutionParser.html b/apidocs/reference/org/rundeck/api/parser/ExecutionParser.html index bd86b06..02b16fb 100644 --- a/apidocs/reference/org/rundeck/api/parser/ExecutionParser.html +++ b/apidocs/reference/org/rundeck/api/parser/ExecutionParser.html @@ -168,11 +168,13 @@
                            • Classes

                                +
                              • APIV11Helper
                              • AbortParser
                              • ArchiveImportParser
                              • BaseStateParser
                              • BaseXpathParser<T>
                              • BulkDeleteParser
                              • +
                              • DeleteExecutionsResponseParser
                              • DeleteParser
                              • EventParser
                              • ExecutionParser
                              • diff --git a/apidocs/reference/org/rundeck/api/parser/ExecutionStateParser.html b/apidocs/reference/org/rundeck/api/parser/ExecutionStateParser.html index 8d9a6b3..aad3d71 100644 --- a/apidocs/reference/org/rundeck/api/parser/ExecutionStateParser.html +++ b/apidocs/reference/org/rundeck/api/parser/ExecutionStateParser.html @@ -168,11 +168,13 @@
                              • Classes

                                  +
                                • APIV11Helper
                                • AbortParser
                                • ArchiveImportParser
                                • BaseStateParser
                                • BaseXpathParser<T>
                                • BulkDeleteParser
                                • +
                                • DeleteExecutionsResponseParser
                                • DeleteParser
                                • EventParser
                                • ExecutionParser
                                • diff --git a/apidocs/reference/org/rundeck/api/parser/HistoryParser.html b/apidocs/reference/org/rundeck/api/parser/HistoryParser.html index d8dca00..b19361b 100644 --- a/apidocs/reference/org/rundeck/api/parser/HistoryParser.html +++ b/apidocs/reference/org/rundeck/api/parser/HistoryParser.html @@ -168,11 +168,13 @@
                                • Classes

                                    +
                                  • APIV11Helper
                                  • AbortParser
                                  • ArchiveImportParser
                                  • BaseStateParser
                                  • BaseXpathParser<T>
                                  • BulkDeleteParser
                                  • +
                                  • DeleteExecutionsResponseParser
                                  • DeleteParser
                                  • EventParser
                                  • ExecutionParser
                                  • diff --git a/apidocs/reference/org/rundeck/api/parser/IndexedWorkflowStepStateParser.html b/apidocs/reference/org/rundeck/api/parser/IndexedWorkflowStepStateParser.html index 88af134..cc2b204 100644 --- a/apidocs/reference/org/rundeck/api/parser/IndexedWorkflowStepStateParser.html +++ b/apidocs/reference/org/rundeck/api/parser/IndexedWorkflowStepStateParser.html @@ -168,11 +168,13 @@
                                  • Classes

                                      +
                                    • APIV11Helper
                                    • AbortParser
                                    • ArchiveImportParser
                                    • BaseStateParser
                                    • BaseXpathParser<T>
                                    • BulkDeleteParser
                                    • +
                                    • DeleteExecutionsResponseParser
                                    • DeleteParser
                                    • EventParser
                                    • ExecutionParser
                                    • diff --git a/apidocs/reference/org/rundeck/api/parser/JobParser.html b/apidocs/reference/org/rundeck/api/parser/JobParser.html index ff841da..bc15972 100644 --- a/apidocs/reference/org/rundeck/api/parser/JobParser.html +++ b/apidocs/reference/org/rundeck/api/parser/JobParser.html @@ -168,11 +168,13 @@
                                    • Classes

                                        +
                                      • APIV11Helper
                                      • AbortParser
                                      • ArchiveImportParser
                                      • BaseStateParser
                                      • BaseXpathParser<T>
                                      • BulkDeleteParser
                                      • +
                                      • DeleteExecutionsResponseParser
                                      • DeleteParser
                                      • EventParser
                                      • ExecutionParser
                                      • diff --git a/apidocs/reference/org/rundeck/api/parser/JobsImportResultParser.html b/apidocs/reference/org/rundeck/api/parser/JobsImportResultParser.html index a8d65bf..27f2276 100644 --- a/apidocs/reference/org/rundeck/api/parser/JobsImportResultParser.html +++ b/apidocs/reference/org/rundeck/api/parser/JobsImportResultParser.html @@ -168,11 +168,13 @@
                                      • Classes

                                          +
                                        • APIV11Helper
                                        • AbortParser
                                        • ArchiveImportParser
                                        • BaseStateParser
                                        • BaseXpathParser<T>
                                        • BulkDeleteParser
                                        • +
                                        • DeleteExecutionsResponseParser
                                        • DeleteParser
                                        • EventParser
                                        • ExecutionParser
                                        • diff --git a/apidocs/reference/org/rundeck/api/parser/ListParser.html b/apidocs/reference/org/rundeck/api/parser/ListParser.html index 78182bb..8f57630 100644 --- a/apidocs/reference/org/rundeck/api/parser/ListParser.html +++ b/apidocs/reference/org/rundeck/api/parser/ListParser.html @@ -168,11 +168,13 @@
                                        • Classes

                                            +
                                          • APIV11Helper
                                          • AbortParser
                                          • ArchiveImportParser
                                          • BaseStateParser
                                          • BaseXpathParser<T>
                                          • BulkDeleteParser
                                          • +
                                          • DeleteExecutionsResponseParser
                                          • DeleteParser
                                          • EventParser
                                          • ExecutionParser
                                          • diff --git a/apidocs/reference/org/rundeck/api/parser/NodeParser.html b/apidocs/reference/org/rundeck/api/parser/NodeParser.html index 3c1b42f..9904559 100644 --- a/apidocs/reference/org/rundeck/api/parser/NodeParser.html +++ b/apidocs/reference/org/rundeck/api/parser/NodeParser.html @@ -168,11 +168,13 @@
                                          • Classes

                                              +
                                            • APIV11Helper
                                            • AbortParser
                                            • ArchiveImportParser
                                            • BaseStateParser
                                            • BaseXpathParser<T>
                                            • BulkDeleteParser
                                            • +
                                            • DeleteExecutionsResponseParser
                                            • DeleteParser
                                            • EventParser
                                            • ExecutionParser
                                            • diff --git a/apidocs/reference/org/rundeck/api/parser/OutputEntryParser.html b/apidocs/reference/org/rundeck/api/parser/OutputEntryParser.html index b74c818..89ecc35 100644 --- a/apidocs/reference/org/rundeck/api/parser/OutputEntryParser.html +++ b/apidocs/reference/org/rundeck/api/parser/OutputEntryParser.html @@ -168,11 +168,13 @@
                                            • Classes

                                                +
                                              • APIV11Helper
                                              • AbortParser
                                              • ArchiveImportParser
                                              • BaseStateParser
                                              • BaseXpathParser<T>
                                              • BulkDeleteParser
                                              • +
                                              • DeleteExecutionsResponseParser
                                              • DeleteParser
                                              • EventParser
                                              • ExecutionParser
                                              • diff --git a/apidocs/reference/org/rundeck/api/parser/OutputEntryParserV5.html b/apidocs/reference/org/rundeck/api/parser/OutputEntryParserV5.html index dfcd666..fd75683 100644 --- a/apidocs/reference/org/rundeck/api/parser/OutputEntryParserV5.html +++ b/apidocs/reference/org/rundeck/api/parser/OutputEntryParserV5.html @@ -168,11 +168,13 @@
                                              • Classes

                                                  +
                                                • APIV11Helper
                                                • AbortParser
                                                • ArchiveImportParser
                                                • BaseStateParser
                                                • BaseXpathParser<T>
                                                • BulkDeleteParser
                                                • +
                                                • DeleteExecutionsResponseParser
                                                • DeleteParser
                                                • EventParser
                                                • ExecutionParser
                                                • diff --git a/apidocs/reference/org/rundeck/api/parser/OutputParser.html b/apidocs/reference/org/rundeck/api/parser/OutputParser.html index 92ca56a..d6d1a48 100644 --- a/apidocs/reference/org/rundeck/api/parser/OutputParser.html +++ b/apidocs/reference/org/rundeck/api/parser/OutputParser.html @@ -168,11 +168,13 @@
                                                • Classes

                                                  @@ -151,7 +151,7 @@
                                                  -

                                                  Project Dependencies

                                                  compile

                                                  The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

                                                  GroupIdArtifactIdVersionTypeLicense
                                                  commons-iocommons-io2.1jarThe Apache Software License, Version 2.0
                                                  commons-langcommons-lang2.6jarThe Apache Software License, Version 2.0
                                                  dom4jdom4j1.6.1jar-
                                                  jaxenjaxen1.1.1jar-
                                                  org.apache.httpcomponentshttpclient4.1.2jarLICENSE.txt
                                                  org.apache.httpcomponentshttpmime4.1.2jarLICENSE.txt

                                                  test

                                                  The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

                                                  GroupIdArtifactIdVersionTypeLicense
                                                  com.github.robfletcherbetamax1.0jarThe Apache Software License, Version 2.0
                                                  junitjunit4.10jarCommon Public License Version 1.0
                                                  org.codehaus.groovygroovy-all1.8.4jar-

                                                  Project Transitive Dependencies

                                                  The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

                                                  compile

                                                  The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

                                                  GroupIdArtifactIdVersionTypeLicense
                                                  com.ibm.icuicu4j2.6.1jar-
                                                  commons-codeccommons-codec1.4jarThe Apache Software License, Version 2.0
                                                  commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
                                                  jdomjdom1.0jar-
                                                  org.apache.httpcomponentshttpcore4.1.2jarLICENSE.txt
                                                  xalanxalan2.6.0jar-
                                                  xercesxercesImpl2.6.2jar-
                                                  xercesxmlParserAPIs2.6.2jar-
                                                  xml-apisxml-apis1.0.b2jarThe Apache Software License, Version 2.0
                                                  xomxom1.0jarLGPL

                                                  test

                                                  The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

                                                  GroupIdArtifactIdVersionTypeLicense
                                                  javax.servletservlet-api2.5jar-
                                                  log4jlog4j1.2.16jarThe Apache Software License, Version 2.0
                                                  org.eclipse.jettyjetty-continuation7.5.1.v20110908jarApache Software License - Version 2.0-Eclipse Public License - Version 1.0
                                                  org.eclipse.jettyjetty-http7.5.1.v20110908jarApache Software License - Version 2.0-Eclipse Public License - Version 1.0
                                                  org.eclipse.jettyjetty-io7.5.1.v20110908jarApache Software License - Version 2.0-Eclipse Public License - Version 1.0
                                                  org.eclipse.jettyjetty-server7.5.1.v20110908jarApache Software License - Version 2.0-Eclipse Public License - Version 1.0
                                                  org.eclipse.jettyjetty-util7.5.1.v20110908jarApache Software License - Version 2.0-Eclipse Public License - Version 1.0
                                                  org.hamcresthamcrest-core1.1jarBSD style
                                                  org.yamlsnakeyaml1.9jarLICENSE.txt

                                                  Project Dependency Graph

                                                  -

                                                  Dependency Tree

                                                  • org.rundeck:rundeck-api-java-client:jar:11.1 Information
                                                    • org.apache.httpcomponents:httpclient:jar:4.1.2 (compile) Information
                                                      • org.apache.httpcomponents:httpcore:jar:4.1.2 (compile) Information
                                                      • commons-logging:commons-logging:jar:1.1.1 (compile) Information
                                                      • commons-codec:commons-codec:jar:1.4 (compile) Information
                                                    • com.ibm.icu:icu4j:jar:2.6.1 (compile) Information
                                                • junit:junit:jar:4.10 (test) Information
                                                  • org.hamcrest:hamcrest-core:jar:1.1 (test) Information
                                                • com.github.robfletcher:betamax:jar:1.0 (test) Information
                                                • org.codehaus.groovy:groovy-all:jar:1.8.4 (test) Information

                                              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, Unnamed - com.ibm.icu:icu4j:jar:2.6.1, Unnamed - javax.servlet:servlet-api:jar:2.5, Unnamed - jdom:jdom:jar:1.0, Unnamed - xalan:xalan:jar:2.6.0, Unnamed - xerces:xercesImpl:jar:2.6.2, Unnamed - xerces:xmlParserAPIs:jar:2.6.2, dom4j, jaxen

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

                                              Apache License, Version 2.0: Apache HttpClient, Apache HttpClient Mime, Apache HttpCore

                                              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.6.jar227.32 kB2187661.5debug-
                                              commons-io-2.1.jar159.33 kB12210461.5debug-
                                              commons-lang-2.6.jar277.56 kB155133101.3debug-
                                              commons-logging-1.1.3.jar60.60 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.3.6.jar578.13 kB459420241.5debug-
                                              httpcore-4.3.3.jar276.17 kB260232151.5debug-
                                              httpmime-4.3.6.jar36.40 kB392221.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.72 MB11,0249,9054401.5241
                                              compile: 16compile: 8.87 MBcompile: 5,614compile: 4,961compile: 237-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://repository.apache.org/snapshots-Yes-
                                              sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes-
                                              spyhttp://files.couchbase.com/maven2/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-snapshotsspysonatype-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.6----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.3----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.3.6----Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
                                              org.apache.httpcomponents:httpcore:jar:4.3.3----Found at http://repository.sonatype.org/content/groups/sonatype-public-grid/Found at http://repo1.maven.org/maven2
                                              org.apache.httpcomponents:httpmime:jar:4.3.6----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.v20110908----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.v20110908----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.v20110908----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.v20110908----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.v20110908----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-snapshotsspysonatype-public-gridcentral
                                              28 (compile: 16, test: 12)00002828
                                              diff --git a/dependency-updates-report.html b/dependency-updates-report.html index 1c18115..c2681de 100644 --- a/dependency-updates-report.html +++ b/dependency-updates-report.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                                            • - RunDeck + Rundeck
                                            • /
                                            • - RunDeck API - Java Client + Rundeck API - Java Client
                                            • /
                                            • Dependency Updates Report
                                            • -
                                            • Last Published: 2014-11-06
                                            • |
                                            • -
                                            • Version: 11.1
                                            • +
                                            • Last Published: 2014-11-25
                                            • |
                                            • +
                                            • Version: 12.0
                                            @@ -122,15 +122,15 @@ Changes Report
                                          • - Dependency Updates Report -
                                          • -
                                          • Property Updates Report
                                          • Plugin Updates Report
                                          • + Dependency Updates Report +
                                          • +
                                          • PMD Report
                                          • @@ -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 available3
                                            # of dependencies where the next version available is smaller than an incremental version update0
                                            # 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.1compilejar
                                            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 No newer versions available.
                                            Group Iddom4j
                                            Artifact Iddom4j
                                            Current Version1.6.1
                                            Scopecompile
                                            Classifier
                                            Typejar

                                            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
                                            1.1.6 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
                                            4.12-beta-1
                                            4.12-beta-2 Latest 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-atlassian-1
                                            4.2.1-atlassian-2
                                            4.2.1-atlassian-5
                                            4.2.1
                                            4.2.2
                                            4.2.3
                                            4.2.4
                                            4.2.5
                                            4.2.6
                                            4.3-alpha1
                                            4.3-beta1
                                            4.3-beta2
                                            4.3
                                            4.3.1
                                            4.3.2
                                            4.3.3
                                            4.3.4
                                            4.3.5
                                            4.3.6
                                            4.4-alpha1
                                            4.4-beta1 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-atlassian-1
                                            4.2.1-atlassian-2
                                            4.2.1-atlassian-5
                                            4.2.1
                                            4.2.2
                                            4.2.3
                                            4.2.4
                                            4.2.5
                                            4.2.6
                                            4.3-alpha1
                                            4.3-beta1
                                            4.3-beta2
                                            4.3
                                            4.3.1
                                            4.3.2
                                            4.3.3
                                            4.3.4
                                            4.3.5
                                            4.3.6
                                            4.4-alpha1
                                            4.4-beta1 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.1.7
                                            2.1.8
                                            2.1.9
                                            2.2.0-beta-1
                                            2.2.0-beta-2
                                            2.2.0-rc-1
                                            2.2.0-rc-2
                                            2.2.0-rc-3
                                            2.2.0
                                            2.2.1
                                            2.2.2
                                            2.3.0-beta-1
                                            2.3.0-beta-2
                                            2.3.0-rc-1
                                            2.3.0-rc-2
                                            2.3.0-rc-4
                                            2.3.0
                                            2.3.1
                                            2.3.2
                                            2.3.3
                                            2.3.4
                                            2.3.5
                                            2.3.6
                                            2.3.7
                                            2.4.0-beta-1
                                            2.4.0-beta-2
                                            2.4.0-beta-3 Latest Major
                                            +

                                            Overview

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

                                            # of dependencies using the latest version available5
                                            # of dependencies where the next version available is smaller than an incremental version update0
                                            # of dependencies where the next version available is an incremental version update2
                                            # of dependencies where the next version available is a minor version update2
                                            # 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.1compilejar
                                            jaxenjaxen1.1.1compilejar1.1.3
                                            junitjunit4.10testjar4.11
                                            org.apache.httpcomponentshttpclient4.3.6compilejar
                                            org.apache.httpcomponentshttpmime4.3.6compilejar
                                            org.codehaus.groovygroovy-all1.8.4testjar1.8.52.0.0-rc-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 No newer versions available.
                                            Group Iddom4j
                                            Artifact Iddom4j
                                            Current Version1.6.1
                                            Scopecompile
                                            Classifier
                                            Typejar

                                            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
                                            1.1.6 Latest Incremental

                                            junit:junit

                                            Status There is at least one newer minor version available. Minor updates are sometimes passive.
                                            Group Idjunit
                                            Artifact Idjunit
                                            Current Version4.10
                                            Scopetest
                                            Classifier
                                            Typejar
                                            Newer versions4.11 Next Minor

                                            org.apache.httpcomponents:httpclient

                                            Status No newer versions available.
                                            Group Idorg.apache.httpcomponents
                                            Artifact Idhttpclient
                                            Current Version4.3.6
                                            Scopecompile
                                            Classifier
                                            Typejar

                                            org.apache.httpcomponents:httpmime

                                            Status No newer versions available.
                                            Group Idorg.apache.httpcomponents
                                            Artifact Idhttpmime
                                            Current Version4.3.6
                                            Scopecompile
                                            Classifier
                                            Typejar

                                            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 Latest Incremental
                                            2.0.0-rc-1 Next Minor
                                            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-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.1.7
                                            2.1.8
                                            2.1.9
                                            2.2.0-rc-1
                                            2.2.0-rc-2
                                            2.2.0-rc-3
                                            2.2.0
                                            2.2.1
                                            2.2.2
                                            2.3.0-rc-1
                                            2.3.0-rc-2
                                            2.3.0-rc-4
                                            2.3.0
                                            2.3.1
                                            2.3.2
                                            2.3.3
                                            2.3.4
                                            2.3.5
                                            2.3.6
                                            2.3.7 Latest Major
                                            diff --git a/distribution-management.html b/distribution-management.html index 9c26c9f..0cdbabb 100644 --- a/distribution-management.html +++ b/distribution-management.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                                          • - RunDeck + Rundeck
                                          • /
                                          • - RunDeck API - Java Client + Rundeck API - Java Client
                                          • /
                                          • Project Distribution Management
                                          • -
                                          • Last Published: 2014-11-06
                                          • |
                                          • -
                                          • Version: 11.1
                                          • +
                                          • Last Published: 2014-11-25
                                          • |
                                          • +
                                          • Version: 12.0
                                          diff --git a/download.html b/download.html index b741816..1a6495f 100644 --- a/download.html +++ b/download.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                                        • - RunDeck + Rundeck
                                        • /
                                        • - RunDeck API - Java Client + Rundeck API - Java Client
                                        • /
                                        • -
                                        • Last Published: 2014-11-06
                                        • |
                                        • -
                                        • Version: 11.1
                                        • +
                                        • Last Published: 2014-11-25
                                        • |
                                        • +
                                        • Version: 12.0
                                        @@ -119,7 +119,7 @@
                                        -

                                        Download the library

                                        Maven Central Repository

                                        The library is hosted on the Maven Central Repository, with the groupId org.rundeck and the artifactId rundeck-api-java-client.

                                        You can see all versions and download the files with this query : g:"org.rundeck" AND a:"rundeck-api-java-client".

                                        Alternatively, you can download releases or snapshots from Sonatype Nexus OSS instance (which is then synchronized to Maven Central).

                                        Manual download

                                        If you want to use this library from a scripting language, it is often easier to download a single jar file with all dependencies included (named "rundeck-api-java-client-VERSION-jar-with-dependencies.jar")

                                        You can download such files on GitHub : https://github.com/vbehar/rundeck-api-java-client/downloads (for each release)

                                        You can also download the latest version (not yet released) on Jenkins : https://rundeck-api-java-client.ci.cloudbees.com/job/master/lastSuccessfulBuild/artifact/target/

                                        +

                                        Download the library

                                        Maven Central Repository

                                        The library is hosted on the Maven Central Repository, with the groupId org.rundeck and the artifactId rundeck-api-java-client.

                                        You can see all versions and download the files with this query : g:"org.rundeck" AND a:"rundeck-api-java-client".

                                        Alternatively, you can download releases from Sonatype Nexus OSS instance (which is then synchronized to Maven Central).

                                        Manual download

                                        If you want to use this library from a scripting language, it is often easier to download a single jar file with all dependencies included (named "rundeck-api-java-client-VERSION-jar-with-dependencies.jar")

                                        You can download such files on GitHub : https://github.com/rundeck/rundeck-api-java-client/releases (for each release)

                                        diff --git a/faq.html b/faq.html index 2ae7432..355f170 100644 --- a/faq.html +++ b/faq.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                                      • - RunDeck + Rundeck
                                      • /
                                      • - RunDeck API - Java Client + Rundeck API - Java Client
                                      • /
                                      • Frequently Asked Questions
                                      • -
                                      • Last Published: 2014-11-06
                                      • |
                                      • -
                                      • Version: 11.1
                                      • +
                                      • Last Published: 2014-11-25
                                      • |
                                      • +
                                      • Version: 12.0
                                      diff --git a/findbugs.html b/findbugs.html index 98af904..a26529c 100644 --- a/findbugs.html +++ b/findbugs.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                                    • - RunDeck + Rundeck
                                    • /
                                    • - RunDeck API - Java Client + Rundeck API - Java Client
                                    • /
                                    • FindBugs Bug Detector Report
                                    • -
                                    • Last Published: 2014-11-06
                                    • |
                                    • -
                                    • Version: 11.1
                                    • +
                                    • Last Published: 2014-11-25
                                    • |
                                    • +
                                    • Version: 12.0
                                    @@ -120,15 +120,15 @@
                                  • Changes Report -
                                  • -
                                  • - Dependency Updates Report
                                  • Property Updates Report
                                  • Plugin Updates Report +
                                  • +
                                  • + Dependency Updates Report
                                  • PMD Report @@ -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
                                    1211000

                                    org.rundeck.api.domain.BaseState

                                    BugCategoryDetailsLinePriority
                                    org.rundeck.api.domain.BaseState.getEndTime() may expose internal representation by returning BaseState.endTimeMALICIOUS_CODEEI_EXPOSE_REP33Medium
                                    org.rundeck.api.domain.BaseState.getStartTime() may expose internal representation by returning BaseState.startTimeMALICIOUS_CODEEI_EXPOSE_REP21Medium
                                    org.rundeck.api.domain.BaseState.getUpdateTime() may expose internal representation by returning BaseState.updateTimeMALICIOUS_CODEEI_EXPOSE_REP57Medium
                                    org.rundeck.api.domain.BaseState.setEndTime(Date) may expose internal representation by storing an externally mutable object into BaseState.endTimeMALICIOUS_CODEEI_EXPOSE_REP237Medium
                                    org.rundeck.api.domain.BaseState.setStartTime(Date) may expose internal representation by storing an externally mutable object into BaseState.startTimeMALICIOUS_CODEEI_EXPOSE_REP225Medium
                                    org.rundeck.api.domain.BaseState.setUpdateTime(Date) may expose internal representation by storing an externally mutable object into BaseState.updateTimeMALICIOUS_CODEEI_EXPOSE_REP261Medium

                                    org.rundeck.api.domain.RundeckOutputEntry

                                    BugCategoryDetailsLinePriority
                                    org.rundeck.api.domain.RundeckOutputEntry.getAbsoluteTime() may expose internal representation by returning RundeckOutputEntry.absoluteTimeMALICIOUS_CODEEI_EXPOSE_REP180Medium
                                    org.rundeck.api.domain.RundeckOutputEntry.setAbsoluteTime(Date) may expose internal representation by storing an externally mutable object into RundeckOutputEntry.absoluteTimeMALICIOUS_CODEEI_EXPOSE_REP2184Medium

                                    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
                                    1271000

                                    org.rundeck.api.domain.BaseState

                                    BugCategoryDetailsLinePriority
                                    org.rundeck.api.domain.BaseState.getEndTime() may expose internal representation by returning BaseState.endTimeMALICIOUS_CODEEI_EXPOSE_REP33Medium
                                    org.rundeck.api.domain.BaseState.getStartTime() may expose internal representation by returning BaseState.startTimeMALICIOUS_CODEEI_EXPOSE_REP21Medium
                                    org.rundeck.api.domain.BaseState.getUpdateTime() may expose internal representation by returning BaseState.updateTimeMALICIOUS_CODEEI_EXPOSE_REP57Medium
                                    org.rundeck.api.domain.BaseState.setEndTime(Date) may expose internal representation by storing an externally mutable object into BaseState.endTimeMALICIOUS_CODEEI_EXPOSE_REP237Medium
                                    org.rundeck.api.domain.BaseState.setStartTime(Date) may expose internal representation by storing an externally mutable object into BaseState.startTimeMALICIOUS_CODEEI_EXPOSE_REP225Medium
                                    org.rundeck.api.domain.BaseState.setUpdateTime(Date) may expose internal representation by storing an externally mutable object into BaseState.updateTimeMALICIOUS_CODEEI_EXPOSE_REP261Medium

                                    org.rundeck.api.domain.RundeckOutputEntry

                                    BugCategoryDetailsLinePriority
                                    org.rundeck.api.domain.RundeckOutputEntry.getAbsoluteTime() may expose internal representation by returning RundeckOutputEntry.absoluteTimeMALICIOUS_CODEEI_EXPOSE_REP180Medium
                                    org.rundeck.api.domain.RundeckOutputEntry.setAbsoluteTime(Date) may expose internal representation by storing an externally mutable object into RundeckOutputEntry.absoluteTimeMALICIOUS_CODEEI_EXPOSE_REP2184Medium

                                    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 2ea6666..a681c27 100644 --- a/groovy.html +++ b/groovy.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                                  • - RunDeck + Rundeck
                                  • /
                                  • - RunDeck API - Java Client + Rundeck API - Java Client
                                  • /
                                  • -
                                  • Last Published: 2014-11-06
                                  • |
                                  • -
                                  • Version: 11.1
                                  • +
                                  • Last Published: 2014-11-25
                                  • |
                                  • +
                                  • Version: 12.0
                                  @@ -119,33 +119,33 @@
                                  -

                                  Using the RunDeck API from Groovy scripts

                                  Here are some examples of what you can do with this lib and a few lines of Groovy.

                                  We can use Grape to download the lib (and its dependencies) from the Maven Central Repository, so you don't have to install anything manually (except Groovy, of course).

                                  Basic usage

                                  Save the following script in a file named "rundeck.groovy", and execute it with "groovy rundeck.groovy". Feeling Groovy ? ;-)

                                  // we use Grape (Ivy) to download the lib (and its dependencies) from Maven Central Repository
                                  -@Grab(group='org.rundeck', module='rundeck-api-java-client', version='2.0')
                                  +          

                                  Using the Rundeck API from Groovy scripts

                                  Here are some examples of what you can do with this lib and a few lines of Groovy.

                                  We can use Grape to download the lib (and its dependencies) from the Maven Central Repository, so you don't have to install anything manually (except Groovy, of course).

                                  Basic usage

                                  Save the following script in a file named "rundeck.groovy", and execute it with "groovy rundeck.groovy". Feeling Groovy ? ;-)

                                  // we use Grape (Ivy) to download the lib (and its dependencies) from Maven Central Repository
                                  +@Grab(group='org.rundeck', module='rundeck-api-java-client', version='12.0')
                                   import org.rundeck.api.RundeckClient
                                   
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                  -println "RunDeck uptime : ${rundeck.systemInfo.uptime}"
                                  -println "All RunDeck projects : ${rundeck.projects}"
                                  -println "All RunDeck nodes : ${rundeck.nodes}"
                                  -println "All RunDeck jobs : ${rundeck.jobs}"
                                  -println "All RunDeck running executions : ${rundeck.runningExecutions}"
                                  +println "Rundeck uptime : ${rundeck.systemInfo.uptime}"
                                  +println "All Rundeck projects : ${rundeck.projects}"
                                  +println "All Rundeck nodes : ${rundeck.nodes}"
                                  +println "All Rundeck jobs : ${rundeck.jobs}"
                                  +println "All Rundeck running executions : ${rundeck.runningExecutions}"
                                   

                                  You can also download the lib and all its dependencies in 1 big jar file, and add it to your classpath before running your script : save the following script in a file named "rundeck.groovy", and execute it with "groovy -cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.groovy".

                                  import org.rundeck.api.RundeckClient
                                   
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                  -println "RunDeck uptime : ${rundeck.systemInfo.uptime}"
                                  -println "All RunDeck projects : ${rundeck.projects}"
                                  -println "All RunDeck nodes : ${rundeck.nodes}"
                                  -println "All RunDeck jobs : ${rundeck.jobs}"
                                  -println "All RunDeck running executions : ${rundeck.runningExecutions}"
                                  -

                                  Authentication

                                  Starting with RunDeck API 2, there are 2 ways to authenticate :

                                  • the login-based authentication : with your login and password
                                  • the token-based authentication : with a unique token that you can generate from the RunDeck webUI
                                  // using login-based authentication (admin/admin is the default login/password for a new RunDeck instance) :
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin");
                                  +println "Rundeck uptime : ${rundeck.systemInfo.uptime}"
                                  +println "All Rundeck projects : ${rundeck.projects}"
                                  +println "All Rundeck nodes : ${rundeck.nodes}"
                                  +println "All Rundeck jobs : ${rundeck.jobs}"
                                  +println "All Rundeck running executions : ${rundeck.runningExecutions}"
                                  +

                                  Authentication

                                  Starting with Rundeck API 2, there are 2 ways to authenticate :

                                  • the login-based authentication : with your login and password
                                  • the token-based authentication : with a unique token that you can generate from the Rundeck webUI
                                  // using login-based authentication (admin/admin is the default login/password for a new Rundeck instance) :
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                   // using token-based authentication :
                                  -rundeck = new RundeckClient("http://localhost:4440", "PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD");
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").token("PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD").build()
                                   

                                  Running a job

                                  import org.rundeck.api.RundeckClient
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                   // find a job from its name, group and project
                                   job = rundeck.findJob("my-project", "main-group/sub-group", "job-name")
                                  @@ -165,32 +165,32 @@ execution = rundeck.triggerJob("job-id", new Properties(opt: "val
                                   execution = rundeck.runJob("job-id")
                                   println "Execution finished ! Status : ${execution.status}, duration : ${execution.duration}"
                                   

                                  Running an ad-hoc command

                                  import org.rundeck.api.RundeckClient
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                  -// trigger the execution of the "uptime" command on the RunDeck server
                                  +// trigger the execution of the "uptime" command on the Rundeck server
                                   execution = rundeck.triggerAdhocCommand("my-project", "uptime")
                                   
                                   // run the "uptime" command on all unix nodes
                                   execution = rundeck.runAdhocCommand("my-project", "uptime", new Properties(os-family: "unix"))
                                   

                                  Running an ad-hoc script

                                  import org.rundeck.api.RundeckClient
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                  -// trigger the execution of a custom bash script on the RunDeck server
                                  +// trigger the execution of a custom bash script on the Rundeck server
                                   execution = rundeck.triggerAdhocScript("my-project", "/tmp/my-script.sh")
                                   
                                   // run a bash script (with options) on all unix nodes
                                   execution = rundeck.runAdhocCommand("my-project", "/tmp/my-script-with-options.sh", new Properties(option1: "value one"), new Properties(os-family: "unix"))
                                   

                                  Exporting jobs

                                  import org.rundeck.api.RundeckClient
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                   rundeck.exportJobsToFile("/tmp/jobs.xml", "xml", "my-project")
                                   rundeck.exportJobToFile("/tmp/job.yaml", "yaml", "job-id")
                                   

                                  Importing jobs

                                  import org.rundeck.api.RundeckClient
                                  -rundeck = new RundeckClient("http://localhost:4440", "admin", "admin")
                                  +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                                   
                                   result = rundeck.importJobs("/tmp/jobs.xml", "xml")
                                   println "${result.succeededJobs.size} jobs successfully imported, ${result.skippedJobs.size} jobs skipped, and ${result.failedJobs.size} jobs failed"
                                  -

                                  And more...

                                  See the API documentation of the RundeckClient class for more interactions with your RunDeck instance...

                                  +

                                  And more...

                                  See the API documentation of the RundeckClient class for more interactions with your Rundeck instance...

                                  diff --git a/index.html b/index.html index 9e8c014..c6e4d2e 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                                • - RunDeck + Rundeck
                                • /
                                • - RunDeck API - Java Client + Rundeck API - Java Client
                                • /
                                • -
                                • Last Published: 2014-11-06
                                • |
                                • -
                                • Version: 11.1
                                • +
                                • Last Published: 2014-11-25
                                • |
                                • +
                                • Version: 12.0
                                diff --git a/integration.html b/integration.html index ecfa58a..097f3d1 100644 --- a/integration.html +++ b/integration.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                              • - RunDeck + Rundeck
                              • /
                              • - RunDeck API - Java Client + Rundeck API - Java Client
                              • /
                              • Continuous Integration
                              • -
                              • Last Published: 2014-11-06
                              • |
                              • -
                              • Version: 11.1
                              • +
                              • Last Published: 2014-11-25
                              • |
                              • +
                              • Version: 12.0
                              diff --git a/issue-tracking.html b/issue-tracking.html index 984ec81..650849b 100644 --- a/issue-tracking.html +++ b/issue-tracking.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                            • - RunDeck + Rundeck
                            • /
                            • - RunDeck API - Java Client + Rundeck API - Java Client
                            • /
                            • Issue Tracking
                            • -
                            • Last Published: 2014-11-06
                            • |
                            • -
                            • Version: 11.1
                            • +
                            • Last Published: 2014-11-25
                            • |
                            • +
                            • Version: 12.0
                            diff --git a/jruby.html b/jruby.html index c9f24de..f54bdb5 100644 --- a/jruby.html +++ b/jruby.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                          • - RunDeck + Rundeck
                          • /
                          • - RunDeck API - Java Client + Rundeck API - Java Client
                          • /
                          • -
                          • Last Published: 2014-11-06
                          • |
                          • -
                          • Version: 11.1
                          • +
                          • Last Published: 2014-11-25
                          • |
                          • +
                          • Version: 12.0
                          @@ -119,36 +119,36 @@
                          -

                          Using the RunDeck API from JRuby scripts

                          Here are some examples of what you can do with this lib and a few lines of Ruby (for the rubyist that don't fear running on the JVM !)

                          You will have to download the lib (the .jar file) to use it...

                          Basic usage

                          Save the following script in a file named "rundeck.rb", and execute it with "jruby rundeck.rb".

                          require 'java'
                          +          

                          Using the Rundeck API from JRuby scripts

                          Here are some examples of what you can do with this lib and a few lines of Ruby (for the rubyist that don't fear running on the JVM !)

                          You will have to download the lib (the .jar file) to use it...

                          Basic usage

                          Save the following script in a file named "rundeck.rb", and execute it with "jruby rundeck.rb".

                          require 'java'
                           require '/path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar'
                           import org.rundeck.api.RundeckClient
                           
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                          -puts "RunDeck uptime : #{rundeck.systemInfo.uptime}"
                          -puts "All RunDeck projects : #{rundeck.projects}"
                          -puts "All RunDeck nodes : #{rundeck.nodes}"
                          -puts "All RunDeck jobs : #{rundeck.jobs}"
                          -puts "All RunDeck running executions : #{rundeck.runningExecutions}"
                          +puts "Rundeck uptime : #{rundeck.systemInfo.uptime}"
                          +puts "All Rundeck projects : #{rundeck.projects}"
                          +puts "All Rundeck nodes : #{rundeck.nodes}"
                          +puts "All Rundeck jobs : #{rundeck.jobs}"
                          +puts "All Rundeck running executions : #{rundeck.runningExecutions}"
                           

                          You can also add the library to the classpath : save the following script in a file named "rundeck.rb", and execute it with "jruby -rjava -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.rb".

                          import org.rundeck.api.RundeckClient
                           
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                          -puts "RunDeck uptime : #{rundeck.systemInfo.uptime}"
                          -puts "All RunDeck projects : #{rundeck.projects}"
                          -puts "All RunDeck nodes : #{rundeck.nodes}"
                          -puts "All RunDeck jobs : #{rundeck.jobs}"
                          -puts "All RunDeck running executions : #{rundeck.runningExecutions}"
                          -

                          Authentication

                          Starting with RunDeck API 2, there are 2 ways to authenticate :

                          • the login-based authentication : with your login and password
                          • the token-based authentication : with a unique token that you can generate from the RunDeck webUI
                          // using login-based authentication (admin/admin is the default login/password for a new RunDeck instance) :
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin");
                          +puts "Rundeck uptime : #{rundeck.systemInfo.uptime}"
                          +puts "All Rundeck projects : #{rundeck.projects}"
                          +puts "All Rundeck nodes : #{rundeck.nodes}"
                          +puts "All Rundeck jobs : #{rundeck.jobs}"
                          +puts "All Rundeck running executions : #{rundeck.runningExecutions}"
                          +

                          Authentication

                          Starting with Rundeck API 2, there are 2 ways to authenticate :

                          • the login-based authentication : with your login and password
                          • the token-based authentication : with a unique token that you can generate from the Rundeck webUI
                          // using login-based authentication (admin/admin is the default login/password for a new Rundeck instance) :
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                           // using token-based authentication :
                          -rundeck = RundeckClient.new("http://localhost:4440", "PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD");
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").token("PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD").build()
                           

                          Running a job

                          import org.rundeck.api.RundeckClient
                           import org.rundeck.api.OptionsBuilder
                           import org.rundeck.api.NodeFiltersBuilder
                           
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                           // find a job from its name, group and project
                           job = rundeck.findJob("my-project", "main-group/sub-group", "job-name")
                          @@ -170,9 +170,9 @@ puts "Execution finished ! Status : #{execution.status}, duration : #{execu
                           

                          Running an ad-hoc command

                          import org.rundeck.api.RundeckClient
                           import org.rundeck.api.NodeFiltersBuilder
                           
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                          -// trigger the execution of the "uptime" command on the RunDeck server
                          +// trigger the execution of the "uptime" command on the Rundeck server
                           execution = rundeck.triggerAdhocCommand("my-project", "uptime")
                           
                           // run the "uptime" command on all unix nodes
                          @@ -181,24 +181,24 @@ execution = rundeck.runAdhocCommand("my-project", "uptime",
                           import org.rundeck.api.OptionsBuilder
                           import org.rundeck.api.NodeFiltersBuilder
                           
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                          -// trigger the execution of a custom bash script on the RunDeck server
                          +// trigger the execution of a custom bash script on the Rundeck server
                           execution = rundeck.triggerAdhocScript("my-project", "/tmp/my-script.sh")
                           
                           // run a bash script (with options) on all unix nodes
                           execution = rundeck.runAdhocCommand("my-project", "/tmp/my-script-with-options.sh", OptionsBuilder.new().addOption("option1", "value one").toProperties(), NodeFiltersBuilder.new().osFamily("unix").toProperties())
                           

                          Exporting jobs

                          import org.rundeck.api.RundeckClient
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                           rundeck.exportJobsToFile("/tmp/jobs.xml", "xml", "my-project")
                           rundeck.exportJobToFile("/tmp/job.yaml", "yaml", "job-id")
                           

                          Importing jobs

                          import org.rundeck.api.RundeckClient
                          -rundeck = RundeckClient.new("http://localhost:4440", "admin", "admin")
                          +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                           
                           result = rundeck.importJobs("/tmp/jobs.xml", "xml")
                           puts "#{result.succeededJobs.size} jobs successfully imported, #{result.skippedJobs.size} jobs skipped, and #{result.failedJobs.size} jobs failed"
                          -

                          And more...

                          See the API documentation of the RundeckClient class for more interactions with your RunDeck instance...

                          +

                          And more...

                          See the API documentation of the RundeckClient class for more interactions with your Rundeck instance...

                          diff --git a/jython.html b/jython.html index 4492e73..72e7539 100644 --- a/jython.html +++ b/jython.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                        • - RunDeck + Rundeck
                        • /
                        • - RunDeck API - Java Client + Rundeck API - Java Client
                        • /
                        • -
                        • Last Published: 2014-11-06
                        • |
                        • -
                        • Version: 11.1
                        • +
                        • Last Published: 2014-11-25
                        • |
                        • +
                        • Version: 12.0
                        @@ -119,25 +119,25 @@
                        -

                        Using the RunDeck API from Jython scripts

                        Here are some examples of what you can do with this lib and a few lines of Python (for the pythonist that don't fear running on the JVM !)

                        You will have to download the lib (the .jar file) to use it...

                        Basic usage

                        Save the following script in a file named "rundeck.py", and execute it with "jython -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.py".

                        from org.rundeck.api import RundeckClient
                        +          

                        Using the Rundeck API from Jython scripts

                        Here are some examples of what you can do with this lib and a few lines of Python (for the pythonist that don't fear running on the JVM !)

                        You will have to download the lib (the .jar file) to use it...

                        Basic usage

                        Save the following script in a file named "rundeck.py", and execute it with "jython -J-cp /path/to/rundeck-api-java-client-VERSION-jar-with-dependencies.jar rundeck.py".

                        from org.rundeck.api import RundeckClient
                         
                        -rundeck = RundeckClient("http://localhost:4440", "admin", "admin")
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                         
                        -print("RunDeck uptime : %s" % rundeck.systemInfo.uptime)
                        -print("All RunDeck projects : %s" % rundeck.projects)
                        -print("All RunDeck nodes : %s" % rundeck.nodes)
                        -print("All RunDeck jobs : %s" % rundeck.jobs)
                        -print("All RunDeck running executions : %s" % rundeck.runningExecutions)
                        -

                        Authentication

                        Starting with RunDeck API 2, there are 2 ways to authenticate :

                        • the login-based authentication : with your login and password
                        • the token-based authentication : with a unique token that you can generate from the RunDeck webUI
                        // using login-based authentication (admin/admin is the default login/password for a new RunDeck instance) :
                        -rundeck = RundeckClient("http://localhost:4440", "admin", "admin");
                        +print("Rundeck uptime : %s" % rundeck.systemInfo.uptime)
                        +print("All Rundeck projects : %s" % rundeck.projects)
                        +print("All Rundeck nodes : %s" % rundeck.nodes)
                        +print("All Rundeck jobs : %s" % rundeck.jobs)
                        +print("All Rundeck running executions : %s" % rundeck.runningExecutions)
                        +

                        Authentication

                        Starting with Rundeck API 2, there are 2 ways to authenticate :

                        • the login-based authentication : with your login and password
                        • the token-based authentication : with a unique token that you can generate from the Rundeck webUI
                        // using login-based authentication (admin/admin is the default login/password for a new Rundeck instance) :
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                         
                         // using token-based authentication :
                        -rundeck = RundeckClient("http://localhost:4440", "PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD");
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").token("PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD").build()
                         

                        Running a job

                        from org.rundeck.api import RundeckClient
                         from org.rundeck.api import OptionsBuilder
                         from org.rundeck.api import NodeFiltersBuilder
                         
                        -rundeck = RundeckClient("http://localhost:4440", "admin", "admin")
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                         
                         // find a job from its name, group and project
                         job = rundeck.findJob("my-project", "main-group/sub-group", "job-name")
                        @@ -159,9 +159,9 @@ print("Execution finished ! Status : %s, duration : %s" % (execution.s
                         

                        Running an ad-hoc command

                        from org.rundeck.api import RundeckClient
                         from org.rundeck.api import NodeFiltersBuilder
                         
                        -rundeck = RundeckClient("http://localhost:4440", "admin", "admin")
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                         
                        -// trigger the execution of the "uptime" command on the RunDeck server
                        +// trigger the execution of the "uptime" command on the Rundeck server
                         execution = rundeck.triggerAdhocCommand("my-project", "uptime")
                         
                         // run the "uptime" command on all unix nodes
                        @@ -170,24 +170,24 @@ execution = rundeck.runAdhocCommand("my-project", "uptime",
                         from org.rundeck.api import OptionsBuilder
                         from org.rundeck.api import NodeFiltersBuilder
                         
                        -rundeck = RundeckClient("http://localhost:4440", "admin", "admin")
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                         
                        -// trigger the execution of a custom bash script on the RunDeck server
                        +// trigger the execution of a custom bash script on the Rundeck server
                         execution = rundeck.triggerAdhocScript("my-project", "/tmp/my-script.sh")
                         
                         // run a bash script (with options) on all unix nodes
                         execution = rundeck.runAdhocCommand("my-project", "/tmp/my-script-with-options.sh", OptionsBuilder().addOption("option1", "value one").toProperties(), NodeFiltersBuilder().osFamily("unix").toProperties())
                         

                        Exporting jobs

                        from org.rundeck.api import RundeckClient
                        -rundeck = RundeckClient("http://localhost:4440", "admin", "admin")
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                         
                         rundeck.exportJobsToFile("/tmp/jobs.xml", "xml", "my-project")
                         rundeck.exportJobToFile("/tmp/job.yaml", "yaml", "job-id")
                         

                        Importing jobs

                        from org.rundeck.api import RundeckClient
                        -rundeck = RundeckClient("http://localhost:4440", "admin", "admin")
                        +rundeck = RundeckClient.builder().url("http://localhost:4440").login("admin", "admin").build()
                         
                         result = rundeck.importJobs("/tmp/jobs.xml", "xml")
                         print("%s jobs successfully imported, %s jobs skipped, and %s jobs failed" % (result.succeededJobs.size, result.skippedJobs.size, result.failedJobs.size))
                        -

                        And more...

                        See the API documentation of the RundeckClient class for more interactions with your RunDeck instance...

                        +

                        And more...

                        See the API documentation of the RundeckClient class for more interactions with your Rundeck instance...

                        diff --git a/license.html b/license.html index d12b212..b66ff75 100644 --- a/license.html +++ b/license.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                      • - RunDeck + Rundeck
                      • /
                      • - RunDeck API - Java Client + Rundeck API - Java Client
                      • /
                      • Project License
                      • -
                      • Last Published: 2014-11-06
                      • |
                      • -
                      • Version: 11.1
                      • +
                      • Last Published: 2014-11-25
                      • |
                      • +
                      • Version: 12.0
                      diff --git a/mail-lists.html b/mail-lists.html index a2567ab..6310cbe 100644 --- a/mail-lists.html +++ b/mail-lists.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                    • - RunDeck + Rundeck
                    • /
                    • - RunDeck API - Java Client + Rundeck API - Java Client
                    • /
                    • Project Mailing Lists
                    • -
                    • Last Published: 2014-11-06
                    • |
                    • -
                    • Version: 11.1
                    • +
                    • Last Published: 2014-11-25
                    • |
                    • +
                    • Version: 12.0
                    diff --git a/plugin-updates-report.html b/plugin-updates-report.html index aa80fbb..d4039fa 100644 --- a/plugin-updates-report.html +++ b/plugin-updates-report.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                  • - RunDeck + Rundeck
                  • /
                  • - RunDeck API - Java Client + Rundeck API - Java Client
                  • /
                  • Plugin Updates Report
                  • -
                  • Last Published: 2014-11-06
                  • |
                  • -
                  • Version: 11.1
                  • +
                  • Last Published: 2014-11-25
                  • |
                  • +
                  • Version: 12.0
                  @@ -120,9 +120,6 @@
                • Changes Report -
                • -
                • - Dependency Updates Report
                • Property Updates Report @@ -130,6 +127,9 @@
                • Plugin Updates Report
                • +
                • + Dependency Updates Report +
                • PMD Report
                • @@ -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 available5
                  # of plugins where the next version available is smaller than an incremental version update1
                  # of plugins where the next version available is an incremental version update4
                  # of plugins where the next version available is a minor version update21
                  # 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-ear-plugin2.3.12.3.22.4
                  org.apache.maven.pluginsmaven-eclipse-plugin2.82.9
                  org.apache.maven.pluginsmaven-ejb-plugin2.12.2
                  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-plugin-plugin2.4.32.53.0
                  org.apache.maven.pluginsmaven-pmd-plugin2.62.73.0
                  org.apache.maven.pluginsmaven-rar-plugin2.22.3
                  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.apache.maven.pluginsmaven-war-plugin2.1-alpha-22.1-beta-12.1.12.2
                  org.codehaus.mojofindbugs-maven-plugin2.3.22.3.32.4.0
                  StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status

                  Plugins

                  StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status
                  org.apache.maven.pluginsmaven-changes-plugin2.62.7
                  org.apache.maven.pluginsmaven-jxr-plugin2.3
                  org.apache.maven.pluginsmaven-project-info-reports-plugin2.42.5
                  org.codehaus.mojotaglist-maven-plugin2.4
                  org.codehaus.mojoversions-maven-plugin1.21.32.0
                  StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status

                  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-changes-plugin

                  Status There is at least one newer minor version available. Minor updates are sometimes passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-changes-plugin
                  Current Version2.6
                  Newer versions2.7 Next Minor
                  2.7.1
                  2.8
                  2.9 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-ear-plugin

                  Status There is at least one newer incremental version available. Incremental updates are typically passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-ear-plugin
                  Current Version2.3.1
                  Newer versions2.3.2 Next Incremental
                  2.4 Next Minor
                  2.4.1
                  2.4.2
                  2.5
                  2.6
                  2.7
                  2.8
                  2.9 Latest Minor

                  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-ejb-plugin

                  Status There is at least one newer minor version available. Minor updates are sometimes passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-ejb-plugin
                  Current Version2.1
                  Newer versions2.2 Next Minor
                  2.2.1
                  2.3 Latest 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-jxr-plugin

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

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

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

                  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-project-info-reports-plugin

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

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

                  Status There is at least one newer minor version available. Minor updates are sometimes passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-rar-plugin
                  Current Version2.2
                  Newer versions2.3 Next 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
                  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.apache.maven.plugins:maven-war-plugin

                  Status There is at least one newer version available.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-war-plugin
                  Current Version2.1-alpha-2
                  Newer versions2.1-beta-1 Next Version
                  2.1
                  2.1.1 Next Incremental
                  2.2 Next Minor
                  2.3
                  2.4 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

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

                  Status No newer versions available.
                  Group Idorg.codehaus.mojo
                  Artifact Idtaglist-maven-plugin
                  Current Version2.4

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

                  Status There is at least one newer minor version available. Minor updates are sometimes passive.
                  Group Idorg.codehaus.mojo
                  Artifact Idversions-maven-plugin
                  Current Version1.2
                  Newer versions1.3 Next Minor
                  1.3.1 Latest Minor
                  2.0 Next Major
                  2.1 Latest Major
                  +

                  Overview

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

                  # of plugins using the latest version available6
                  # of plugins where the next version available is smaller than an incremental version update1
                  # of plugins where the next version available is an incremental version update4
                  # of plugins where the next version available is a minor version update20
                  # 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-ear-plugin2.3.12.3.22.4
                  org.apache.maven.pluginsmaven-eclipse-plugin2.82.9
                  org.apache.maven.pluginsmaven-ejb-plugin2.12.2
                  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-plugin-plugin2.4.32.53.0
                  org.apache.maven.pluginsmaven-pmd-plugin2.62.73.0
                  org.apache.maven.pluginsmaven-rar-plugin2.22.3
                  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.apache.maven.pluginsmaven-war-plugin2.1-alpha-22.12.1.12.2
                  org.codehaus.mojofindbugs-maven-plugin2.3.22.3.32.4.0
                  StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status

                  Plugins

                  StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status
                  org.apache.maven.pluginsmaven-changes-plugin2.62.7
                  org.apache.maven.pluginsmaven-jxr-plugin2.3
                  org.apache.maven.pluginsmaven-project-info-reports-plugin2.42.5
                  org.codehaus.mojotaglist-maven-plugin2.4
                  org.codehaus.mojoversions-maven-plugin2.1
                  StatusGroup IdArtifact IdCurrent VersionNext VersionNext IncrementalNext MinorNext MajorDependency status

                  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-changes-plugin

                  Status There is at least one newer minor version available. Minor updates are sometimes passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-changes-plugin
                  Current Version2.6
                  Newer versions2.7 Next Minor
                  2.7.1
                  2.8
                  2.9 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-ear-plugin

                  Status There is at least one newer incremental version available. Incremental updates are typically passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-ear-plugin
                  Current Version2.3.1
                  Newer versions2.3.2 Next Incremental
                  2.4 Next Minor
                  2.4.1
                  2.4.2
                  2.5
                  2.6
                  2.7
                  2.8
                  2.9 Latest Minor

                  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-ejb-plugin

                  Status There is at least one newer minor version available. Minor updates are sometimes passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-ejb-plugin
                  Current Version2.1
                  Newer versions2.2 Next Minor
                  2.2.1
                  2.3 Latest 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-jxr-plugin

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

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

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

                  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-project-info-reports-plugin

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

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

                  Status There is at least one newer minor version available. Minor updates are sometimes passive.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-rar-plugin
                  Current Version2.2
                  Newer versions2.3 Next 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
                  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.apache.maven.plugins:maven-war-plugin

                  Status There is at least one newer version available.
                  Group Idorg.apache.maven.plugins
                  Artifact Idmaven-war-plugin
                  Current Version2.1-alpha-2
                  Newer versions2.1 Next Version
                  2.1.1 Next Incremental
                  2.2 Next Minor
                  2.3
                  2.4 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

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

                  Status No newer versions available.
                  Group Idorg.codehaus.mojo
                  Artifact Idtaglist-maven-plugin
                  Current Version2.4

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

                  Status No newer versions available.
                  Group Idorg.codehaus.mojo
                  Artifact Idversions-maven-plugin
                  Current Version2.1
                  diff --git a/pmd.html b/pmd.html index 4e24de3..d74cd3e 100644 --- a/pmd.html +++ b/pmd.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
                • - RunDeck + Rundeck
                • /
                • - RunDeck API - Java Client + Rundeck API - Java Client
                • /
                • PMD Results
                • -
                • Last Published: 2014-11-06
                • |
                • -
                • Version: 11.1
                • +
                • Last Published: 2014-11-25
                • |
                • +
                • Version: 12.0
                @@ -120,15 +120,15 @@
              • Changes Report -
              • -
              • - Dependency Updates Report
              • Property Updates Report
              • Plugin Updates Report +
              • +
              • + Dependency Updates Report
              • PMD Report @@ -157,7 +157,7 @@
                -

                PMD Results

                The following document contains the results of PMD 4.2.5.

                Files

                org/rundeck/api/ApiCall.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Document'40
                Avoid empty if statements313 - 315

                org/rundeck/api/RundeckClient.java

                ViolationLine
                An empty statement (semicolon) not part of a loop442

                org/rundeck/api/domain/BaseState.java

                ViolationLine
                Avoid unused imports such as 'java.util.List'4
                Avoid unused imports such as 'java.util.Set'5

                org/rundeck/api/domain/RundeckOutput.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.RundeckExecution.ExecutionStatus'8

                org/rundeck/api/domain/WorkflowState.java

                ViolationLine
                Avoid unused imports such as 'java.util.Date'3
                Avoid unused imports such as 'java.util.Map'5

                org/rundeck/api/domain/WorkflowStepState.java

                ViolationLine
                Avoid unused imports such as 'java.util.List'3

                org/rundeck/api/generator/ProjectConfigGenerator.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Document'3

                org/rundeck/api/generator/ProjectGenerator.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Document'3

                org/rundeck/api/generator/XmlDocumentGenerator.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Node'5

                org/rundeck/api/parser/BulkDeleteParser.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Element'28
                Avoid empty catch blocks70 - 72

                org/rundeck/api/parser/DeleteParser.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Element'28

                org/rundeck/api/parser/PagedResultParser.java

                ViolationLine
                Avoid empty catch blocks112 - 113

                org/rundeck/api/parser/ProjectParserV11.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.ProjectConfig'4
                Avoid unused imports such as 'java.util.List'7

                org/rundeck/api/parser/WorkflowStateParser.java

                ViolationLine
                Avoid empty catch blocks49 - 50

                org/rundeck/api/parser/WorkflowStepContextStateParser.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.WorkflowStepState'5

                org/rundeck/api/parser/WorkflowStepStateParser.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.BaseState'5
                +

                PMD Results

                The following document contains the results of PMD 4.2.5.

                Files

                org/rundeck/api/ApiCall.java

                ViolationLine
                Avoid empty if statements312 - 314

                org/rundeck/api/RundeckClient.java

                ViolationLine
                An empty statement (semicolon) not part of a loop444

                org/rundeck/api/domain/BaseState.java

                ViolationLine
                Avoid unused imports such as 'java.util.List'4
                Avoid unused imports such as 'java.util.Set'5

                org/rundeck/api/domain/RundeckOutput.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.RundeckExecution.ExecutionStatus'8

                org/rundeck/api/domain/WorkflowState.java

                ViolationLine
                Avoid unused imports such as 'java.util.Date'3
                Avoid unused imports such as 'java.util.Map'5

                org/rundeck/api/domain/WorkflowStepState.java

                ViolationLine
                Avoid unused imports such as 'java.util.List'3

                org/rundeck/api/generator/DeleteExecutionsGenerator.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.ProjectConfig'5
                Avoid unused imports such as 'java.util.List'7

                org/rundeck/api/generator/ProjectConfigGenerator.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Document'3

                org/rundeck/api/generator/ProjectGenerator.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Document'3

                org/rundeck/api/generator/XmlDocumentGenerator.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Node'5

                org/rundeck/api/parser/APIV11Helper.java

                ViolationLine
                These nested if statements could be combined59 - 74

                org/rundeck/api/parser/BulkDeleteParser.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Element'28
                Avoid empty catch blocks70 - 72

                org/rundeck/api/parser/DeleteParser.java

                ViolationLine
                Avoid unused imports such as 'org.dom4j.Element'28

                org/rundeck/api/parser/PagedResultParser.java

                ViolationLine
                Avoid empty catch blocks115 - 116

                org/rundeck/api/parser/ProjectParserV11.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.ProjectConfig'4
                Avoid unused imports such as 'java.util.List'7

                org/rundeck/api/parser/WorkflowStateParser.java

                ViolationLine
                Avoid empty catch blocks49 - 50

                org/rundeck/api/parser/WorkflowStepContextStateParser.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.WorkflowStepState'5

                org/rundeck/api/parser/WorkflowStepStateParser.java

                ViolationLine
                Avoid unused imports such as 'org.rundeck.api.domain.BaseState'5
                diff --git a/pmd.xml b/pmd.xml index d63b72f..2f531a3 100644 --- a/pmd.xml +++ b/pmd.xml @@ -1,15 +1,12 @@ - + - -Avoid unused imports such as 'org.dom4j.Document' - - + Avoid empty if statements - + An empty statement (semicolon) not part of a loop @@ -39,6 +36,14 @@ Avoid unused imports such as 'java.util.Map' Avoid unused imports such as 'java.util.List' + + +Avoid unused imports such as 'org.rundeck.api.domain.ProjectConfig' + + +Avoid unused imports such as 'java.util.List' + + Avoid unused imports such as 'org.dom4j.Document' @@ -54,6 +59,11 @@ Avoid unused imports such as 'org.dom4j.Document' Avoid unused imports such as 'org.dom4j.Node' + + +These nested if statements could be combined + + Avoid unused imports such as 'org.dom4j.Element' @@ -68,7 +78,7 @@ Avoid unused imports such as 'org.dom4j.Element' - + Avoid empty catch blocks diff --git a/project-info.html b/project-info.html index fede926..f41d72a 100644 --- a/project-info.html +++ b/project-info.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
              • - RunDeck + Rundeck
              • /
              • - RunDeck API - Java Client + Rundeck API - Java Client
              • /
              • Project Information
              • -
              • Last Published: 2014-11-06
              • |
              • -
              • Version: 11.1
              • +
              • Last Published: 2014-11-25
              • |
              • +
              • Version: 12.0
              diff --git a/project-reports.html b/project-reports.html index ebf8c1c..0562d3c 100644 --- a/project-reports.html +++ b/project-reports.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
            • - RunDeck + Rundeck
            • /
            • - RunDeck API - Java Client + Rundeck API - Java Client
            • /
            • Generated Reports
            • -
            • Last Published: 2014-11-06
            • |
            • -
            • Version: 11.1
            • +
            • Last Published: 2014-11-25
            • |
            • +
            • Version: 12.0
            @@ -120,15 +120,15 @@
          • Changes Report -
          • -
          • - Dependency Updates Report
          • Property Updates Report
          • Plugin Updates Report +
          • +
          • + Dependency Updates Report
          • PMD Report @@ -157,7 +157,7 @@
            -

            Generated Reports

            This document provides an overview of the various reports that are automatically generated by Maven . Each report is briefly described below.

            Overview

            DocumentDescription
            JavaDocsJavaDoc API documentation.
            Test JavaDocsTest JavaDoc API documentation.
            Source XrefHTML based, cross-reference version of Java source code.
            Test Source XrefHTML based, cross-reference version of Java test source code.
            Tag ListReport on various tags found in the code.
            Changes ReportChanges Report on Releases of the Project.
            Dependency Updates ReportProvides details of the dependencies which have updated versions available.
            Property Updates ReportProvides details of properties which control versions of dependencies and/or plugins, and indicates any newer versions which are available.
            Plugin Updates ReportProvides details of the plugins used by this project which have newer versions available.
            PMD ReportVerification of coding rules.
            CPD ReportDuplicate code detection.
            FindBugs ReportGenerates a source code report with the FindBugs Library.
            +

            Generated Reports

            This document provides an overview of the various reports that are automatically generated by Maven . Each report is briefly described below.

            Overview

            DocumentDescription
            JavaDocsJavaDoc API documentation.
            Test JavaDocsTest JavaDoc API documentation.
            Source XrefHTML based, cross-reference version of Java source code.
            Test Source XrefHTML based, cross-reference version of Java test source code.
            Tag ListReport on various tags found in the code.
            Changes ReportChanges Report on Releases of the Project.
            Property Updates ReportProvides details of properties which control versions of dependencies and/or plugins, and indicates any newer versions which are available.
            Plugin Updates ReportProvides details of the plugins used by this project which have newer versions available.
            Dependency Updates ReportProvides details of the dependencies which have updated versions available.
            PMD ReportVerification of coding rules.
            CPD ReportDuplicate code detection.
            FindBugs ReportGenerates a source code report with the FindBugs Library.
            diff --git a/project-summary.html b/project-summary.html index bc615e7..5d23f64 100644 --- a/project-summary.html +++ b/project-summary.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
          • - RunDeck + Rundeck
          • /
          • - RunDeck API - Java Client + Rundeck API - Java Client
          • /
          • Project Summary
          • -
          • Last Published: 2014-11-06
          • |
          • -
          • Version: 11.1
          • +
          • Last Published: 2014-11-25
          • |
          • +
          • Version: 12.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
          Version11.1
          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
          Version12.0
          Typejar
          JDK Rev1.6
          diff --git a/property-updates-report.html b/property-updates-report.html index 3f78f19..e787a15 100644 --- a/property-updates-report.html +++ b/property-updates-report.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
        • - RunDeck + Rundeck
        • /
        • - RunDeck API - Java Client + Rundeck API - Java Client
        • /
        • Property Updates Report
        • -
        • Last Published: 2014-11-06
        • |
        • -
        • Version: 11.1
        • +
        • Last Published: 2014-11-25
        • |
        • +
        • Version: 12.0
        @@ -120,15 +120,15 @@
      • Changes Report -
      • -
      • - Dependency Updates Report
      • Property Updates Report
      • Plugin Updates Report +
      • +
      • + Dependency Updates Report
      • PMD Report @@ -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 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.pmd.version}2.62.73.0
        ${plugin.clean.version}2.4.12.5
        ${plugin.findbugs.version}2.3.22.3.32.4.0
        ${plugin.jxr.version}2.3
        ${plugin.enforcer.version}1.0.11.1
        ${plugin.release.version}2.2.12.2.22.3
        ${plugin.install.version}2.3.12.4
        ${plugin.resources.version}2.52.6
        ${plugin.gpg.version}1.4
        ${plugin.assembly.version}2.2.22.3
        ${plugin.site.version}3.03.1
        ${plugin.antrun.version}1.7
        ${plugin.versions.version}1.21.32.0
        ${plugin.project-info-reports.version}2.42.5
        ${plugin.checkstyle.version}2.82.9
        ${plugin.javadoc.version}2.82.8.12.9
        ${plugin.taglist.version}2.4
        ${plugin.changes.version}2.62.7
        ${plugin.eclipse.version}2.82.9
        ${plugin.deploy.version}2.7
        ${plugin.help.version}2.1.12.2
        ${plugin.surefire.version}2.102.11
        ${plugin.source.version}2.1.22.2
        ${plugin.dependency.version}2.32.4
        ${plugin.jar.version}2.3.22.4
        ${plugin.compiler.version}2.3.22.43.0
        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
        +

        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 available10
        # 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 update5
        # of properties where the next version available is a minor version update19
        # of properties where the next version available is a major version update0

        Summary of properties associated with artifact versions

        StatusPropertyCurrent VersionNext VersionNext IncrementalNext MinorNext Major
        ${plugin.clean.version}2.4.12.5
        ${plugin.findbugs.version}2.3.22.3.32.4.0
        ${dom4j.version}1.6.1
        ${plugin.enforcer.version}1.0.11.1
        ${plugin.release.version}2.2.12.2.22.3
        ${plugin.install.version}2.3.12.4
        ${plugin.resources.version}2.52.6
        ${plugin.assembly.version}2.2.22.3
        ${plugin.site.version}3.03.1
        ${plugin.antrun.version}1.7
        ${plugin.versions.version}2.1
        ${commons-lang.version}2.6
        ${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.surefire.version}2.102.11
        ${plugin.source.version}2.1.22.2
        ${jaxen.version}1.1.11.1.3
        ${groovy.version}1.8.41.8.52.0.0-rc-12.0.0
        ${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
        ${commons-io.version}2.12.2
        ${plugin.checkstyle.version}2.82.9
        ${plugin.changes.version}2.62.7
        ${plugin.deploy.version}2.7
        ${apache.httpcomponents.version}4.3.6
        ${plugin.dependency.version}2.32.4
        ${junit.version}4.104.11
        ${betamax.version}1.0
        ${plugin.jar.version}2.3.22.4
        StatusPropertyCurrent VersionNext VersionNext IncrementalNext MinorNext Major

        Properties associated with artifact versions

        ${apache.httpcomponents.version}

        Status No newer versions available.
        Property${apache.httpcomponents.version}
        Associated artifactsorg.apache.httpcomponents:httpclient
        org.apache.httpcomponents:httpmime
        Current Version4.3.6
        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

        ${betamax.version}

        Status No newer versions available.
        Property${betamax.version}
        Associated artifactscom.github.robfletcher:betamax
        Current Version1.0
        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

        ${commons-io.version}

        Status There is at least one newer minor version available. Minor updates are sometimes passive.
        Property${commons-io.version}
        Associated artifactscommons-io:commons-io
        Current Version2.1
        Newer versions2.2 Next Minor
        2.3
        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

        ${commons-lang.version}

        Status No newer versions available.
        Property${commons-lang.version}
        Associated artifactscommons-lang:commons-lang
        Current Version2.6
        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

        ${dom4j.version}

        Status No newer versions available.
        Property${dom4j.version}
        Associated artifactsdom4j:dom4j
        Current Version1.6.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

        ${groovy.version}

        Status There is at least one newer incremental version available. Incremental updates are typically passive.
        Property${groovy.version}
        Associated artifactsorg.codehaus.groovy:groovy-all
        Current Version1.8.4
        Newer versions1.8.5 Next Incremental
        1.8.6
        1.8.7
        1.8.8
        1.8.9 Latest Incremental
        2.0.0-rc-1 Next Minor
        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-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.1.7
        2.1.8
        2.1.9
        2.2.0-rc-1
        2.2.0-rc-2
        2.2.0-rc-3
        2.2.0
        2.2.1
        2.2.2
        2.3.0-rc-1
        2.3.0-rc-2
        2.3.0-rc-4
        2.3.0
        2.3.1
        2.3.2
        2.3.3
        2.3.4
        2.3.5
        2.3.6
        2.3.7 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

        ${jaxen.version}

        Status There is at least one newer incremental version available. Incremental updates are typically passive.
        Property${jaxen.version}
        Associated artifactsjaxen:jaxen
        Current Version1.1.1
        Newer versions1.1.3 Next Incremental
        1.1.4
        1.1.6 Latest Incremental
        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

        ${junit.version}

        Status There is at least one newer minor version available. Minor updates are sometimes passive.
        Property${junit.version}
        Associated artifactsjunit:junit
        Current Version4.10
        Newer versions4.11 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.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 No newer versions available.
        Property${plugin.versions.version}
        Associated artifactsorg.codehaus.mojo:versions-maven-plugin
        Current Version2.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
        diff --git a/scripting.html b/scripting.html index dc289e5..35c54c4 100644 --- a/scripting.html +++ b/scripting.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
      • - RunDeck + Rundeck
      • /
      • - RunDeck API - Java Client + Rundeck API - Java Client
      • /
      • -
      • Last Published: 2014-11-06
      • |
      • -
      • Version: 11.1
      • +
      • Last Published: 2014-11-25
      • |
      • +
      • Version: 12.0
      diff --git a/source-repository.html b/source-repository.html index 7f20cb2..67d4a5e 100644 --- a/source-repository.html +++ b/source-repository.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
    • - RunDeck + Rundeck
    • /
    • - RunDeck API - Java Client + Rundeck API - Java Client
    • /
    • Source Repository
    • -
    • Last Published: 2014-11-06
    • |
    • -
    • Version: 11.1
    • +
    • Last Published: 2014-11-25
    • |
    • +
    • Version: 12.0
    diff --git a/status.html b/status.html index 0b25b0a..a6bb734 100644 --- a/status.html +++ b/status.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
  • - RunDeck + Rundeck
  • /
  • - RunDeck API - Java Client + Rundeck API - Java Client
  • /
  • -
  • Last Published: 2014-11-06
  • |
  • -
  • Version: 11.1
  • +
  • Last Published: 2014-11-25
  • |
  • +
  • Version: 12.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

    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

    RunDeck API version 9

    Documentation of the RunDeck API version 9

    • list running executions across all projects - OK
    • include project name in execution results - OK
    • Add uuidOption parameter to allow removing imported UUIDs to avoid creation conflicts - OK

    RunDeck API version 10

    Documentation of the RunDeck API version 10

    • Execution State - Retrieve workflow step and node state information - OK
    • Execution Output with State - Retrieve log output with state change information - OK
    • Execution Output - Retrieve log output for a particular node or step - OK
    • Execution Info - added successfulNodes and failedNodes detail. - OK
    • Deprecation: Remove methods deprecated until version 10. - OK

    RunDeck API version 11

    Documentation of the RunDeck API version 11

    • Project creation - OK
    • Get Project configuration - OK
    • Set Project configuration - OK
    • Get/Set Project configuration keys - OK
    • Delete project - OK
    • Export project archive - OK
    • Import project archive - OK
    • Key file upload - OK
    • Key file delete - OK
    • Key file list - OK
    • Key file get - OK
    • API Token create - OK
    • API Token list - OK
    • API Token delete - 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

    Rundeck API version 9

    Documentation of the Rundeck API version 9

    • list running executions across all projects - OK
    • include project name in execution results - OK
    • Add uuidOption parameter to allow removing imported UUIDs to avoid creation conflicts - OK

    Rundeck API version 10

    Documentation of the Rundeck API version 10

    • Execution State - Retrieve workflow step and node state information - OK
    • Execution Output with State - Retrieve log output with state change information - OK
    • Execution Output - Retrieve log output for a particular node or step - OK
    • Execution Info - added successfulNodes and failedNodes detail. - OK
    • Deprecation: Remove methods deprecated until version 10. - OK

    Rundeck API version 11

    Documentation of the Rundeck API version 11

    • Project creation - OK
    • Get Project configuration - OK
    • Set Project configuration - OK
    • Get/Set Project configuration keys - OK
    • Delete project - OK
    • Export project archive - OK
    • Import project archive - OK
    • Key file upload - OK
    • Key file delete - OK
    • Key file list - OK
    • Key file get - OK
    • API Token create - OK
    • API Token list - OK
    • API Token delete - OK

    Rundeck API version 12

    Documentation of the Rundeck API version 12

    • Bulk delete executions - OK
    • Delete execution - OK
    • Delete all executions for a job - OK
    diff --git a/taglist.html b/taglist.html index 779a4e6..27be85d 100644 --- a/taglist.html +++ b/taglist.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
  • - RunDeck + Rundeck
  • /
  • - RunDeck API - Java Client + Rundeck API - Java Client
  • /
  • Tag List report
  • -
  • Last Published: 2014-11-06
  • |
  • -
  • Version: 11.1
  • +
  • Last Published: 2014-11-25
  • |
  • +
  • Version: 12.0
  • @@ -120,15 +120,15 @@
  • Changes Report -
  • -
  • - Dependency Updates Report
  • Property Updates Report
  • Plugin Updates Report +
  • +
  • + Dependency Updates Report
  • PMD Report diff --git a/team-list.html b/team-list.html index 68ebfc9..cf3d4ef 100644 --- a/team-list.html +++ b/team-list.html @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,18 +40,18 @@
  • - RunDeck + Rundeck
  • /
  • - RunDeck API - Java Client + Rundeck API - Java Client
  • /
  • Team list
  • -
  • Last Published: 2014-11-06
  • |
  • -
  • Version: 11.1
  • +
  • Last Published: 2014-11-25
  • |
  • +
  • Version: 12.0
  • diff --git a/testapidocs/assets/navtree_data.js b/testapidocs/assets/navtree_data.js index bcd009e..a435cc4 100644 --- a/testapidocs/assets/navtree_data.js +++ b/testapidocs/assets/navtree_data.js @@ -1,5 +1,5 @@ var NAVTREE_DATA = -[ [ "org.rundeck.api", "org/rundeck/api/package-summary.html", [ [ "Description", "org/rundeck/api/package-descr.html", null, "" ], [ "Classes", null, [ [ "RundeckClientTest", "org/rundeck/api/RundeckClientTest.html", null, "" ] ] +[ [ "org.rundeck.api", "org/rundeck/api/package-summary.html", [ [ "Description", "org/rundeck/api/package-descr.html", null, "" ], [ "Classes", null, [ [ "ExecutionQueryParametersTest", "org/rundeck/api/ExecutionQueryParametersTest.html", null, "" ], [ "RundeckClientTest", "org/rundeck/api/RundeckClientTest.html", null, "" ] ] , "" ] ] , "" ], [ "org.rundeck.api.generator", "org/rundeck/api/generator/package-summary.html", [ [ "Description", "org/rundeck/api/generator/package-descr.html", null, "" ], [ "Classes", null, [ [ "ProjectConfigGeneratorTest", "org/rundeck/api/generator/ProjectConfigGeneratorTest.html", null, "" ], [ "ProjectGeneratorTest", "org/rundeck/api/generator/ProjectGeneratorTest.html", null, "" ] ] , "" ] ] diff --git a/testapidocs/options b/testapidocs/options index c8f3bbf..714d49b 100644 --- a/testapidocs/options +++ b/testapidocs/options @@ -1,7 +1,7 @@ -bootclasspath '/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/classes' -classpath -'/Users/greg/devel/rundeck-api-java-client/target/checkout/target/classes:/Users/greg/devel/rundeck-api-java-client/target/checkout/target/test-classes:/Users/greg/.m2/repository/org/codehaus/groovy/groovy-all/1.8.4/groovy-all-1.8.4.jar:/Users/greg/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar:/Users/greg/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/greg/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar:/Users/greg/.m2/repository/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-io/7.5.1.v20110908/jetty-io-7.5.1.v20110908.jar:/Users/greg/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/greg/.m2/repository/junit/junit/4.10/junit-4.10.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-server/7.5.1.v20110908/jetty-server-7.5.1.v20110908.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-http/7.5.1.v20110908/jetty-http-7.5.1.v20110908.jar:/Users/greg/.m2/repository/commons-io/commons-io/2.1/commons-io-2.1.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-continuation/7.5.1.v20110908/jetty-continuation-7.5.1.v20110908.jar:/Users/greg/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar:/Users/greg/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/greg/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar:/Users/greg/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar:/Users/greg/.m2/repository/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-util/7.5.1.v20110908/jetty-util-7.5.1.v20110908.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar:/Users/greg/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar:/Users/greg/.m2/repository/com/github/robfletcher/betamax/1.0/betamax-1.0.jar:/Users/greg/.m2/repository/org/yaml/snakeyaml/1.9/snakeyaml-1.9.jar:/Users/greg/.m2/repository/xom/xom/1.0/xom-1.0.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpmime/4.1.2/httpmime-4.1.2.jar:/Users/greg/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar:/Users/greg/.m2/repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar:/Users/greg/.m2/repository/xalan/xalan/2.6.0/xalan-2.6.0.jar' +'/Users/greg/devel/rundeck-api-java-client/target/checkout/target/classes:/Users/greg/devel/rundeck-api-java-client/target/checkout/target/test-classes:/Users/greg/.m2/repository/org/codehaus/groovy/groovy-all/1.8.4/groovy-all-1.8.4.jar:/Users/greg/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar:/Users/greg/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/greg/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.jar:/Users/greg/.m2/repository/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-io/7.5.1.v20110908/jetty-io-7.5.1.v20110908.jar:/Users/greg/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/greg/.m2/repository/junit/junit/4.10/junit-4.10.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-server/7.5.1.v20110908/jetty-server-7.5.1.v20110908.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-http/7.5.1.v20110908/jetty-http-7.5.1.v20110908.jar:/Users/greg/.m2/repository/commons-io/commons-io/2.1/commons-io-2.1.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-continuation/7.5.1.v20110908/jetty-continuation-7.5.1.v20110908.jar:/Users/greg/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar:/Users/greg/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/Users/greg/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar:/Users/greg/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar:/Users/greg/.m2/repository/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar:/Users/greg/.m2/repository/org/eclipse/jetty/jetty-util/7.5.1.v20110908/jetty-util-7.5.1.v20110908.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.jar:/Users/greg/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar:/Users/greg/.m2/repository/com/github/robfletcher/betamax/1.0/betamax-1.0.jar:/Users/greg/.m2/repository/org/yaml/snakeyaml/1.9/snakeyaml-1.9.jar:/Users/greg/.m2/repository/xom/xom/1.0/xom-1.0.jar:/Users/greg/.m2/repository/org/apache/httpcomponents/httpmime/4.3.6/httpmime-4.3.6.jar:/Users/greg/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar:/Users/greg/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar:/Users/greg/.m2/repository/xalan/xalan/2.6.0/xalan-2.6.0.jar' -doclet 'com.google.doclava.Doclava' -docletpath diff --git a/testapidocs/packages b/testapidocs/packages index 6e67149..2fdd7ef 100644 --- a/testapidocs/packages +++ b/testapidocs/packages @@ -1,4 +1,4 @@ +org.rundeck.api org.rundeck.api.generator org.rundeck.api.parser -org.rundeck.api org.rundeck.api.util \ No newline at end of file diff --git a/testapidocs/proof-read.txt b/testapidocs/proof-read.txt index dd61113..e10d3cb 100644 --- a/testapidocs/proof-read.txt +++ b/testapidocs/proof-read.txt @@ -16,6 +16,168 @@ javadoc proofread file: ./proof-read.txt === reference/packages.html === +=== org/rundeck/api/RundeckClientTest.html === + Test the + {@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: TEST_TOKEN_5 +FIELD: TEST_TOKEN_6 +FIELD: TEST_TOKEN_7 +FIELD: TEST_TOKEN_8 +FIELD: recorder +CONSTRUCTOR: RundeckClientTest +METHOD: abortExecution +METHOD: abortExecutionAsUser +METHOD: abortExecutionAsUserUnauthorized +METHOD: apiVersionDefaultLatest +METHOD: bulkDelete +METHOD: bulkDeleteFailDNE +METHOD: bulkDeleteFailUnauthorized +METHOD: createProject +METHOD: deleteAllJobExecutionsSuccess +METHOD: deleteAllJobExecutionsUnauthorized + delete executions with failure +METHOD: deleteApiToken + get api token +METHOD: deleteExecutionFailure + delete single execution failure (does not exist) +METHOD: deleteExecutionNullInput + delete single execution null input +METHOD: deleteExecutionSuccess + delete single execution success +METHOD: deleteExecutionsMixed + delete executions mixed success +METHOD: deleteExecutionsSuccess + delete executions with success +METHOD: deleteExecutionsUnauthorized + delete executions with failure +METHOD: deleteJob + delete job +METHOD: deleteJobNotFound + delete job (DNE) +METHOD: deleteKey + delete ssh key +METHOD: deleteProject +METHOD: deleteProjectConfigKeyed +METHOD: executionOutputBasic + Execution output +METHOD: executionOutputForNode + Execution output for a node +METHOD: executionOutputForNodeAndStep + Execution output for a node and step +METHOD: executionOutputForStep + Execution output for a step +METHOD: executionOutputState + Execution output state sequence +METHOD: executionOutputStateOnly + Execution output state sequence +METHOD: executionState + Execution state structure +METHOD: exportProject +METHOD: generateApiToken + generate api token +METHOD: getApiToken + get api token +METHOD: getExecution +METHOD: getExecution_v11 +METHOD: getExecution_v11_buggy + Test incorrect <result> wrapper is handled correctly +METHOD: getExecutions +METHOD: getExecutionsPaging + Test paging values from results +METHOD: getExecutionsV11 +METHOD: getHistory +METHOD: getHistoryExcludeJoblist +METHOD: getHistoryJoblist +METHOD: getHistoryUser +METHOD: getKeyData_private + get ssh key data +METHOD: getKeyData_public + get ssh key data +METHOD: getKey_private + get ssh key +METHOD: getKey_public + get ssh key +METHOD: getProjectConfig +METHOD: getProjectConfigKeyed +METHOD: getProjectConfigKeyedDNE +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: importJobsUUIDParamPreserveV9 + Import jobs, project parameter v7 doesn' use parameter +METHOD: importJobsUUIDParamRemoveV9 + Import jobs, project parameter v7 doesn' use parameter +METHOD: importProjectFailure +METHOD: importProjectSuccess +METHOD: listApiTokens + list api tokens all +METHOD: listApiTokens_user + list api tokens for user +METHOD: listKeyDirectory + list directory +METHOD: listKeyDirectoryRoot + list root +METHOD: runningExecutionsV8 + Running executions for all projects using API v8, which queries for project list and then individually + queries each project's now running +METHOD: runningExecutionsV9 + Running executions for all projects using API v9 +METHOD: setProjectConfig +METHOD: setProjectConfigKeyed +METHOD: setUp +METHOD: storeKey_private + Store ssh key +METHOD: storeKey_public + Store ssh key +METHOD: triggerAdhocCommand +METHOD: triggerAdhocCommandAsUser +METHOD: triggerAdhocCommandAsUserUnauthorized +METHOD: triggerAdhocCommand_v11 +METHOD: triggerAdhocCommand_v11_buggy +METHOD: triggerAdhocScript +METHOD: triggerAdhocScriptAsUser +METHOD: triggerAdhocScriptAsUserUnauthorized +METHOD: triggerAdhocScriptInpterpreter +METHOD: triggerAdhocScript_v11 + Handle v11 response without <result> wrapper +METHOD: triggerAdhocScript_v11_buggy + Handle incorrect <result> wrapper for v11 response +METHOD: triggerJobAsUser +METHOD: triggerJobAsUserUnauthorized +METHOD: triggerJobBasic +METHOD: triggerJobBasic_v11 + API v11 request to trigger job, with expected xml response without <result> wrapper +METHOD: triggerJobBasic_v11_patch + Response for API v11 incorrectly includes <result>, but we should handle this case + + +=== org/rundeck/api/ExecutionQueryParametersTest.html === + ExecutionQueryParametersTest is ... +CONSTRUCTOR: ExecutionQueryParametersTest +METHOD: dateParameter +METHOD: listParameter +METHOD: stringParameter + + === org/rundeck/api/generator/ProjectGeneratorTest.html === ProjectGeneratorTest is ... CONSTRUCTOR: ProjectGeneratorTest @@ -216,129 +378,6 @@ METHOD: parseFailedAbort METHOD: parsePendingAbort -=== org/rundeck/api/RundeckClientTest.html === - Test the - {@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: TEST_TOKEN_5 -FIELD: TEST_TOKEN_6 -FIELD: TEST_TOKEN_7 -FIELD: recorder -CONSTRUCTOR: RundeckClientTest -METHOD: abortExecution -METHOD: abortExecutionAsUser -METHOD: abortExecutionAsUserUnauthorized -METHOD: apiVersionDefaultLatest -METHOD: bulkDelete -METHOD: bulkDeleteFailDNE -METHOD: bulkDeleteFailUnauthorized -METHOD: createProject -METHOD: deleteApiToken - get api token -METHOD: deleteJob - delete job -METHOD: deleteJobNotFound - delete job (DNE) -METHOD: deleteKey - delete ssh key -METHOD: deleteProject -METHOD: deleteProjectConfigKeyed -METHOD: executionOutputBasic - Execution output -METHOD: executionOutputForNode - Execution output for a node -METHOD: executionOutputForNodeAndStep - Execution output for a node and step -METHOD: executionOutputForStep - Execution output for a step -METHOD: executionOutputState - Execution output state sequence -METHOD: executionOutputStateOnly - Execution output state sequence -METHOD: executionState - Execution state structure -METHOD: exportProject -METHOD: generateApiToken - generate api token -METHOD: getApiToken - get api token -METHOD: getExecutions -METHOD: getExecutionsPaging - Test paging values from results -METHOD: getHistory -METHOD: getHistoryExcludeJoblist -METHOD: getHistoryJoblist -METHOD: getHistoryUser -METHOD: getKeyData_private - get ssh key data -METHOD: getKeyData_public - get ssh key data -METHOD: getKey_private - get ssh key -METHOD: getKey_public - get ssh key -METHOD: getProjectConfig -METHOD: getProjectConfigKeyed -METHOD: getProjectConfigKeyedDNE -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: importJobsUUIDParamPreserveV9 - Import jobs, project parameter v7 doesn' use parameter -METHOD: importJobsUUIDParamRemoveV9 - Import jobs, project parameter v7 doesn' use parameter -METHOD: importProjectFailure -METHOD: importProjectSuccess -METHOD: listApiTokens - list api tokens all -METHOD: listApiTokens_user - list api tokens for user -METHOD: listKeyDirectory - list directory -METHOD: listKeyDirectoryRoot - list root -METHOD: runningExecutionsV8 - Running executions for all projects using API v8, which queries for project list and then individually - queries each project's now running -METHOD: runningExecutionsV9 - Running executions for all projects using API v9 -METHOD: setProjectConfig -METHOD: setProjectConfigKeyed -METHOD: setUp -METHOD: storeKey_private - Store ssh key -METHOD: storeKey_public - Store ssh key -METHOD: triggerAdhocCommand -METHOD: triggerAdhocCommandAsUser -METHOD: triggerAdhocCommandAsUserUnauthorized -METHOD: triggerAdhocScript -METHOD: triggerAdhocScriptAsUser -METHOD: triggerAdhocScriptAsUserUnauthorized -METHOD: triggerAdhocScriptInpterpreter -METHOD: triggerJobAsUser -METHOD: triggerJobAsUserUnauthorized -METHOD: triggerJobBasic - - === org/rundeck/api/util/ParametersUtilTest.html === Test the {@link/ParametersUtil} diff --git a/testapidocs/reference/classes.html b/testapidocs/reference/classes.html index 143a1ca..07386f5 100644 --- a/testapidocs/reference/classes.html +++ b/testapidocs/reference/classes.html @@ -276,6 +276,12 @@ + ExecutionQueryParametersTest + ExecutionQueryParametersTest is ...  + + + + ExecutionStateParserTest $INTERFACE is ...  diff --git a/testapidocs/reference/current.xml b/testapidocs/reference/current.xml index a64d84e..fff220a 100644 --- a/testapidocs/reference/current.xml +++ b/testapidocs/reference/current.xml @@ -1,6 +1,56 @@ + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ExecutionQueryParametersTest + + + + +   + + + + + + diff --git a/testapidocs/reference/lists.js b/testapidocs/reference/lists.js index fe0aa40..0f4e182 100644 --- a/testapidocs/reference/lists.js +++ b/testapidocs/reference/lists.js @@ -1,35 +1,36 @@ var DATA = [ { id:0, label:"org.rundeck.api", link:"org/rundeck/api/package-summary.html", type:"package" }, - { id:1, label:"org.rundeck.api.RundeckClientTest", link:"org/rundeck/api/RundeckClientTest.html", type:"class" }, - { id:2, label:"org.rundeck.api.generator", link:"org/rundeck/api/generator/package-summary.html", type:"package" }, - { id:3, label:"org.rundeck.api.generator.ProjectConfigGeneratorTest", link:"org/rundeck/api/generator/ProjectConfigGeneratorTest.html", type:"class" }, - { id:4, label:"org.rundeck.api.generator.ProjectGeneratorTest", link:"org/rundeck/api/generator/ProjectGeneratorTest.html", type:"class" }, - { id:5, label:"org.rundeck.api.parser", link:"org/rundeck/api/parser/package-summary.html", type:"package" }, - { id:6, label:"org.rundeck.api.parser.AbortParserTest", link:"org/rundeck/api/parser/AbortParserTest.html", type:"class" }, - { id:7, label:"org.rundeck.api.parser.BaseStateParserTest", link:"org/rundeck/api/parser/BaseStateParserTest.html", type:"class" }, - { id:8, label:"org.rundeck.api.parser.BulkDeleteParserTest", link:"org/rundeck/api/parser/BulkDeleteParserTest.html", type:"class" }, - { id:9, label:"org.rundeck.api.parser.DeleteParserTest", link:"org/rundeck/api/parser/DeleteParserTest.html", type:"class" }, - { id:10, label:"org.rundeck.api.parser.EventParserTest", link:"org/rundeck/api/parser/EventParserTest.html", type:"class" }, - { id:11, label:"org.rundeck.api.parser.ExecutionParserTest", link:"org/rundeck/api/parser/ExecutionParserTest.html", type:"class" }, - { id:12, label:"org.rundeck.api.parser.ExecutionStateParserTest", link:"org/rundeck/api/parser/ExecutionStateParserTest.html", type:"class" }, - { id:13, label:"org.rundeck.api.parser.HistoryParserTest", link:"org/rundeck/api/parser/HistoryParserTest.html", type:"class" }, - { id:14, label:"org.rundeck.api.parser.IndexedWorkflowStepStateParserTest", link:"org/rundeck/api/parser/IndexedWorkflowStepStateParserTest.html", type:"class" }, - { id:15, label:"org.rundeck.api.parser.JobParserTest", link:"org/rundeck/api/parser/JobParserTest.html", type:"class" }, - { id:16, label:"org.rundeck.api.parser.JobsImportResultParserTest", link:"org/rundeck/api/parser/JobsImportResultParserTest.html", type:"class" }, - { id:17, label:"org.rundeck.api.parser.ListParserTest", link:"org/rundeck/api/parser/ListParserTest.html", type:"class" }, - { id:18, label:"org.rundeck.api.parser.NodeParserTest", link:"org/rundeck/api/parser/NodeParserTest.html", type:"class" }, - { id:19, label:"org.rundeck.api.parser.OutputEntryParserTest", link:"org/rundeck/api/parser/OutputEntryParserTest.html", type:"class" }, - { id:20, label:"org.rundeck.api.parser.OutputParserTest", link:"org/rundeck/api/parser/OutputParserTest.html", type:"class" }, - { id:21, label:"org.rundeck.api.parser.ParserHelperTest", link:"org/rundeck/api/parser/ParserHelperTest.html", type:"class" }, - { id:22, label:"org.rundeck.api.parser.ProjectConfigParserTest", link:"org/rundeck/api/parser/ProjectConfigParserTest.html", type:"class" }, - { id:23, label:"org.rundeck.api.parser.ProjectConfigPropertyParserTest", link:"org/rundeck/api/parser/ProjectConfigPropertyParserTest.html", type:"class" }, - { id:24, label:"org.rundeck.api.parser.ProjectParserTest", link:"org/rundeck/api/parser/ProjectParserTest.html", type:"class" }, - { id:25, label:"org.rundeck.api.parser.ProjectParserV11Test", link:"org/rundeck/api/parser/ProjectParserV11Test.html", type:"class" }, - { id:26, label:"org.rundeck.api.parser.StringParserTest", link:"org/rundeck/api/parser/StringParserTest.html", type:"class" }, - { id:27, label:"org.rundeck.api.parser.SystemInfoParserTest", link:"org/rundeck/api/parser/SystemInfoParserTest.html", type:"class" }, - { id:28, label:"org.rundeck.api.parser.WorkflowStateParserTest", link:"org/rundeck/api/parser/WorkflowStateParserTest.html", type:"class" }, - { id:29, label:"org.rundeck.api.parser.WorkflowStepStateParserTest", link:"org/rundeck/api/parser/WorkflowStepStateParserTest.html", type:"class" }, - { id:30, label:"org.rundeck.api.util", link:"org/rundeck/api/util/package-summary.html", type:"package" }, - { id:31, label:"org.rundeck.api.util.ParametersUtilTest", link:"org/rundeck/api/util/ParametersUtilTest.html", type:"class" } + { id:1, label:"org.rundeck.api.ExecutionQueryParametersTest", link:"org/rundeck/api/ExecutionQueryParametersTest.html", type:"class" }, + { id:2, label:"org.rundeck.api.RundeckClientTest", link:"org/rundeck/api/RundeckClientTest.html", type:"class" }, + { id:3, label:"org.rundeck.api.generator", link:"org/rundeck/api/generator/package-summary.html", type:"package" }, + { id:4, label:"org.rundeck.api.generator.ProjectConfigGeneratorTest", link:"org/rundeck/api/generator/ProjectConfigGeneratorTest.html", type:"class" }, + { id:5, label:"org.rundeck.api.generator.ProjectGeneratorTest", link:"org/rundeck/api/generator/ProjectGeneratorTest.html", type:"class" }, + { id:6, label:"org.rundeck.api.parser", link:"org/rundeck/api/parser/package-summary.html", type:"package" }, + { id:7, label:"org.rundeck.api.parser.AbortParserTest", link:"org/rundeck/api/parser/AbortParserTest.html", type:"class" }, + { id:8, label:"org.rundeck.api.parser.BaseStateParserTest", link:"org/rundeck/api/parser/BaseStateParserTest.html", type:"class" }, + { id:9, label:"org.rundeck.api.parser.BulkDeleteParserTest", link:"org/rundeck/api/parser/BulkDeleteParserTest.html", type:"class" }, + { id:10, label:"org.rundeck.api.parser.DeleteParserTest", link:"org/rundeck/api/parser/DeleteParserTest.html", type:"class" }, + { id:11, label:"org.rundeck.api.parser.EventParserTest", link:"org/rundeck/api/parser/EventParserTest.html", type:"class" }, + { id:12, label:"org.rundeck.api.parser.ExecutionParserTest", link:"org/rundeck/api/parser/ExecutionParserTest.html", type:"class" }, + { id:13, label:"org.rundeck.api.parser.ExecutionStateParserTest", link:"org/rundeck/api/parser/ExecutionStateParserTest.html", type:"class" }, + { id:14, label:"org.rundeck.api.parser.HistoryParserTest", link:"org/rundeck/api/parser/HistoryParserTest.html", type:"class" }, + { id:15, label:"org.rundeck.api.parser.IndexedWorkflowStepStateParserTest", link:"org/rundeck/api/parser/IndexedWorkflowStepStateParserTest.html", type:"class" }, + { id:16, label:"org.rundeck.api.parser.JobParserTest", link:"org/rundeck/api/parser/JobParserTest.html", type:"class" }, + { id:17, label:"org.rundeck.api.parser.JobsImportResultParserTest", link:"org/rundeck/api/parser/JobsImportResultParserTest.html", type:"class" }, + { id:18, label:"org.rundeck.api.parser.ListParserTest", link:"org/rundeck/api/parser/ListParserTest.html", type:"class" }, + { id:19, label:"org.rundeck.api.parser.NodeParserTest", link:"org/rundeck/api/parser/NodeParserTest.html", type:"class" }, + { id:20, label:"org.rundeck.api.parser.OutputEntryParserTest", link:"org/rundeck/api/parser/OutputEntryParserTest.html", type:"class" }, + { id:21, label:"org.rundeck.api.parser.OutputParserTest", link:"org/rundeck/api/parser/OutputParserTest.html", type:"class" }, + { id:22, label:"org.rundeck.api.parser.ParserHelperTest", link:"org/rundeck/api/parser/ParserHelperTest.html", type:"class" }, + { id:23, label:"org.rundeck.api.parser.ProjectConfigParserTest", link:"org/rundeck/api/parser/ProjectConfigParserTest.html", type:"class" }, + { id:24, label:"org.rundeck.api.parser.ProjectConfigPropertyParserTest", link:"org/rundeck/api/parser/ProjectConfigPropertyParserTest.html", type:"class" }, + { id:25, label:"org.rundeck.api.parser.ProjectParserTest", link:"org/rundeck/api/parser/ProjectParserTest.html", type:"class" }, + { id:26, label:"org.rundeck.api.parser.ProjectParserV11Test", link:"org/rundeck/api/parser/ProjectParserV11Test.html", type:"class" }, + { id:27, label:"org.rundeck.api.parser.StringParserTest", link:"org/rundeck/api/parser/StringParserTest.html", type:"class" }, + { id:28, label:"org.rundeck.api.parser.SystemInfoParserTest", link:"org/rundeck/api/parser/SystemInfoParserTest.html", type:"class" }, + { id:29, label:"org.rundeck.api.parser.WorkflowStateParserTest", link:"org/rundeck/api/parser/WorkflowStateParserTest.html", type:"class" }, + { id:30, label:"org.rundeck.api.parser.WorkflowStepStateParserTest", link:"org/rundeck/api/parser/WorkflowStepStateParserTest.html", type:"class" }, + { id:31, label:"org.rundeck.api.util", link:"org/rundeck/api/util/package-summary.html", type:"package" }, + { id:32, label:"org.rundeck.api.util.ParametersUtilTest", link:"org/rundeck/api/util/ParametersUtilTest.html", type:"class" } ]; diff --git a/testapidocs/reference/org/rundeck/api/ExecutionQueryParametersTest.html b/testapidocs/reference/org/rundeck/api/ExecutionQueryParametersTest.html new file mode 100644 index 0000000..ef99ec8 --- /dev/null +++ b/testapidocs/reference/org/rundeck/api/ExecutionQueryParametersTest.html @@ -0,0 +1,856 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ExecutionQueryParametersTest + + +| RunDeck API - Java Client + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + +
    + + + + + + +
    +
    + + + + +
    + public + + + + class +

    ExecutionQueryParametersTest

    + + + + + extends Object
    + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + +
    java.lang.Object
       ↳org.rundeck.api.ExecutionQueryParametersTest
    + + + + + + + +
    + + +

    Class Overview

    +

    ExecutionQueryParametersTest is ...

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

    Summary

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Constructors
    + + + + + + + + ExecutionQueryParametersTest() + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Public Methods
    + + + + + + void + + dateParameter() + +
    + + + + + + void + + listParameter() + +
    + + + + + + void + + stringParameter() + +
    + + + + + + + + + + + + + + + +
    + [Expand] +
    Inherited Methods
    + +From class + + java.lang.Object + +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Public Constructors

    + + + + + +
    +

    + + public + + + + + + + ExecutionQueryParametersTest + () +

    +
    +
    + +
    + + + +
    +
    + +

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

    Public Methods

    + + + + + +
    +

    + + public + + + + + void + + dateParameter + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + listParameter + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + +
    +

    + + public + + + + + void + + stringParameter + () +

    +
    +
    + +
    + + + +
    +
    + +

    + +
    +
    + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + diff --git a/testapidocs/reference/org/rundeck/api/RundeckClientTest.html b/testapidocs/reference/org/rundeck/api/RundeckClientTest.html index 4564b55..f3dfc0b 100644 --- a/testapidocs/reference/org/rundeck/api/RundeckClientTest.html +++ b/testapidocs/reference/org/rundeck/api/RundeckClientTest.html @@ -159,6 +159,7 @@
  • Classes

  • @@ -417,6 +418,13 @@ Summary: + + String + TEST_TOKEN_8 + + + + @@ -621,6 +629,41 @@ Summary: + void + + + deleteAllJobExecutionsSuccess() + + + + + + + + + + + + + void + + + deleteAllJobExecutionsUnauthorized() + +
    delete executions with failure +
    + + + + + + + + + + + + void @@ -640,6 +683,120 @@ Summary: + void + + + deleteExecutionFailure() + +
    delete single execution failure (does not exist) +
    + + + + + + + + + + + + + void + + + deleteExecutionNullInput() + +
    delete single execution null input +
    + + + + + + + + + + + + + void + + + deleteExecutionSuccess() + +
    delete single execution success +
    + + + + + + + + + + + + + void + + + deleteExecutionsMixed() + +
    delete executions mixed success +
    + + + + + + + + + + + + + void + + + deleteExecutionsSuccess() + +
    delete executions with success +
    + + + + + + + + + + + + + void + + + deleteExecutionsUnauthorized() + +
    delete executions with failure +
    + + + + + + + + + + + + void @@ -919,7 +1076,7 @@ Summary: void - getExecutions() + getExecution() @@ -932,6 +1089,56 @@ Summary: + void + + + getExecution_v11() + + + + + + + + + + + + + void + + + getExecution_v11_buggy() + +
    Test incorrect <result> wrapper is handled correctly
    + + + + + + + + + + + + + void + + + getExecutions() + + + + + + + + + + + + void @@ -944,6 +1151,22 @@ Summary: + + + + + + + + void + + + getExecutionsV11() + + + + + @@ -1560,6 +1783,38 @@ Summary: + void + + + triggerAdhocCommand_v11() + + + + + + + + + + + + + void + + + triggerAdhocCommand_v11_buggy() + + + + + + + + + + + + void @@ -1624,6 +1879,42 @@ Summary: + void + + + triggerAdhocScript_v11() + +
    Handle v11 response without <result> wrapper
    + + + + + + + + + + + + + void + + + triggerAdhocScript_v11_buggy() + +
    Handle incorrect <result> wrapper for v11 response
    + + + + + + + + + + + + void @@ -1664,6 +1955,42 @@ Summary: + + + + + + + + + void + + + triggerJobBasic_v11() + +
    API v11 request to trigger job, with expected xml response without <result> wrapper
    + + + + + + + + + + + + + void + + + triggerJobBasic_v11_patch() + +
    Response for API v11 incorrectly includes <result>, but we should handle this case
    + + + + @@ -2230,6 +2557,45 @@ From class + + +
    +

    + + public + static + final + String + + TEST_TOKEN_8 +

    +
    + + + + + + +
    +
    + +

    + + +
    + Constant Value: + + + "GG7uj1y6UGahOs7QlmeN2sIwz1Y2j7zI" + + +
    + +
    +
    + + + @@ -2636,6 +3002,87 @@ From class + + +
    +

    + + public + + + + + void + + deleteAllJobExecutionsSuccess + () +

    +
    +
    + +
    + + + +
    +
    + +

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

    + + public + + + + + void + + deleteAllJobExecutionsUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    delete executions with failure +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -2677,6 +3124,252 @@ From class
    + + +
    +

    + + public + + + + + void + + deleteExecutionFailure + () +

    +
    +
    + +
    + + + +
    +
    + +

    delete single execution failure (does not exist) +

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

    + + public + + + + + void + + deleteExecutionNullInput + () +

    +
    +
    + +
    + + + +
    +
    + +

    delete single execution null input +

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

    + + public + + + + + void + + deleteExecutionSuccess + () +

    +
    +
    + +
    + + + +
    +
    + +

    delete single execution success +

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

    + + public + + + + + void + + deleteExecutionsMixed + () +

    +
    +
    + +
    + + + +
    +
    + +

    delete executions mixed success +

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

    + + public + + + + + void + + deleteExecutionsSuccess + () +

    +
    +
    + +
    + + + +
    +
    + +

    delete executions with success +

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

    + + public + + + + + void + + deleteExecutionsUnauthorized + () +

    +
    +
    + +
    + + + +
    +
    + +

    delete executions with failure +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -3289,6 +3982,126 @@ From class
    + + +
    +

    + + public + + + + + void + + getExecution + () +

    +
    +
    + +
    + + + +
    +
    + +

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

    + + public + + + + + void + + getExecution_v11 + () +

    +
    +
    + +
    + + + +
    +
    + +

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

    + + public + + + + + void + + getExecution_v11_buggy + () +

    +
    +
    + +
    + + + +
    +
    + +

    Test incorrect <result> wrapper is handled correctly

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -3370,6 +4183,46 @@ From class
    + + +
    +

    + + public + + + + + void + + getExecutionsV11 + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -4781,6 +5634,86 @@ From class
    + + +
    +

    + + public + + + + + void + + triggerAdhocCommand_v11 + () +

    +
    +
    + +
    + + + +
    +
    + +

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

    + + public + + + + + void + + triggerAdhocCommand_v11_buggy + () +

    +
    +
    + +
    + + + +
    +
    + +

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -4941,6 +5874,86 @@ From class
    + + +
    +

    + + public + + + + + void + + triggerAdhocScript_v11 + () +

    +
    +
    + +
    + + + +
    +
    + +

    Handle v11 response without <result> wrapper

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

    + + public + + + + + void + + triggerAdhocScript_v11_buggy + () +

    +
    +
    + +
    + + + +
    +
    + +

    Handle incorrect <result> wrapper for v11 response

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + +
    @@ -5061,6 +6074,86 @@ From class
    + + +
    +

    + + public + + + + + void + + triggerJobBasic_v11 + () +

    +
    +
    + +
    + + + +
    +
    + +

    API v11 request to trigger job, with expected xml response without <result> wrapper

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

    + + public + + + + + void + + triggerJobBasic_v11_patch + () +

    +
    +
    + +
    + + + +
    +
    + +

    Response for API v11 incorrectly includes <result>, but we should handle this case

    +
    +
    Throws
    + + + + +
    Exception +
    +
    + +
    +
    + + diff --git a/testapidocs/reference/org/rundeck/api/package-descr.html b/testapidocs/reference/org/rundeck/api/package-descr.html index 0dca300..559ac4c 100644 --- a/testapidocs/reference/org/rundeck/api/package-descr.html +++ b/testapidocs/reference/org/rundeck/api/package-descr.html @@ -159,6 +159,7 @@
  • Classes

  • diff --git a/testapidocs/reference/org/rundeck/api/package-summary.html b/testapidocs/reference/org/rundeck/api/package-summary.html index 13a77dd..a9bba11 100644 --- a/testapidocs/reference/org/rundeck/api/package-summary.html +++ b/testapidocs/reference/org/rundeck/api/package-summary.html @@ -159,6 +159,7 @@
  • Classes

  • @@ -236,6 +237,10 @@ + + + + diff --git a/xref-test/allclasses-frame.html b/xref-test/allclasses-frame.html index d3e9f04..0d53d9f 100644 --- a/xref-test/allclasses-frame.html +++ b/xref-test/allclasses-frame.html @@ -28,6 +28,9 @@
  • ExecutionParserTest +
  • +
  • + ExecutionQueryParametersTest
  • ExecutionStateParserTest diff --git a/xref-test/index.html b/xref-test/index.html index f697ca1..a37015c 100644 --- a/xref-test/index.html +++ b/xref-test/index.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference + RunDeck API - Java Client 12.0 Reference diff --git a/xref-test/org/rundeck/api/ExecutionQueryParametersTest.html b/xref-test/org/rundeck/api/ExecutionQueryParametersTest.html new file mode 100644 index 0000000..4215149 --- /dev/null +++ b/xref-test/org/rundeck/api/ExecutionQueryParametersTest.html @@ -0,0 +1,68 @@ + + + + +ExecutionQueryParametersTest xref + + + +
    +
    +1   package org.rundeck.api;
    +2   
    +3   import junit.framework.Assert;
    +4   import org.junit.Test;
    +5   import org.rundeck.api.query.ExecutionQuery;
    +6   
    +7   import java.util.Arrays;
    +8   import java.util.Date;
    +9   
    +10  /**
    +11   * ExecutionQueryParametersTest is ...
    +12   *
    +13   * @author Greg Schueler <greg@simplifyops.com>
    +14   * @since 2014-11-07
    +15   */
    +16  public class ExecutionQueryParametersTest {
    +17  
    +18      @Test
    +19      public void stringParameter() {
    +20          ExecutionQuery.Builder description = ExecutionQuery.builder().description("a description");
    +21          ExecutionQueryParameters executionQueryParameters = new ExecutionQueryParameters(
    +22                  description.build()
    +23          );
    +24          ApiPathBuilder param = new ApiPathBuilder("").param(executionQueryParameters);
    +25          Assert.assertEquals("?descFilter=a+description", param.toString());
    +26      }
    +27      @Test
    +28      public void listParameter() {
    +29          ExecutionQuery.Builder description = ExecutionQuery.builder().excludeJobList(
    +30                  Arrays.asList(
    +31                          "a",
    +32                          "b"
    +33                  )
    +34          );
    +35          ExecutionQueryParameters executionQueryParameters = new ExecutionQueryParameters(
    +36                  description.build()
    +37          );
    +38          ApiPathBuilder param = new ApiPathBuilder("").param(executionQueryParameters);
    +39          Assert.assertEquals("?excludeJobListFilter=a&excludeJobListFilter=b", param.toString());
    +40      }
    +41      @Test
    +42      public void dateParameter() {
    +43          ExecutionQuery.Builder description = ExecutionQuery.builder().end(
    +44                  new Date(1347581178168L)
    +45          );
    +46          ExecutionQueryParameters executionQueryParameters = new ExecutionQueryParameters(
    +47                  description.build()
    +48          );
    +49          ApiPathBuilder param = new ApiPathBuilder("").param(executionQueryParameters);
    +50          //nb: timezone should be GMT
    +51          //2012-09-14T00:06:18Z
    +52          Assert.assertEquals("?end=2012-09-14T00%3A06%3A18Z", param.toString());
    +53      }
    +54  }
    +
    +
    + + diff --git a/xref-test/org/rundeck/api/RundeckClientTest.html b/xref-test/org/rundeck/api/RundeckClientTest.html index 9219f90..8a5f7aa 100644 --- a/xref-test/org/rundeck/api/RundeckClientTest.html +++ b/xref-test/org/rundeck/api/RundeckClientTest.html @@ -66,1488 +66,1935 @@ 56 public static final String TEST_TOKEN_5 = "C3O6d5O98Kr6Dpv71sdE4ERdCuU12P6d"; 57 public static final String TEST_TOKEN_6 = "Do4d3NUD5DKk21DR4sNK755RcPk618vn"; 58 public static final String TEST_TOKEN_7 = "8Dp9op111ER6opsDRkddvE86K9sE499s"; -59 -60 @Rule -61 public Recorder recorder = new Recorder(); -62 -63 private RundeckClient client; -64 -65 @Test -66 public void apiVersionDefaultLatest() { -67 RundeckClient blah = createClient("blah", 0); -68 Assert.assertEquals("/api/" + RundeckClient.API_VERSION, blah.getApiEndpoint()); -69 Assert.assertEquals(RundeckClient.API_VERSION, blah.getApiVersion()); -70 blah.setApiVersion(0); -71 Assert.assertEquals(RundeckClient.API_VERSION, blah.getApiVersion()); -72 blah.setApiVersion(-1); -73 Assert.assertEquals(RundeckClient.API_VERSION, blah.getApiVersion()); -74 blah.setApiVersion(RundeckClient.Version.V9.getVersionNumber()); -75 Assert.assertEquals(RundeckClient.Version.V9.getVersionNumber(), blah.getApiVersion()); -76 } -77 @Test -78 @Betamax(tape = "get_projects") -79 public void getProjects() throws Exception { -80 List<RundeckProject> projects = client.getProjects(); -81 Assert.assertEquals(1, projects.size()); -82 Assert.assertEquals("test", projects.get(0).getName()); -83 Assert.assertNull(projects.get(0).getDescription()); -84 } -85 @Test -86 @Betamax(tape = "create_projectv11") -87 public void createProject() throws Exception { -88 -89 RundeckProject project = createClient(TEST_TOKEN_6,11).createProject("monkey1", null); -90 Assert.assertEquals("monkey1", project.getName()); -91 Assert.assertEquals(null, project.getDescription()); -92 Assert.assertNotNull(project.getProjectConfig()); -93 -94 } -95 @Test -96 @Betamax(tape = "delete_projectv11") -97 public void deleteProject() throws Exception { -98 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); -99 client1.deleteProject("delete_me"); -100 RundeckProject delete_me = null; -101 try { -102 delete_me = client1.getProject("delete_me"); -103 Assert.fail(); -104 } catch (RundeckApiException.RundeckApiHttpStatusException e) { -105 Assert.assertEquals(404,e.getStatusCode()); -106 } -107 -108 } -109 -110 @Test -111 @Betamax(tape = "get_project_configv11") -112 public void getProjectConfig() throws Exception { -113 ProjectConfig config = createClient(TEST_TOKEN_6, 11).getProjectConfig("monkey1"); -114 Assert.assertNotNull(config); -115 Assert.assertNotNull(config.getProperties()); -116 Assert.assertEquals(9,config.getProperties().size()); -117 Assert.assertEquals("monkey1", config.getProperties().get("project.name")); -118 } -119 @Test -120 @Betamax(tape = "set_project_configv11") -121 public void setProjectConfig() throws Exception { -122 HashMap<String, String> config = new HashMap<String, String>(); -123 config.put("alphabetty", "spaghetti"); -124 config.put("blha.blee", "a big amazing thingy so there."); -125 ProjectConfig result = createClient(TEST_TOKEN_6, 11).setProjectConfig("monkey1", config); -126 Assert.assertNotNull(result); -127 Assert.assertNotNull(result.getProperties()); -128 Assert.assertEquals(3, result.getProperties().size()); -129 Assert.assertEquals("monkey1", result.getProperties().get("project.name")); -130 Assert.assertEquals("spaghetti", result.getProperties().get("alphabetty")); -131 Assert.assertEquals("a big amazing thingy so there.", result.getProperties().get("blha.blee")); -132 } -133 -134 @Test -135 @Betamax(tape = "get_project_config_keyedv11") -136 public void getProjectConfigKeyed() throws Exception { -137 String value = createClient(TEST_TOKEN_6, 11).getProjectConfig("ABC", "project.name"); -138 Assert.assertNotNull(value); -139 Assert.assertEquals("ABC", value); -140 } -141 @Test -142 @Betamax(tape = "get_project_config_keyed_dne_v11") -143 public void getProjectConfigKeyedDNE() throws Exception { -144 String value = createClient(TEST_TOKEN_6, 11).getProjectConfig("ABC", "does-not-exist"); -145 Assert.assertNull(value); -146 } -147 @Test -148 @Betamax(tape = "set_project_config_keyedv11") -149 public void setProjectConfigKeyed() throws Exception { -150 String value = createClient(TEST_TOKEN_6, 11).setProjectConfig("ABC", "monkey-burrito", "lemon pie"); -151 Assert.assertNotNull(value); -152 Assert.assertEquals("lemon pie", value); -153 } -154 @Test -155 @Betamax(tape = "delete_project_config_keyedv11") -156 public void deleteProjectConfigKeyed() throws Exception { -157 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); -158 Assert.assertEquals("7up", client1.setProjectConfig("ABC", "monkey-burrito", "7up")); -159 client1.deleteProjectConfig("ABC", "monkey-burrito"); -160 String value=client1.getProjectConfig("ABC", "monkey-burrito"); -161 Assert.assertNull(value); -162 } -163 @Test -164 @Betamax(tape = "export_projectv11") -165 public void exportProject() throws Exception { -166 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); -167 File temp = File.createTempFile("test-archive", ".zip"); -168 temp.deleteOnExit(); -169 int i = client1.exportProject("DEF1", temp); -170 Assert.assertEquals(8705, i); -171 } -172 @Test -173 @Betamax(tape = "import_project_suv11",mode = TapeMode.READ_ONLY) -174 public void importProjectSuccess() throws Exception { -175 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); -176 InputStream resourceAsStream = getClass().getResourceAsStream("test-archive.zip"); -177 File temp = File.createTempFile("test-archive", ".zip"); -178 temp.deleteOnExit(); -179 IOUtils.copy(resourceAsStream, new FileOutputStream(temp)); -180 ArchiveImport def1 = client1.importArchive("DEF2", temp, true, true); -181 Assert.assertTrue(def1.isSuccessful()); -182 Assert.assertEquals(0, def1.getErrorMessages().size()); -183 -184 ArchiveImport def2 = client1.importArchive("DEF2", temp, false, true); -185 Assert.assertTrue(def2.isSuccessful()); -186 Assert.assertEquals(0, def2.getErrorMessages().size()); -187 -188 ArchiveImport def3 = client1.importArchive("DEF2", temp, true, false); -189 Assert.assertTrue(def3.isSuccessful()); -190 Assert.assertEquals(0, def3.getErrorMessages().size()); -191 temp.delete(); -192 } -193 @Test -194 @Betamax(tape = "import_project_failure_v11", mode = TapeMode.READ_ONLY) -195 public void importProjectFailure() throws Exception { -196 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); -197 InputStream resourceAsStream = getClass().getResourceAsStream("test-archive.zip"); -198 File temp = File.createTempFile("test-archive", ".zip"); -199 temp.deleteOnExit(); -200 IOUtils.copy(resourceAsStream, new FileOutputStream(temp)); -201 ArchiveImport def1 = client1.importArchive("DEF1", temp, false, true); -202 Assert.assertFalse(def1.isSuccessful()); -203 Assert.assertEquals(10, def1.getErrorMessages().size()); -204 Assert.assertEquals("Job at index [1] at archive path: " + -205 "rundeck-DEF1/jobs/job-6fd1808c-eafb-49ac-abf2-4de7ec75872f.xml had errors: Validation errors: Cannot" + -206 " create a Job with UUID 6fd1808c-eafb-49ac-abf2-4de7ec75872f: a Job already exists with this UUID. " + -207 "Change the UUID or delete the other Job.", def1.getErrorMessages().get(0)); -208 -209 } -210 @Test -211 @Betamax(tape = "get_history") -212 public void getHistory() throws Exception { -213 final RundeckHistory test = client.getHistory("test"); -214 Assert.assertEquals(3, test.getCount()); -215 Assert.assertEquals(20, test.getMax()); -216 Assert.assertEquals(0, test.getOffset()); -217 Assert.assertEquals(5, test.getTotal()); -218 final List<RundeckEvent> events = test.getEvents(); -219 Assert.assertEquals(3, events.size()); -220 } -221 -222 @Test -223 @Betamax(tape = "get_history_joblist", -224 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) -225 public void getHistoryJoblist() throws Exception { -226 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); -227 final RundeckHistory test = client.getHistory("demo", null, null, jobNames, null, null, null, null, null); -228 Assert.assertEquals(2, test.getCount()); -229 Assert.assertEquals(20, test.getMax()); -230 Assert.assertEquals(0, test.getOffset()); -231 Assert.assertEquals(2, test.getTotal()); -232 final List<RundeckEvent> events = test.getEvents(); -233 Assert.assertEquals(2, events.size()); -234 final List<String> names = new ArrayList<String>(); -235 for (final RundeckEvent event : events) { -236 names.add(event.getTitle()); -237 } -238 Assert.assertEquals(Arrays.asList("malk/blah2", "malk/blah"), names); -239 } -240 -241 @Test -242 @Betamax(tape = "get_history_excludeJoblist", -243 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) -244 public void getHistoryExcludeJoblist() throws Exception { -245 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); -246 final RundeckHistory test = client.getHistory("demo", null, null, null, jobNames, null, null, null, null); -247 Assert.assertEquals(2, test.getCount()); -248 Assert.assertEquals(20, test.getMax()); -249 Assert.assertEquals(0, test.getOffset()); -250 Assert.assertEquals(2, test.getTotal()); -251 final List<RundeckEvent> events = test.getEvents(); -252 Assert.assertEquals(2, events.size()); -253 final List<String> names = new ArrayList<String>(); -254 for (final RundeckEvent event : events) { -255 names.add(event.getTitle()); -256 } -257 Assert.assertEquals(Arrays.asList("fliff", "malk/blah3"), names); -258 } -259 -260 @Test -261 @Betamax(tape = "get_history_user", -262 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query }) -263 public void getHistoryUser() throws Exception { -264 final RundeckHistory test = client.getHistory("demo", "bob", (String)null, (List)null, null, null, null, 1L, 0L); -265 Assert.assertEquals(1, test.getCount()); -266 Assert.assertEquals(20, test.getMax()); -267 Assert.assertEquals(0, test.getOffset()); -268 Assert.assertEquals(1, test.getTotal()); -269 final List<RundeckEvent> events = test.getEvents(); -270 Assert.assertEquals(1, events.size()); -271 final List<String> names = new ArrayList<String>(); -272 for (final RundeckEvent event : events) { -273 names.add(event.getUser()); -274 } -275 Assert.assertEquals(Arrays.asList("bob"), names); -276 } -277 +59 public static final String TEST_TOKEN_8 = "GG7uj1y6UGahOs7QlmeN2sIwz1Y2j7zI"; +60 +61 @Rule +62 public Recorder recorder = new Recorder(); +63 +64 private RundeckClient client; +65 +66 @Test +67 public void apiVersionDefaultLatest() { +68 RundeckClient blah = createClient("blah", 0); +69 Assert.assertEquals("/api/" + RundeckClient.API_VERSION, blah.getApiEndpoint()); +70 Assert.assertEquals(RundeckClient.API_VERSION, blah.getApiVersion()); +71 blah.setApiVersion(0); +72 Assert.assertEquals(RundeckClient.API_VERSION, blah.getApiVersion()); +73 blah.setApiVersion(-1); +74 Assert.assertEquals(RundeckClient.API_VERSION, blah.getApiVersion()); +75 blah.setApiVersion(RundeckClient.Version.V9.getVersionNumber()); +76 Assert.assertEquals(RundeckClient.Version.V9.getVersionNumber(), blah.getApiVersion()); +77 } +78 @Test +79 @Betamax(tape = "get_projects") +80 public void getProjects() throws Exception { +81 List<RundeckProject> projects = client.getProjects(); +82 Assert.assertEquals(1, projects.size()); +83 Assert.assertEquals("test", projects.get(0).getName()); +84 Assert.assertNull(projects.get(0).getDescription()); +85 } +86 @Test +87 @Betamax(tape = "create_projectv11") +88 public void createProject() throws Exception { +89 +90 RundeckProject project = createClient(TEST_TOKEN_6,11).createProject("monkey1", null); +91 Assert.assertEquals("monkey1", project.getName()); +92 Assert.assertEquals(null, project.getDescription()); +93 Assert.assertNotNull(project.getProjectConfig()); +94 +95 } +96 @Test +97 @Betamax(tape = "delete_projectv11") +98 public void deleteProject() throws Exception { +99 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); +100 client1.deleteProject("delete_me"); +101 RundeckProject delete_me = null; +102 try { +103 delete_me = client1.getProject("delete_me"); +104 Assert.fail(); +105 } catch (RundeckApiException.RundeckApiHttpStatusException e) { +106 Assert.assertEquals(404,e.getStatusCode()); +107 } +108 +109 } +110 +111 @Test +112 @Betamax(tape = "get_project_configv11") +113 public void getProjectConfig() throws Exception { +114 ProjectConfig config = createClient(TEST_TOKEN_6, 11).getProjectConfig("monkey1"); +115 Assert.assertNotNull(config); +116 Assert.assertNotNull(config.getProperties()); +117 Assert.assertEquals(9,config.getProperties().size()); +118 Assert.assertEquals("monkey1", config.getProperties().get("project.name")); +119 } +120 @Test +121 @Betamax(tape = "set_project_configv11") +122 public void setProjectConfig() throws Exception { +123 HashMap<String, String> config = new HashMap<String, String>(); +124 config.put("alphabetty", "spaghetti"); +125 config.put("blha.blee", "a big amazing thingy so there."); +126 ProjectConfig result = createClient(TEST_TOKEN_6, 11).setProjectConfig("monkey1", config); +127 Assert.assertNotNull(result); +128 Assert.assertNotNull(result.getProperties()); +129 Assert.assertEquals(3, result.getProperties().size()); +130 Assert.assertEquals("monkey1", result.getProperties().get("project.name")); +131 Assert.assertEquals("spaghetti", result.getProperties().get("alphabetty")); +132 Assert.assertEquals("a big amazing thingy so there.", result.getProperties().get("blha.blee")); +133 } +134 +135 @Test +136 @Betamax(tape = "get_project_config_keyedv11") +137 public void getProjectConfigKeyed() throws Exception { +138 String value = createClient(TEST_TOKEN_6, 11).getProjectConfig("ABC", "project.name"); +139 Assert.assertNotNull(value); +140 Assert.assertEquals("ABC", value); +141 } +142 @Test +143 @Betamax(tape = "get_project_config_keyed_dne_v11") +144 public void getProjectConfigKeyedDNE() throws Exception { +145 String value = createClient(TEST_TOKEN_6, 11).getProjectConfig("ABC", "does-not-exist"); +146 Assert.assertNull(value); +147 } +148 @Test +149 @Betamax(tape = "set_project_config_keyedv11") +150 public void setProjectConfigKeyed() throws Exception { +151 String value = createClient(TEST_TOKEN_6, 11).setProjectConfig("ABC", "monkey-burrito", "lemon pie"); +152 Assert.assertNotNull(value); +153 Assert.assertEquals("lemon pie", value); +154 } +155 @Test +156 @Betamax(tape = "delete_project_config_keyedv11") +157 public void deleteProjectConfigKeyed() throws Exception { +158 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); +159 Assert.assertEquals("7up", client1.setProjectConfig("ABC", "monkey-burrito", "7up")); +160 client1.deleteProjectConfig("ABC", "monkey-burrito"); +161 String value=client1.getProjectConfig("ABC", "monkey-burrito"); +162 Assert.assertNull(value); +163 } +164 @Test +165 @Betamax(tape = "export_projectv11") +166 public void exportProject() throws Exception { +167 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); +168 File temp = File.createTempFile("test-archive", ".zip"); +169 temp.deleteOnExit(); +170 int i = client1.exportProject("DEF1", temp); +171 Assert.assertEquals(8705, i); +172 } +173 @Test +174 @Betamax(tape = "import_project_suv11",mode = TapeMode.READ_ONLY) +175 public void importProjectSuccess() throws Exception { +176 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); +177 InputStream resourceAsStream = getClass().getResourceAsStream("test-archive.zip"); +178 File temp = File.createTempFile("test-archive", ".zip"); +179 temp.deleteOnExit(); +180 IOUtils.copy(resourceAsStream, new FileOutputStream(temp)); +181 ArchiveImport def1 = client1.importArchive("DEF2", temp, true, true); +182 Assert.assertTrue(def1.isSuccessful()); +183 Assert.assertEquals(0, def1.getErrorMessages().size()); +184 +185 ArchiveImport def2 = client1.importArchive("DEF2", temp, false, true); +186 Assert.assertTrue(def2.isSuccessful()); +187 Assert.assertEquals(0, def2.getErrorMessages().size()); +188 +189 ArchiveImport def3 = client1.importArchive("DEF2", temp, true, false); +190 Assert.assertTrue(def3.isSuccessful()); +191 Assert.assertEquals(0, def3.getErrorMessages().size()); +192 temp.delete(); +193 } +194 @Test +195 @Betamax(tape = "import_project_failure_v11", mode = TapeMode.READ_ONLY) +196 public void importProjectFailure() throws Exception { +197 RundeckClient client1 = createClient(TEST_TOKEN_6, 11); +198 InputStream resourceAsStream = getClass().getResourceAsStream("test-archive.zip"); +199 File temp = File.createTempFile("test-archive", ".zip"); +200 temp.deleteOnExit(); +201 IOUtils.copy(resourceAsStream, new FileOutputStream(temp)); +202 ArchiveImport def1 = client1.importArchive("DEF1", temp, false, true); +203 Assert.assertFalse(def1.isSuccessful()); +204 Assert.assertEquals(10, def1.getErrorMessages().size()); +205 Assert.assertEquals("Job at index [1] at archive path: " + +206 "rundeck-DEF1/jobs/job-6fd1808c-eafb-49ac-abf2-4de7ec75872f.xml had errors: Validation errors: Cannot" + +207 " create a Job with UUID 6fd1808c-eafb-49ac-abf2-4de7ec75872f: a Job already exists with this UUID. " + +208 "Change the UUID or delete the other Job.", def1.getErrorMessages().get(0)); +209 +210 } +211 @Test +212 @Betamax(tape = "get_history") +213 public void getHistory() throws Exception { +214 final RundeckHistory test = client.getHistory("test"); +215 Assert.assertEquals(3, test.getCount()); +216 Assert.assertEquals(20, test.getMax()); +217 Assert.assertEquals(0, test.getOffset()); +218 Assert.assertEquals(5, test.getTotal()); +219 final List<RundeckEvent> events = test.getEvents(); +220 Assert.assertEquals(3, events.size()); +221 } +222 +223 @Test +224 @Betamax(tape = "get_history_joblist", +225 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) +226 public void getHistoryJoblist() throws Exception { +227 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); +228 final RundeckHistory test = client.getHistory("demo", null, null, jobNames, null, null, null, null, null); +229 Assert.assertEquals(2, test.getCount()); +230 Assert.assertEquals(20, test.getMax()); +231 Assert.assertEquals(0, test.getOffset()); +232 Assert.assertEquals(2, test.getTotal()); +233 final List<RundeckEvent> events = test.getEvents(); +234 Assert.assertEquals(2, events.size()); +235 final List<String> names = new ArrayList<String>(); +236 for (final RundeckEvent event : events) { +237 names.add(event.getTitle()); +238 } +239 Assert.assertEquals(Arrays.asList("malk/blah2", "malk/blah"), names); +240 } +241 +242 @Test +243 @Betamax(tape = "get_history_excludeJoblist", +244 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query /*, MatchRule.body */}) +245 public void getHistoryExcludeJoblist() throws Exception { +246 final List<String> jobNames = Arrays.asList("malk/blah", "malk/blah2"); +247 final RundeckHistory test = client.getHistory("demo", null, null, null, jobNames, null, null, null, null); +248 Assert.assertEquals(2, test.getCount()); +249 Assert.assertEquals(20, test.getMax()); +250 Assert.assertEquals(0, test.getOffset()); +251 Assert.assertEquals(2, test.getTotal()); +252 final List<RundeckEvent> events = test.getEvents(); +253 Assert.assertEquals(2, events.size()); +254 final List<String> names = new ArrayList<String>(); +255 for (final RundeckEvent event : events) { +256 names.add(event.getTitle()); +257 } +258 Assert.assertEquals(Arrays.asList("fliff", "malk/blah3"), names); +259 } +260 +261 @Test +262 @Betamax(tape = "get_history_user", +263 match = {MatchRule.uri, MatchRule.method, MatchRule.path, MatchRule.query }) +264 public void getHistoryUser() throws Exception { +265 final RundeckHistory test = client.getHistory("demo", "bob", (String)null, (List)null, null, null, null, 1L, 0L); +266 Assert.assertEquals(1, test.getCount()); +267 Assert.assertEquals(20, test.getMax()); +268 Assert.assertEquals(0, test.getOffset()); +269 Assert.assertEquals(1, test.getTotal()); +270 final List<RundeckEvent> events = test.getEvents(); +271 Assert.assertEquals(1, events.size()); +272 final List<String> names = new ArrayList<String>(); +273 for (final RundeckEvent event : events) { +274 names.add(event.getUser()); +275 } +276 Assert.assertEquals(Arrays.asList("bob"), names); +277 } 278 @Test -279 @Betamax(tape = "get_executions", -280 mode = TapeMode.READ_ONLY, -281 match = {MatchRule.uri, MatchRule.headers, MatchRule.method, MatchRule.path, MatchRule.query}) -282 public void getExecutions() throws Exception { -283 -284 RundeckClient client = createClient(TEST_TOKEN_1, 5); -285 -286 -287 final String projectName = "blah"; -288 final PagedResults<RundeckExecution> jobTest = client.getExecutions(ExecutionQuery.builder() -289 .project(projectName) -290 .job("test job") -291 .build(), -292 2L, -293 0L); -294 assertPageResults(jobTest, 2, 2, 2, 0, 2); -295 final PagedResults<RundeckExecution> jobExactTest = client.getExecutions(ExecutionQuery.builder() -296 .project(projectName) -297 .jobExact("test job") -298 .build(), -299 2L, -300 0L); -301 assertPageResults(jobExactTest, 2, 2, 2, 0, 2); -302 final PagedResults<RundeckExecution> excludeJobTest = client.getExecutions(ExecutionQuery.builder() -303 .project(projectName) -304 .excludeJob("test job") -305 .build(), -306 2L, -307 0L); -308 assertPageResults(excludeJobTest, 2, 2, 2, 0, 2); -309 final PagedResults<RundeckExecution> excludeJobExactTest = client.getExecutions(ExecutionQuery.builder() -310 .project(projectName) -311 .excludeJobExact("test job") -312 .build(), -313 2L, -314 0L); -315 assertPageResults(excludeJobExactTest, 2, 2, 2, 0, 2); -316 final PagedResults<RundeckExecution> descriptionTest = client.getExecutions(ExecutionQuery.builder() -317 .project(projectName) -318 .description("a description") -319 .build(), 2L, 0L); -320 assertPageResults(descriptionTest, 2, 2, 2, 0, 2); -321 final PagedResults<RundeckExecution> abortedbyTest = client.getExecutions(ExecutionQuery.builder() -322 .project(projectName) -323 .abortedby("admin") -324 .build(), -325 2L, -326 0L); -327 assertPageResults(abortedbyTest, 1, 1, 2, 0, 1); -328 final PagedResults<RundeckExecution> beginTest = client.getExecutions(ExecutionQuery.builder() -329 .project(projectName) -330 .begin(new Date(1347581178168L)) -331 .build(), 2L, 0L); -332 assertPageResults(beginTest, 2, 2, 2, 0, 2); -333 final PagedResults<RundeckExecution> endTest = client.getExecutions(ExecutionQuery.builder() -334 .project(projectName) -335 .end(new Date(1347581178168L)) -336 .build(), 2L, 0L); -337 assertPageResults(endTest, 2, 2, 2, 0, 2); -338 final List<String> excludeJobIdList = Arrays.asList("123", "456"); -339 final PagedResults<RundeckExecution> excludeJobIdListTest = client.getExecutions(ExecutionQuery.builder() -340 .project(projectName) -341 .excludeJobIdList(excludeJobIdList) -342 .build(), 2L, 0L); -343 assertPageResults(excludeJobIdListTest, 2, 2, 2, 0, 2); -344 final List<String> jobList = Arrays.asList("fruit/mango", "fruit/lemon"); -345 final PagedResults<RundeckExecution> jobListTest = client.getExecutions(ExecutionQuery.builder() -346 .project(projectName) -347 .jobList(jobList) -348 .build(), 2L, 0L); -349 assertPageResults(jobListTest, 2, 2, 2, 0, 2); -350 final List<String> excludeJobList = Arrays.asList("a/path/job1", "path/to/job2"); -351 final PagedResults<RundeckExecution> excludeJobListTest = client.getExecutions(ExecutionQuery.builder() -352 .project(projectName) -353 .excludeJobList(excludeJobList) -354 .build(), 2L, 0L); -355 assertPageResults(excludeJobListTest, 2, 2, 2, 0, 2); -356 final List<String> list = Arrays.asList("1f4415d7-3b52-4fc8-ba42-b6ac97508bff", -357 "d9fc5ee6-f1db-4d24-8808-feda18345bab"); -358 final PagedResults<RundeckExecution> jobIdListTest = client.getExecutions(ExecutionQuery.builder() -359 .project(projectName) -360 .jobIdList(list) -361 .build(), 2L, 0L); -362 assertPageResults(jobIdListTest, 2, 2, 2, 0, 2); -363 final PagedResults<RundeckExecution> groupPathTest = client.getExecutions(ExecutionQuery.builder() -364 .project(projectName) -365 .groupPath("fruit") -366 .build(), -367 2L, -368 0L); -369 assertPageResults(groupPathTest, 2, 2, 2, 0, 2); -370 final PagedResults<RundeckExecution> groupPathExactTest = client.getExecutions(ExecutionQuery.builder() -371 .project(projectName) -372 .groupPathExact("fruit") -373 .build(), 2L, 0L); -374 assertPageResults(groupPathExactTest, 2, 2, 2, 0, 2); -375 -376 final PagedResults<RundeckExecution> excludeGroupPathTest = client.getExecutions(ExecutionQuery.builder() -377 .project(projectName) -378 .excludeGroupPath("fruit") -379 .build(), -380 2L, -381 0L); -382 assertPageResults(excludeGroupPathTest, 2, 2, 2, 0, 2); -383 final PagedResults<RundeckExecution> excliudeGroupPathExactTest = client.getExecutions(ExecutionQuery.builder() -384 .project(projectName) -385 .excludeGroupPathExact("fruit") -386 .build(), 2L, 0L); -387 assertPageResults(excliudeGroupPathExactTest, 2, 2, 2, 0, 2); -388 -389 final PagedResults<RundeckExecution> recentTest = client.getExecutions(ExecutionQuery.builder() -390 .project(projectName) -391 .recent("1h").build(), 2L, 0L); -392 assertPageResults(recentTest, 2, 2, 2, 0, 2); -393 final PagedResults<RundeckExecution> statusTest = client.getExecutions(ExecutionQuery.builder() -394 .project(projectName) -395 .status(RundeckExecution.ExecutionStatus.SUCCEEDED) -396 .build(), 2L, 0L); -397 assertPageResults(statusTest, 2, 2, 2, 0, 2); -398 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() -399 .project(projectName) -400 .adhoc(true) -401 .build(), 2L, 0L); -402 assertPageResults(adhocTest, 2, 2, 2, 0, 2); -403 } -404 -405 /** -406 * Test paging values from results -407 */ -408 @Test -409 @Betamax(tape = "get_executions_paging") -410 public void getExecutionsPaging() throws Exception{ -411 RundeckClient client = createClient(TEST_TOKEN_1, 5); -412 final String projectName = "blah"; -413 //2 max, 1 offset -414 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() -415 .project(projectName) -416 .excludeGroupPathExact("fruit") -417 .build(), 2L, 1L); -418 //expect 2 count, 3 total -419 assertPageResults(adhocTest, 2, 2, 2, 1, 3); -420 -421 //FAKE results, testing paging attributes parsing -422 -423 //1 max, 1 offset -424 final PagedResults<RundeckExecution> test2 = client.getExecutions(ExecutionQuery.builder() -425 .project(projectName) -426 .excludeGroupPathExact("fruit") -427 .build(), 1L, 1L); -428 //expect no paging attributes -429 assertPageResults(test2, 2, -1, -1, -1, -1); -430 -431 //1 max, 2 offset -432 final PagedResults<RundeckExecution> test3 = client.getExecutions(ExecutionQuery.builder() -433 .project(projectName) -434 .excludeGroupPathExact("fruit") -435 .build(), 1L, 2L); -436 //invalid value for count -437 assertPageResults(test3, 2, -1, -1, -1, -1); -438 } -439 @Test -440 @Betamax(tape = "bulk_delete") -441 public void bulkDelete() throws Exception { -442 RundeckClient client = createClient(TEST_TOKEN_2, 5); -443 -444 final RundeckJobDeleteBulk deleteTest -445 = client.deleteJobs(Arrays.asList("0ce457b5-ba84-41ca-812e-02b31da355a4")); -446 Assert.assertTrue(deleteTest.isAllsuccessful()); -447 Assert.assertEquals(1, deleteTest.getRequestCount()); -448 Assert.assertEquals(1, deleteTest.getResults().size()); -449 -450 final RundeckJobDelete delete = deleteTest.getResults().get(0); -451 Assert.assertTrue(delete.isSuccessful()); -452 Assert.assertNull(delete.getError()); -453 Assert.assertNull(delete.getErrorCode()); -454 Assert.assertNotNull(delete.getMessage()); -455 Assert.assertEquals("0ce457b5-ba84-41ca-812e-02b31da355a4", delete.getId()); -456 } -457 @Test -458 @Betamax(tape = "bulk_delete_dne") -459 public void bulkDeleteFailDNE() throws Exception { -460 RundeckClient client = createClient(TEST_TOKEN_2, 5); -461 -462 final RundeckJobDeleteBulk deleteTest -463 = client.deleteJobs(Arrays.asList("does-not-exist")); -464 Assert.assertFalse(deleteTest.isAllsuccessful()); -465 Assert.assertEquals(1, deleteTest.getRequestCount()); -466 Assert.assertEquals(1, deleteTest.getResults().size()); -467 -468 final RundeckJobDelete delete = deleteTest.getResults().get(0); -469 Assert.assertFalse(delete.isSuccessful()); -470 Assert.assertNotNull(delete.getError()); -471 Assert.assertEquals("notfound", delete.getErrorCode()); -472 Assert.assertNull(delete.getMessage()); -473 Assert.assertEquals("does-not-exist", delete.getId()); -474 } -475 @Test -476 @Betamax(tape = "bulk_delete_unauthorized") -477 public void bulkDeleteFailUnauthorized() throws Exception { -478 RundeckClient client = createClient(TEST_TOKEN_2, 5); -479 -480 final RundeckJobDeleteBulk deleteTest -481 = client.deleteJobs(Arrays.asList("3a6d16be-4268-4d26-86a9-cebc1781f768")); -482 Assert.assertFalse(deleteTest.isAllsuccessful()); -483 Assert.assertEquals(1, deleteTest.getRequestCount()); -484 Assert.assertEquals(1, deleteTest.getResults().size()); -485 -486 final RundeckJobDelete delete = deleteTest.getResults().get(0); -487 Assert.assertFalse(delete.isSuccessful()); -488 Assert.assertNotNull(delete.getError()); -489 Assert.assertEquals("unauthorized", delete.getErrorCode()); -490 Assert.assertNull(delete.getMessage()); -491 Assert.assertEquals("3a6d16be-4268-4d26-86a9-cebc1781f768", delete.getId()); -492 } -493 -494 @Test -495 @Betamax(tape = "trigger_job_basic") -496 public void triggerJobBasic() throws Exception { -497 RundeckClient client = createClient(TEST_TOKEN_3, 5); -498 -499 final RundeckExecution test -500 = client.triggerJob(RunJobBuilder.builder().setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9").build()); -501 -502 Assert.assertEquals((Long) 19L, test.getId()); -503 Assert.assertEquals(null, test.getArgstring()); -504 Assert.assertEquals(null, test.getAbortedBy()); -505 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); -506 Assert.assertEquals("admin", test.getStartedBy()); -507 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); -508 -509 } -510 -511 @Test -512 @Betamax(tape = "trigger_job_as_user") -513 public void triggerJobAsUser() throws Exception { -514 RundeckClient client = createClient(TEST_TOKEN_3, 5); -515 -516 final RundeckExecution test -517 = client.triggerJob(RunJobBuilder.builder() -518 .setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9") -519 .setAsUser("api-java-client-user-test1") -520 .build()); -521 -522 Assert.assertEquals((Long)20L, test.getId()); -523 Assert.assertEquals(null, test.getArgstring()); -524 Assert.assertEquals(null, test.getAbortedBy()); -525 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); -526 Assert.assertEquals("api-java-client-user-test1", test.getStartedBy()); -527 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); -528 -529 } -530 -531 @Test -532 @Betamax(tape = "trigger_job_as_user_unauthorized") -533 public void triggerJobAsUserUnauthorized() throws Exception { -534 RundeckClient client = createClient(TEST_TOKEN_3, 5); -535 -536 final RundeckExecution test; -537 try { -538 test = client.triggerJob(RunJobBuilder.builder() -539 .setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9") -540 .setAsUser("api-java-client-user-test2") -541 .build()); -542 Assert.fail("should not succeed"); -543 } catch (RundeckApiException e) { -544 Assert.assertEquals("Not authorized for action \"Run as User\" for Job ID 3170ba0e-6093-4b58-94d2-52988aefbfc9", e.getMessage()); -545 } -546 } -547 -548 -549 -550 @Test -551 @Betamax(tape = "trigger_adhoc_command") -552 public void triggerAdhocCommand() throws Exception { -553 RundeckClient client = createClient(TEST_TOKEN_3, 5); -554 -555 final RundeckExecution test -556 = client.triggerAdhocCommand(RunAdhocCommandBuilder.builder() -557 .setProject("test") -558 .setCommand("echo test trigger_adhoc_command") -559 .build()); -560 -561 Assert.assertEquals((Long) 23L, test.getId()); -562 Assert.assertEquals(null, test.getArgstring()); -563 Assert.assertEquals(null, test.getAbortedBy()); -564 Assert.assertEquals("echo test trigger_adhoc_command", test.getDescription()); -565 Assert.assertEquals("admin", test.getStartedBy()); -566 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); -567 } -568 -569 -570 @Test -571 @Betamax(tape = "trigger_adhoc_command_as_user") -572 public void triggerAdhocCommandAsUser() throws Exception { -573 RundeckClient client = createClient(TEST_TOKEN_3, 5); -574 -575 final RundeckExecution test -576 = client.triggerAdhocCommand( -577 RunAdhocCommandBuilder.builder() -578 .setProject("test") -579 .setCommand("echo test trigger_adhoc_command_as_user") -580 .setAsUser("api-java-client-test-run-command-as-user1") -581 .build() -582 ); -583 -584 Assert.assertEquals((Long) 24L, test.getId()); -585 Assert.assertEquals(null, test.getArgstring()); -586 Assert.assertEquals(null, test.getAbortedBy()); -587 Assert.assertEquals("echo test trigger_adhoc_command_as_user", test.getDescription()); -588 Assert.assertEquals("api-java-client-test-run-command-as-user1", test.getStartedBy()); -589 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); -590 } -591 -592 @Test -593 @Betamax(tape = "trigger_adhoc_command_as_user_unauthorized") -594 public void triggerAdhocCommandAsUserUnauthorized() throws Exception { -595 RundeckClient client = createClient(TEST_TOKEN_3, 5); -596 -597 final RundeckExecution test; -598 try { -599 test = client.triggerAdhocCommand( -600 RunAdhocCommandBuilder.builder() -601 .setProject("test") -602 .setCommand("echo test trigger_adhoc_command_as_user") -603 .setAsUser("api-java-client-test-run-command-as-user1") -604 .build() -605 ); -606 Assert.fail("should not succeed"); -607 } catch (RundeckApiException e) { -608 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); -609 } -610 } -611 -612 -613 @Test -614 @Betamax(tape = "trigger_adhoc_script") -615 public void triggerAdhocScript() throws Exception { -616 RundeckClient client = createClient(TEST_TOKEN_3, 5); -617 String script = "#!/bin/bash\n" + -618 "echo test trigger_adhoc_script\n"; -619 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); -620 -621 final RundeckExecution test -622 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript -623 (byteArrayInputStream).build()); -624 -625 Assert.assertEquals((Long) 25L, test.getId()); -626 Assert.assertEquals(null, test.getArgstring()); -627 Assert.assertEquals(null, test.getAbortedBy()); -628 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); -629 Assert.assertEquals("admin", test.getStartedBy()); -630 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); -631 } -632 -633 @Test -634 @Betamax(tape = "trigger_adhoc_script_as_user") -635 public void triggerAdhocScriptAsUser() throws Exception { -636 RundeckClient client = createClient(TEST_TOKEN_3, 5); -637 String script = "#!/bin/bash\n" + -638 "echo test trigger_adhoc_script\n"; -639 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); -640 -641 final RundeckExecution test -642 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript -643 (byteArrayInputStream).setAsUser("api-java-client-test-adhoc-script-as-user1").build()); -644 -645 Assert.assertEquals((Long) 26L, test.getId()); -646 Assert.assertEquals(null, test.getArgstring()); -647 Assert.assertEquals(null, test.getAbortedBy()); -648 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); -649 Assert.assertEquals("api-java-client-test-adhoc-script-as-user1", test.getStartedBy()); -650 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); -651 } -652 -653 @Test -654 @Betamax(tape = "trigger_adhoc_script_as_user_unauthorized") -655 public void triggerAdhocScriptAsUserUnauthorized() throws Exception { -656 RundeckClient client = createClient(TEST_TOKEN_3, 5); -657 String script = "#!/bin/bash\n" + -658 "echo test trigger_adhoc_script\n"; -659 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +279 @Betamax(tape="get_execution") +280 public void getExecution() throws Exception{ +281 RundeckClient client = createClient(TEST_TOKEN_7, 5); +282 RundeckExecution execution = client.getExecution(945L); +283 Assert.assertEquals("echo test trigger_adhoc_command", execution.getDescription()); +284 Assert.assertEquals("2 seconds", execution.getDuration()); +285 Assert.assertEquals("test", execution.getProject()); +286 Assert.assertEquals("admin", execution.getStartedBy()); +287 Assert.assertEquals(null, execution.getJob()); +288 Assert.assertEquals(null, execution.getAbortedBy()); +289 } +290 @Test +291 @Betamax(tape="get_execution_v11") +292 public void getExecution_v11() throws Exception{ +293 RundeckClient client = createClient(TEST_TOKEN_7, 11); +294 RundeckExecution execution = client.getExecution(945L); +295 Assert.assertEquals("echo test trigger_adhoc_command", execution.getDescription()); +296 Assert.assertEquals("2 seconds", execution.getDuration()); +297 Assert.assertEquals("test", execution.getProject()); +298 Assert.assertEquals("admin", execution.getStartedBy()); +299 Assert.assertEquals(null, execution.getJob()); +300 Assert.assertEquals(null, execution.getAbortedBy()); +301 } +302 +303 /** +304 * Test incorrect &lt;result&gt; wrapper is handled correctly +305 * @throws Exception +306 */ +307 @Test +308 @Betamax(tape="get_execution_v11_buggy") +309 public void getExecution_v11_buggy() throws Exception{ +310 RundeckClient client = createClient(TEST_TOKEN_7, 11); +311 RundeckExecution execution = client.getExecution(945L); +312 Assert.assertEquals("echo test trigger_adhoc_command", execution.getDescription()); +313 Assert.assertEquals("2 seconds", execution.getDuration()); +314 Assert.assertEquals("test", execution.getProject()); +315 Assert.assertEquals("admin", execution.getStartedBy()); +316 Assert.assertEquals(null, execution.getJob()); +317 Assert.assertEquals(null, execution.getAbortedBy()); +318 } +319 @Test +320 @Betamax(tape = "get_executions", +321 mode = TapeMode.READ_ONLY, +322 match = {MatchRule.uri, MatchRule.headers, MatchRule.method, MatchRule.path, MatchRule.query}) +323 public void getExecutions() throws Exception { +324 +325 RundeckClient client = createClient(TEST_TOKEN_1, 5); +326 +327 +328 final String projectName = "blah"; +329 final PagedResults<RundeckExecution> jobTest = client.getExecutions(ExecutionQuery.builder() +330 .project(projectName) +331 .job("test job") +332 .build(), +333 2L, +334 0L); +335 assertPageResults(jobTest, 2, 2, 2, 0, 2); +336 final PagedResults<RundeckExecution> jobExactTest = client.getExecutions(ExecutionQuery.builder() +337 .project(projectName) +338 .jobExact("test job") +339 .build(), +340 2L, +341 0L); +342 assertPageResults(jobExactTest, 2, 2, 2, 0, 2); +343 final PagedResults<RundeckExecution> excludeJobTest = client.getExecutions(ExecutionQuery.builder() +344 .project(projectName) +345 .excludeJob("test job") +346 .build(), +347 2L, +348 0L); +349 assertPageResults(excludeJobTest, 2, 2, 2, 0, 2); +350 final PagedResults<RundeckExecution> excludeJobExactTest = client.getExecutions(ExecutionQuery.builder() +351 .project(projectName) +352 .excludeJobExact("test job") +353 .build(), +354 2L, +355 0L); +356 assertPageResults(excludeJobExactTest, 2, 2, 2, 0, 2); +357 final PagedResults<RundeckExecution> descriptionTest = client.getExecutions(ExecutionQuery.builder() +358 .project(projectName) +359 .description("a description") +360 .build(), 2L, 0L); +361 assertPageResults(descriptionTest, 2, 2, 2, 0, 2); +362 final PagedResults<RundeckExecution> abortedbyTest = client.getExecutions(ExecutionQuery.builder() +363 .project(projectName) +364 .abortedby("admin") +365 .build(), +366 2L, +367 0L); +368 assertPageResults(abortedbyTest, 1, 1, 2, 0, 1); +369 final PagedResults<RundeckExecution> beginTest = client.getExecutions(ExecutionQuery.builder() +370 .project(projectName) +371 .begin(new Date(1347581178168L)) +372 .build(), 2L, 0L); +373 assertPageResults(beginTest, 2, 2, 2, 0, 2); +374 final PagedResults<RundeckExecution> endTest = client.getExecutions(ExecutionQuery.builder() +375 .project(projectName) +376 .end(new Date(1347581178168L)) +377 .build(), 2L, 0L); +378 assertPageResults(endTest, 2, 2, 2, 0, 2); +379 final List<String> excludeJobIdList = Arrays.asList("123", "456"); +380 final PagedResults<RundeckExecution> excludeJobIdListTest = client.getExecutions(ExecutionQuery.builder() +381 .project(projectName) +382 .excludeJobIdList(excludeJobIdList) +383 .build(), 2L, 0L); +384 assertPageResults(excludeJobIdListTest, 2, 2, 2, 0, 2); +385 final List<String> jobList = Arrays.asList("fruit/mango", "fruit/lemon"); +386 final PagedResults<RundeckExecution> jobListTest = client.getExecutions(ExecutionQuery.builder() +387 .project(projectName) +388 .jobList(jobList) +389 .build(), 2L, 0L); +390 assertPageResults(jobListTest, 2, 2, 2, 0, 2); +391 final List<String> excludeJobList = Arrays.asList("a/path/job1", "path/to/job2"); +392 final PagedResults<RundeckExecution> excludeJobListTest = client.getExecutions(ExecutionQuery.builder() +393 .project(projectName) +394 .excludeJobList(excludeJobList) +395 .build(), 2L, 0L); +396 assertPageResults(excludeJobListTest, 2, 2, 2, 0, 2); +397 final List<String> list = Arrays.asList("1f4415d7-3b52-4fc8-ba42-b6ac97508bff", +398 "d9fc5ee6-f1db-4d24-8808-feda18345bab"); +399 final PagedResults<RundeckExecution> jobIdListTest = client.getExecutions(ExecutionQuery.builder() +400 .project(projectName) +401 .jobIdList(list) +402 .build(), 2L, 0L); +403 assertPageResults(jobIdListTest, 2, 2, 2, 0, 2); +404 final PagedResults<RundeckExecution> groupPathTest = client.getExecutions(ExecutionQuery.builder() +405 .project(projectName) +406 .groupPath("fruit") +407 .build(), +408 2L, +409 0L); +410 assertPageResults(groupPathTest, 2, 2, 2, 0, 2); +411 final PagedResults<RundeckExecution> groupPathExactTest = client.getExecutions(ExecutionQuery.builder() +412 .project(projectName) +413 .groupPathExact("fruit") +414 .build(), 2L, 0L); +415 assertPageResults(groupPathExactTest, 2, 2, 2, 0, 2); +416 +417 final PagedResults<RundeckExecution> excludeGroupPathTest = client.getExecutions(ExecutionQuery.builder() +418 .project(projectName) +419 .excludeGroupPath("fruit") +420 .build(), +421 2L, +422 0L); +423 assertPageResults(excludeGroupPathTest, 2, 2, 2, 0, 2); +424 final PagedResults<RundeckExecution> excliudeGroupPathExactTest = client.getExecutions(ExecutionQuery.builder() +425 .project(projectName) +426 .excludeGroupPathExact("fruit") +427 .build(), 2L, 0L); +428 assertPageResults(excliudeGroupPathExactTest, 2, 2, 2, 0, 2); +429 +430 final PagedResults<RundeckExecution> recentTest = client.getExecutions(ExecutionQuery.builder() +431 .project(projectName) +432 .recent("1h").build(), 2L, 0L); +433 assertPageResults(recentTest, 2, 2, 2, 0, 2); +434 final PagedResults<RundeckExecution> statusTest = client.getExecutions(ExecutionQuery.builder() +435 .project(projectName) +436 .status(RundeckExecution.ExecutionStatus.SUCCEEDED) +437 .build(), 2L, 0L); +438 assertPageResults(statusTest, 2, 2, 2, 0, 2); +439 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() +440 .project(projectName) +441 .adhoc(true) +442 .build(), 2L, 0L); +443 assertPageResults(adhocTest, 2, 2, 2, 0, 2); +444 } +445 @Test +446 @Betamax(tape = "get_executions_v11", +447 mode = TapeMode.READ_ONLY, +448 match = {MatchRule.uri, MatchRule.headers, MatchRule.method, MatchRule.path, MatchRule.query}) +449 public void getExecutionsV11() throws Exception { +450 +451 RundeckClient client = createClient(TEST_TOKEN_7, 11); +452 +453 +454 final String projectName = "blah"; +455 final PagedResults<RundeckExecution> jobTest = client.getExecutions(ExecutionQuery.builder() +456 .project(projectName) +457 .job("test job") +458 .build(), +459 2L, +460 0L); +461 assertPageResults(jobTest, 2, 2, 2, 0, 2); +462 final PagedResults<RundeckExecution> jobExactTest = client.getExecutions(ExecutionQuery.builder() +463 .project(projectName) +464 .jobExact("test job") +465 .build(), +466 2L, +467 0L); +468 assertPageResults(jobExactTest, 2, 2, 2, 0, 2); +469 final PagedResults<RundeckExecution> excludeJobTest = client.getExecutions(ExecutionQuery.builder() +470 .project(projectName) +471 .excludeJob("test job") +472 .build(), +473 2L, +474 0L); +475 assertPageResults(excludeJobTest, 2, 2, 2, 0, 2); +476 final PagedResults<RundeckExecution> excludeJobExactTest = client.getExecutions(ExecutionQuery.builder() +477 .project(projectName) +478 .excludeJobExact("test job") +479 .build(), +480 2L, +481 0L); +482 assertPageResults(excludeJobExactTest, 2, 2, 2, 0, 2); +483 final PagedResults<RundeckExecution> descriptionTest = client.getExecutions(ExecutionQuery.builder() +484 .project(projectName) +485 .description("a description") +486 .build(), 2L, 0L); +487 assertPageResults(descriptionTest, 2, 2, 2, 0, 2); +488 final PagedResults<RundeckExecution> abortedbyTest = client.getExecutions(ExecutionQuery.builder() +489 .project(projectName) +490 .abortedby("admin") +491 .build(), +492 2L, +493 0L); +494 assertPageResults(abortedbyTest, 1, 1, 2, 0, 1); +495 final PagedResults<RundeckExecution> beginTest = client.getExecutions(ExecutionQuery.builder() +496 .project(projectName) +497 .begin(new Date(1347581178168L)) +498 .build(), 2L, 0L); +499 assertPageResults(beginTest, 2, 2, 2, 0, 6); +500 final PagedResults<RundeckExecution> endTest = client.getExecutions(ExecutionQuery.builder() +501 .project(projectName) +502 .end(new Date(1415388156385L)) +503 .build(), 2L, 0L); +504 assertPageResults(endTest, 2, 2, 2, 0, 4); +505 final List<String> excludeJobIdList = Arrays.asList("123", "456"); +506 final PagedResults<RundeckExecution> excludeJobIdListTest = client.getExecutions(ExecutionQuery.builder() +507 .project(projectName) +508 .excludeJobIdList(excludeJobIdList) +509 .build(), 2L, 0L); +510 assertPageResults(excludeJobIdListTest, 2, 2, 2, 0, 4); +511 final List<String> jobList = Arrays.asList("fruit/mango", "fruit/lemon"); +512 final PagedResults<RundeckExecution> jobListTest = client.getExecutions(ExecutionQuery.builder() +513 .project(projectName) +514 .jobList(jobList) +515 .build(), 2L, 0L); +516 assertPageResults(jobListTest, 2, 2, 2, 0, 2); +517 final List<String> excludeJobList = Arrays.asList("a/path/job1", "path/to/job2"); +518 final PagedResults<RundeckExecution> excludeJobListTest = client.getExecutions(ExecutionQuery.builder() +519 .project(projectName) +520 .excludeJobList(excludeJobList) +521 .build(), 2L, 0L); +522 assertPageResults(excludeJobListTest, 2, 2, 2, 0, 4); +523 final List<String> list = Arrays.asList("9aa33253-17a3-4dce-890c-e5f10f9f00d6", +524 "2dd94199-00c4-4690-9b4d-beda4812bed0"); +525 final PagedResults<RundeckExecution> jobIdListTest = client.getExecutions(ExecutionQuery.builder() +526 .project(projectName) +527 .jobIdList(list) +528 .build(), 2L, 0L); +529 assertPageResults(jobIdListTest, 2, 2, 2, 0, 2); +530 final PagedResults<RundeckExecution> groupPathTest = client.getExecutions(ExecutionQuery.builder() +531 .project(projectName) +532 .groupPath("fruit") +533 .build(), +534 2L, +535 0L); +536 assertPageResults(groupPathTest, 2, 2, 2, 0, 2); +537 final PagedResults<RundeckExecution> groupPathExactTest = client.getExecutions(ExecutionQuery.builder() +538 .project(projectName) +539 .groupPathExact("fruit") +540 .build(), 2L, 0L); +541 assertPageResults(groupPathExactTest, 2, 2, 2, 0, 2); +542 +543 final PagedResults<RundeckExecution> excludeGroupPathTest = client.getExecutions(ExecutionQuery.builder() +544 .project(projectName) +545 .excludeGroupPath("fruit") +546 .build(), +547 2L, +548 0L); +549 assertPageResults(excludeGroupPathTest, 2, 2, 2, 0, 2); +550 final PagedResults<RundeckExecution> excliudeGroupPathExactTest = client.getExecutions(ExecutionQuery.builder() +551 .project(projectName) +552 .excludeGroupPathExact("fruit") +553 .build(), 2L, 0L); +554 assertPageResults(excliudeGroupPathExactTest, 2, 2, 2, 0, 2); +555 +556 final PagedResults<RundeckExecution> recentTest = client.getExecutions(ExecutionQuery.builder() +557 .project(projectName) +558 .recent("1h").build(), 2L, 0L); +559 assertPageResults(recentTest, 2, 2, 2, 0, 2); +560 final PagedResults<RundeckExecution> statusTest = client.getExecutions(ExecutionQuery.builder() +561 .project(projectName) +562 .status(RundeckExecution.ExecutionStatus.SUCCEEDED) +563 .build(), 2L, 0L); +564 assertPageResults(statusTest, 2, 2, 2, 0, 3); +565 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() +566 .project(projectName) +567 .adhoc(true) +568 .build(), 2L, 0L); +569 assertPageResults(adhocTest, 2, 2, 2, 0, 2); +570 } +571 +572 /** +573 * Test paging values from results +574 */ +575 @Test +576 @Betamax(tape = "get_executions_paging") +577 public void getExecutionsPaging() throws Exception{ +578 RundeckClient client = createClient(TEST_TOKEN_1, 5); +579 final String projectName = "blah"; +580 //2 max, 1 offset +581 final PagedResults<RundeckExecution> adhocTest = client.getExecutions(ExecutionQuery.builder() +582 .project(projectName) +583 .excludeGroupPathExact("fruit") +584 .build(), 2L, 1L); +585 //expect 2 count, 3 total +586 assertPageResults(adhocTest, 2, 2, 2, 1, 3); +587 +588 //FAKE results, testing paging attributes parsing +589 +590 //1 max, 1 offset +591 final PagedResults<RundeckExecution> test2 = client.getExecutions(ExecutionQuery.builder() +592 .project(projectName) +593 .excludeGroupPathExact("fruit") +594 .build(), 1L, 1L); +595 //expect no paging attributes +596 assertPageResults(test2, 2, -1, -1, -1, -1); +597 +598 //1 max, 2 offset +599 final PagedResults<RundeckExecution> test3 = client.getExecutions(ExecutionQuery.builder() +600 .project(projectName) +601 .excludeGroupPathExact("fruit") +602 .build(), 1L, 2L); +603 //invalid value for count +604 assertPageResults(test3, 2, -1, -1, -1, -1); +605 } +606 @Test +607 @Betamax(tape = "bulk_delete") +608 public void bulkDelete() throws Exception { +609 RundeckClient client = createClient(TEST_TOKEN_2, 5); +610 +611 final RundeckJobDeleteBulk deleteTest +612 = client.deleteJobs(Arrays.asList("0ce457b5-ba84-41ca-812e-02b31da355a4")); +613 Assert.assertTrue(deleteTest.isAllsuccessful()); +614 Assert.assertEquals(1, deleteTest.getRequestCount()); +615 Assert.assertEquals(1, deleteTest.getResults().size()); +616 +617 final RundeckJobDelete delete = deleteTest.getResults().get(0); +618 Assert.assertTrue(delete.isSuccessful()); +619 Assert.assertNull(delete.getError()); +620 Assert.assertNull(delete.getErrorCode()); +621 Assert.assertNotNull(delete.getMessage()); +622 Assert.assertEquals("0ce457b5-ba84-41ca-812e-02b31da355a4", delete.getId()); +623 } +624 @Test +625 @Betamax(tape = "bulk_delete_dne") +626 public void bulkDeleteFailDNE() throws Exception { +627 RundeckClient client = createClient(TEST_TOKEN_2, 5); +628 +629 final RundeckJobDeleteBulk deleteTest +630 = client.deleteJobs(Arrays.asList("does-not-exist")); +631 Assert.assertFalse(deleteTest.isAllsuccessful()); +632 Assert.assertEquals(1, deleteTest.getRequestCount()); +633 Assert.assertEquals(1, deleteTest.getResults().size()); +634 +635 final RundeckJobDelete delete = deleteTest.getResults().get(0); +636 Assert.assertFalse(delete.isSuccessful()); +637 Assert.assertNotNull(delete.getError()); +638 Assert.assertEquals("notfound", delete.getErrorCode()); +639 Assert.assertNull(delete.getMessage()); +640 Assert.assertEquals("does-not-exist", delete.getId()); +641 } +642 @Test +643 @Betamax(tape = "bulk_delete_unauthorized") +644 public void bulkDeleteFailUnauthorized() throws Exception { +645 RundeckClient client = createClient(TEST_TOKEN_2, 5); +646 +647 final RundeckJobDeleteBulk deleteTest +648 = client.deleteJobs(Arrays.asList("3a6d16be-4268-4d26-86a9-cebc1781f768")); +649 Assert.assertFalse(deleteTest.isAllsuccessful()); +650 Assert.assertEquals(1, deleteTest.getRequestCount()); +651 Assert.assertEquals(1, deleteTest.getResults().size()); +652 +653 final RundeckJobDelete delete = deleteTest.getResults().get(0); +654 Assert.assertFalse(delete.isSuccessful()); +655 Assert.assertNotNull(delete.getError()); +656 Assert.assertEquals("unauthorized", delete.getErrorCode()); +657 Assert.assertNull(delete.getMessage()); +658 Assert.assertEquals("3a6d16be-4268-4d26-86a9-cebc1781f768", delete.getId()); +659 } 660 -661 try{ -662 final RundeckExecution test -663 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript -664 (byteArrayInputStream).setAsUser("api-java-client-test-adhoc-script-as-user1").build()); -665 Assert.fail("should not succeed"); -666 } catch (RundeckApiException e) { -667 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); -668 } -669 -670 } -671 -672 @Test -673 @Betamax(tape = "trigger_adhoc_script_interpreter") -674 public void triggerAdhocScriptInpterpreter() throws Exception { -675 RundeckClient client = createClient(TEST_TOKEN_3, 8); -676 String script = "#!/bin/bash\n" + -677 "echo test trigger_adhoc_script\n"; -678 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); -679 final RundeckExecution test -680 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder() -681 .setProject("test").setScript(byteArrayInputStream) -682 .setScriptInterpreter("sudo -c bob") -683 .build()); -684 -685 Assert.assertEquals((Long) 27L, test.getId()); -686 Assert.assertEquals(null, test.getArgstring()); -687 Assert.assertEquals(null, test.getAbortedBy()); -688 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); -689 Assert.assertEquals("admin", test.getStartedBy()); -690 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); -691 } -692 @Test -693 @Betamax(tape = "abort_execution") -694 public void abortExecution() throws Exception { -695 RundeckClient client = createClient(TEST_TOKEN_3, 5); -696 -697 long executionId = 21L; -698 final RundeckAbort test = client.abortExecution(executionId); -699 -700 Assert.assertEquals((Long) executionId,test.getExecution().getId()); -701 Assert.assertEquals(RundeckAbort.AbortStatus.PENDING,test.getStatus()); -702 } +661 @Test +662 @Betamax(tape = "trigger_job_basic") +663 public void triggerJobBasic() throws Exception { +664 RundeckClient client = createClient(TEST_TOKEN_3, 5); +665 +666 final RundeckExecution test +667 = client.triggerJob(RunJobBuilder.builder().setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9").build()); +668 +669 Assert.assertEquals((Long) 19L, test.getId()); +670 Assert.assertEquals(null, test.getArgstring()); +671 Assert.assertEquals(null, test.getAbortedBy()); +672 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +673 Assert.assertEquals("admin", test.getStartedBy()); +674 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +675 +676 } +677 +678 /** +679 * API v11 request to trigger job, with expected xml response without &lt;result&gt; wrapper +680 * @throws Exception +681 */ +682 @Test +683 @Betamax(tape = "trigger_job_basic_v11") +684 public void triggerJobBasic_v11() throws Exception { +685 RundeckClient client = createClient(TEST_TOKEN_7, 11); +686 +687 final RundeckExecution test +688 = client.triggerJob(RunJobBuilder.builder().setJobId("bda8b956-43a5-4eef-9c67" + +689 "-3f27cc0ee1a5").build()); +690 +691 Assert.assertEquals((Long) 943L, test.getId()); +692 Assert.assertEquals(null, test.getArgstring()); +693 Assert.assertEquals(null, test.getAbortedBy()); +694 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +695 Assert.assertEquals("admin", test.getStartedBy()); +696 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +697 } +698 +699 /** +700 * Response for API v11 incorrectly includes &lt;result&gt;, but we should handle this case +701 * @throws Exception +702 */ 703 @Test -704 @Betamax(tape = "abort_execution_as_user") -705 public void abortExecutionAsUser() throws Exception { -706 RundeckClient client = createClient(TEST_TOKEN_3, 5); +704 @Betamax(tape = "trigger_job_basic_v11_patch") +705 public void triggerJobBasic_v11_patch() throws Exception { +706 RundeckClient client = createClient(TEST_TOKEN_7, 11); 707 -708 long executionId = 22L; -709 final RundeckAbort test = client.abortExecution(executionId,"api-java-client-test-abort-as-user1"); -710 -711 Assert.assertEquals((Long) executionId,test.getExecution().getId()); -712 Assert.assertEquals(RundeckAbort.AbortStatus.PENDING,test.getStatus()); -713 } -714 @Test -715 @Betamax(tape = "abort_execution_as_user_unauthorized") -716 public void abortExecutionAsUserUnauthorized() throws Exception { -717 RundeckClient client = createClient(TEST_TOKEN_3, 5); -718 -719 long executionId = 28L; -720 final RundeckAbort test = client.abortExecution(executionId, "api-java-client-test-abort-as-user1"); -721 Assert.assertEquals(RundeckAbort.AbortStatus.FAILED, test.getStatus()); -722 } -723 private void assertPageResults(PagedResults<RundeckExecution> jobTest, -724 final int size, -725 final int count, final int max, final int offset, final int total) { -726 Assert.assertEquals(size, jobTest.getResults().size()); -727 Assert.assertEquals(count, jobTest.getCount()); -728 Assert.assertEquals(max, jobTest.getMax()); -729 Assert.assertEquals(offset, jobTest.getOffset()); -730 Assert.assertEquals(total, jobTest.getTotal()); -731 } -732 -733 /** -734 * Import jobs, xml contains project context -735 * @throws Exception -736 */ -737 @Test -738 @Betamax(tape = "import_jobs_context_project") -739 public void importJobsContextProject() throws Exception { -740 final RundeckClient client = createClient(TEST_TOKEN_4, 8); -741 InputStream stream=new ByteArrayInputStream( -742 ("<joblist>\n" + -743 " <job>\n" + -744 " <loglevel>INFO</loglevel>\n" + -745 " <sequence keepgoing='false' strategy='node-first'>\n" + -746 " <command>\n" + -747 " <exec>echo hi</exec>\n" + -748 " </command>\n" + -749 " </sequence>\n" + -750 " <description></description>\n" + -751 " <name>job1</name>\n" + -752 " <context>\n" + -753 " <project>test</project>\n" + -754 " </context>\n" + -755 " </job>\n" + -756 "</joblist>").getBytes("utf-8")); +708 final RundeckExecution test +709 = client.triggerJob(RunJobBuilder.builder().setJobId("bda8b956-43a5-4eef-9c67" + +710 "-3f27cc0ee1a5").build()); +711 +712 Assert.assertEquals((Long) 944L, test.getId()); +713 Assert.assertEquals(null, test.getArgstring()); +714 Assert.assertEquals(null, test.getAbortedBy()); +715 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +716 Assert.assertEquals("admin", test.getStartedBy()); +717 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +718 } +719 +720 @Test +721 @Betamax(tape = "trigger_job_as_user") +722 public void triggerJobAsUser() throws Exception { +723 RundeckClient client = createClient(TEST_TOKEN_3, 5); +724 +725 final RundeckExecution test +726 = client.triggerJob(RunJobBuilder.builder() +727 .setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9") +728 .setAsUser("api-java-client-user-test1") +729 .build()); +730 +731 Assert.assertEquals((Long)20L, test.getId()); +732 Assert.assertEquals(null, test.getArgstring()); +733 Assert.assertEquals(null, test.getAbortedBy()); +734 Assert.assertEquals("echo hi there ${job.username} ; sleep 90", test.getDescription()); +735 Assert.assertEquals("api-java-client-user-test1", test.getStartedBy()); +736 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +737 +738 } +739 +740 @Test +741 @Betamax(tape = "trigger_job_as_user_unauthorized") +742 public void triggerJobAsUserUnauthorized() throws Exception { +743 RundeckClient client = createClient(TEST_TOKEN_3, 5); +744 +745 final RundeckExecution test; +746 try { +747 test = client.triggerJob(RunJobBuilder.builder() +748 .setJobId("3170ba0e-6093-4b58-94d2-52988aefbfc9") +749 .setAsUser("api-java-client-user-test2") +750 .build()); +751 Assert.fail("should not succeed"); +752 } catch (RundeckApiException e) { +753 Assert.assertEquals("Not authorized for action \"Run as User\" for Job ID 3170ba0e-6093-4b58-94d2-52988aefbfc9", e.getMessage()); +754 } +755 } +756 757 -758 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() -759 .setStream(stream) -760 .setFileType(FileType.XML) -761 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) -762 .build(); -763 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); -764 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); -765 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); -766 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); -767 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); -768 Assert.assertEquals("job1", rundeckJob.getName()); -769 Assert.assertEquals("test", rundeckJob.getProject()); -770 } -771 /** -772 * Import jobs, xml no project defined -773 * @throws Exception -774 */ -775 @Test -776 @Betamax(tape = "import_jobs_no_project") -777 public void importJobsNoProject() throws Exception { -778 final RundeckClient client = createClient(TEST_TOKEN_4, 8); -779 InputStream stream=new ByteArrayInputStream( -780 ("<joblist>\n" + -781 " <job>\n" + -782 " <loglevel>INFO</loglevel>\n" + -783 " <sequence keepgoing='false' strategy='node-first'>\n" + -784 " <command>\n" + -785 " <exec>echo hi</exec>\n" + -786 " </command>\n" + -787 " </sequence>\n" + -788 " <description></description>\n" + -789 " <name>job2</name>\n" + -790 " </job>\n" + -791 "</joblist>").getBytes("utf-8")); -792 -793 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() -794 .setStream(stream) -795 .setFileType(FileType.XML) -796 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) -797 .build(); -798 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); -799 Assert.assertEquals(1,rundeckJobsImportResult.getFailedJobs().size()); -800 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); -801 Assert.assertEquals(0,rundeckJobsImportResult.getSucceededJobs().size()); -802 RundeckJob rundeckJob = rundeckJobsImportResult.getFailedJobs().entrySet().iterator().next().getKey(); -803 String reason = rundeckJobsImportResult.getFailedJobs().get(rundeckJob); -804 Assert.assertEquals("job2", rundeckJob.getName()); -805 Assert.assertEquals(null, rundeckJob.getProject()); -806 Assert.assertTrue(reason.contains("Project was not specified")); -807 } -808 /** -809 * Import jobs, using project parameter -810 * @throws Exception -811 */ -812 @Test -813 @Betamax(tape = "import_jobs_project_param") -814 public void importJobsProjectParam() throws Exception { -815 final RundeckClient client = createClient(TEST_TOKEN_4, 8); -816 InputStream stream=new ByteArrayInputStream( -817 ("<joblist>\n" + -818 " <job>\n" + -819 " <loglevel>INFO</loglevel>\n" + -820 " <sequence keepgoing='false' strategy='node-first'>\n" + -821 " <command>\n" + -822 " <exec>echo hi</exec>\n" + -823 " </command>\n" + -824 " </sequence>\n" + -825 " <description></description>\n" + -826 " <name>importJobsProjectParam</name>\n" + -827 " </job>\n" + -828 "</joblist>").getBytes("utf-8")); +758 +759 @Test +760 @Betamax(tape = "trigger_adhoc_command") +761 public void triggerAdhocCommand() throws Exception { +762 RundeckClient client = createClient(TEST_TOKEN_3, 5); +763 +764 final RundeckExecution test +765 = client.triggerAdhocCommand(RunAdhocCommandBuilder.builder() +766 .setProject("test") +767 .setCommand("echo test trigger_adhoc_command") +768 .build()); +769 +770 Assert.assertEquals((Long) 23L, test.getId()); +771 Assert.assertEquals(null, test.getArgstring()); +772 Assert.assertEquals(null, test.getAbortedBy()); +773 Assert.assertEquals("echo test trigger_adhoc_command", test.getDescription()); +774 Assert.assertEquals("admin", test.getStartedBy()); +775 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); +776 } +777 +778 @Test +779 @Betamax(tape = "trigger_adhoc_command_v11_buggy") +780 public void triggerAdhocCommand_v11_buggy() throws Exception { +781 RundeckClient client = createClient(TEST_TOKEN_7, 11); +782 +783 final RundeckExecution test +784 = client.triggerAdhocCommand(RunAdhocCommandBuilder.builder() +785 .setProject("test") +786 .setCommand("echo test trigger_adhoc_command") +787 .build()); +788 +789 Assert.assertEquals((Long) 945L, test.getId()); +790 Assert.assertEquals(null, test.getArgstring()); +791 Assert.assertEquals(null, test.getAbortedBy()); +792 Assert.assertEquals("echo test trigger_adhoc_command", test.getDescription()); +793 Assert.assertEquals("admin", test.getStartedBy()); +794 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +795 } +796 @Test +797 @Betamax(tape = "trigger_adhoc_command_v11") +798 public void triggerAdhocCommand_v11() throws Exception { +799 RundeckClient client = createClient(TEST_TOKEN_7, 11); +800 +801 final RundeckExecution test +802 = client.triggerAdhocCommand(RunAdhocCommandBuilder.builder() +803 .setProject("test") +804 .setCommand("echo test trigger_adhoc_command") +805 .build()); +806 +807 Assert.assertEquals((Long) 946L, test.getId()); +808 Assert.assertEquals(null, test.getArgstring()); +809 Assert.assertEquals(null, test.getAbortedBy()); +810 Assert.assertEquals("echo test trigger_adhoc_command", test.getDescription()); +811 Assert.assertEquals("admin", test.getStartedBy()); +812 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +813 } +814 +815 +816 @Test +817 @Betamax(tape = "trigger_adhoc_command_as_user") +818 public void triggerAdhocCommandAsUser() throws Exception { +819 RundeckClient client = createClient(TEST_TOKEN_3, 5); +820 +821 final RundeckExecution test +822 = client.triggerAdhocCommand( +823 RunAdhocCommandBuilder.builder() +824 .setProject("test") +825 .setCommand("echo test trigger_adhoc_command_as_user") +826 .setAsUser("api-java-client-test-run-command-as-user1") +827 .build() +828 ); 829 -830 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() -831 .setStream(stream) -832 .setFileType(FileType.XML) -833 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) -834 .setProject("test") -835 .build(); -836 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); -837 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); -838 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); -839 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); -840 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); -841 Assert.assertEquals("importJobsProjectParam", rundeckJob.getName()); -842 Assert.assertEquals("test", rundeckJob.getProject()); -843 } -844 /** -845 * Import jobs, project parameter overrides xml -846 * @throws Exception -847 */ -848 @Test -849 @Betamax(tape = "import_jobs_project_param_override") -850 public void importJobsProjectParamOverride() throws Exception { -851 final RundeckClient client = createClient(TEST_TOKEN_4, 8); -852 InputStream stream=new ByteArrayInputStream( -853 ("<joblist>\n" + -854 " <job>\n" + -855 " <loglevel>INFO</loglevel>\n" + -856 " <sequence keepgoing='false' strategy='node-first'>\n" + -857 " <command>\n" + -858 " <exec>echo hi</exec>\n" + -859 " </command>\n" + -860 " </sequence>\n" + -861 " <description></description>\n" + -862 " <name>importJobsProjectParamOverride</name>\n" + -863 " <context>\n" + -864 " <project>testXYZ</project>\n" + -865 " </context>\n" + -866 " </job>\n" + -867 "</joblist>").getBytes("utf-8")); -868 -869 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() -870 .setStream(stream) -871 .setFileType(FileType.XML) -872 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) -873 .setProject("test") -874 .build(); -875 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); -876 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); -877 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); -878 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); -879 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); -880 Assert.assertEquals("importJobsProjectParamOverride", rundeckJob.getName()); -881 Assert.assertEquals("test", rundeckJob.getProject()); -882 } -883 /** -884 * Import jobs, project parameter v7 doesn' use parameter -885 * @throws Exception -886 */ -887 @Test -888 @Betamax(tape = "import_jobs_project_param_v7") -889 public void importJobsProjectParamV7() throws Exception { -890 final RundeckClient client = createClient(TEST_TOKEN_4, 7); -891 InputStream stream=new ByteArrayInputStream( -892 ("<joblist>\n" + -893 " <job>\n" + -894 " <loglevel>INFO</loglevel>\n" + -895 " <sequence keepgoing='false' strategy='node-first'>\n" + -896 " <command>\n" + -897 " <exec>echo hi</exec>\n" + -898 " </command>\n" + -899 " </sequence>\n" + -900 " <description></description>\n" + -901 " <name>importJobsProjectParamV7</name>\n" + -902 " <context>\n" + -903 " <project>testXYZ</project>\n" + -904 " </context>\n" + -905 " </job>\n" + -906 "</joblist>").getBytes("utf-8")); -907 -908 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() -909 .setStream(stream) -910 .setFileType(FileType.XML) -911 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) -912 .setProject("test") -913 .build(); -914 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); -915 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); -916 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); -917 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); -918 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); -919 Assert.assertEquals("importJobsProjectParamV7", rundeckJob.getName()); -920 Assert.assertEquals("testXYZ", rundeckJob.getProject()); -921 } -922 /** -923 * Import jobs, project parameter v7 doesn' use parameter -924 * @throws Exception -925 */ -926 @Test -927 @Betamax(tape = "import_jobs_uuid_param_remove_v9") -928 public void importJobsUUIDParamRemoveV9() throws Exception { -929 final RundeckClient client = createClient(TEST_TOKEN_6, 9); -930 InputStream stream=new ByteArrayInputStream( -931 ("<joblist>\n" + -932 " <job>\n" + -933 " <uuid>testImportUUID</uuid>\n" + -934 " <loglevel>INFO</loglevel>\n" + -935 " <sequence keepgoing='false' strategy='node-first'>\n" + -936 " <command>\n" + -937 " <exec>echo hi</exec>\n" + -938 " </command>\n" + -939 " </sequence>\n" + -940 " <description></description>\n" + -941 " <name>importJobsUUIDParamRemoveV9</name>\n" + -942 " </job>\n" + -943 "</joblist>").getBytes("utf-8")); -944 -945 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() -946 .setStream(stream) -947 .setFileType(FileType.XML) -948 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) -949 .setUUIDImportBehavior(RundeckJobsUUIDImportBehavior.REMOVE) -950 .setProject("test") -951 .build(); -952 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); -953 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); -954 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); -955 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); -956 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); -957 Assert.assertEquals("importJobsUUIDParamRemoveV9", rundeckJob.getName()); -958 Assert.assertFalse("testImportUUID".equals(rundeckJob.getId())); -959 Assert.assertEquals("b33c8bb1-4dfc-4661-a890-4164b264cc4a", rundeckJob.getId()); -960 } -961 /** -962 * Import jobs, project parameter v7 doesn' use parameter -963 * @throws Exception -964 */ -965 @Test -966 @Betamax(tape = "import_jobs_uuid_param_preserve_v9") -967 public void importJobsUUIDParamPreserveV9() throws Exception { -968 final RundeckClient client = createClient(TEST_TOKEN_6, 9); -969 InputStream stream=new ByteArrayInputStream( -970 ("<joblist>\n" + -971 " <job>\n" + -972 " <uuid>testImportUUID</uuid>\n" + -973 " <loglevel>INFO</loglevel>\n" + -974 " <sequence keepgoing='false' strategy='node-first'>\n" + -975 " <command>\n" + -976 " <exec>echo hi</exec>\n" + -977 " </command>\n" + -978 " </sequence>\n" + -979 " <description></description>\n" + -980 " <name>importJobsUUIDParamPreserveV9</name>\n" + -981 " </job>\n" + -982 "</joblist>").getBytes("utf-8")); -983 -984 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() -985 .setStream(stream) -986 .setFileType(FileType.XML) -987 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) -988 .setUUIDImportBehavior(RundeckJobsUUIDImportBehavior.PRESERVE) -989 .setProject("test") -990 .build(); -991 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); -992 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); -993 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); -994 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); -995 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); -996 Assert.assertEquals("importJobsUUIDParamPreserveV9", rundeckJob.getName()); -997 Assert.assertEquals("testImportUUID", rundeckJob.getId()); -998 } -999 /** -1000 * Running executions for all projects using API v9 -1001 * @throws Exception -1002 */ -1003 @Test -1004 @Betamax(tape = "running_executions_v9") -1005 public void runningExecutionsV9() throws Exception { -1006 final RundeckClient client = createClient(TEST_TOKEN_5, 9); -1007 List<RundeckExecution> runningExecutions = client.getRunningExecutions(); -1008 Assert.assertEquals(2, runningExecutions.size()); -1009 RundeckExecution exec1 = runningExecutions.get(0); -1010 Assert.assertEquals("test", exec1.getProject()); -1011 RundeckExecution exec2 = runningExecutions.get(1); -1012 Assert.assertEquals("test2", exec2.getProject()); -1013 } -1014 -1015 /** -1016 * Running executions for all projects using API v8, which queries for project list and then individually -1017 * queries each project's now running -1018 * @throws Exception -1019 */ -1020 @Test -1021 @Betamax(tape = "running_executions_v8") -1022 public void runningExecutionsV8() throws Exception { -1023 final RundeckClient client = createClient(TEST_TOKEN_5, 8); -1024 List<RundeckExecution> runningExecutions = client.getRunningExecutions(); -1025 Assert.assertEquals(2, runningExecutions.size()); -1026 RundeckExecution exec1 = runningExecutions.get(0); -1027 Assert.assertEquals("test", exec1.getProject()); -1028 RundeckExecution exec2 = runningExecutions.get(1); -1029 Assert.assertEquals("test2", exec2.getProject()); -1030 } -1031 /** -1032 * Execution output -1033 */ -1034 @Test -1035 @Betamax(tape = "execution_output_basic", mode = TapeMode.READ_ONLY) -1036 public void executionOutputBasic() throws Exception { -1037 final RundeckClient client = createClient(TEST_TOKEN_6, 10); -1038 RundeckOutput output = client.getJobExecutionOutput(146L,0,0L,-1); -1039 -1040 Assert.assertEquals(new Long(1602), output.getExecDuration()); -1041 Assert.assertEquals(new Long(146), output.getExecutionId()); -1042 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); -1043 Assert.assertEquals(null, output.getFilterNode()); -1044 Assert.assertEquals(null, output.getFilterStep()); -1045 Assert.assertEquals(1409, output.getOffset()); -1046 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); -1047 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); -1048 Assert.assertEquals(1415, output.getTotalSize()); -1049 Assert.assertEquals(true, output.isCompleted()); -1050 Assert.assertEquals(true, output.isExecCompleted()); -1051 Assert.assertEquals(false, output.isEmpty()); -1052 Assert.assertEquals(false, output.isHasFailedNodes()); -1053 Assert.assertEquals(false, output.isUnmodified()); -1054 Assert.assertEquals(3, output.getLogEntries().size()); -1055 } -1056 /** -1057 * Execution output for a node -1058 */ -1059 @Test -1060 @Betamax(tape = "execution_output_fornode", mode = TapeMode.READ_ONLY) -1061 public void executionOutputForNode() throws Exception { -1062 final RundeckClient client = createClient(TEST_TOKEN_6, 10); -1063 RundeckOutput output = client.getExecutionOutputForNode(146L, "node-14.qa.subgroup.mycompany.com", 0, -1, 0L, -1); -1064 -1065 Assert.assertEquals(new Long(1602), output.getExecDuration()); -1066 Assert.assertEquals(new Long(146), output.getExecutionId()); -1067 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); -1068 Assert.assertEquals("node-14.qa.subgroup.mycompany.com", output.getFilterNode()); -1069 Assert.assertEquals(null, output.getFilterStep()); -1070 Assert.assertEquals(1409, output.getOffset()); -1071 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); -1072 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); -1073 Assert.assertEquals(1415, output.getTotalSize()); -1074 Assert.assertEquals(true, output.isCompleted()); -1075 Assert.assertEquals(true, output.isExecCompleted()); -1076 Assert.assertEquals(false, output.isEmpty()); -1077 Assert.assertEquals(false, output.isHasFailedNodes()); -1078 Assert.assertEquals(false, output.isUnmodified()); -1079 Assert.assertEquals(1, output.getLogEntries().size()); -1080 } -1081 /** -1082 * Execution output for a step -1083 */ -1084 @Test -1085 @Betamax(tape = "execution_output_forstep", mode = TapeMode.READ_ONLY) -1086 public void executionOutputForStep() throws Exception { -1087 final RundeckClient client = createClient(TEST_TOKEN_6, 10); -1088 RundeckOutput output = client.getExecutionOutputForStep(146L, "1", 0, -1, 0L, -1); -1089 -1090 Assert.assertEquals(new Long(1602), output.getExecDuration()); -1091 Assert.assertEquals(new Long(146), output.getExecutionId()); -1092 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); -1093 Assert.assertEquals(null, output.getFilterNode()); -1094 Assert.assertEquals("1", output.getFilterStep()); -1095 Assert.assertEquals(1409, output.getOffset()); -1096 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); -1097 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); -1098 Assert.assertEquals(1415, output.getTotalSize()); -1099 Assert.assertEquals(true, output.isCompleted()); -1100 Assert.assertEquals(true, output.isExecCompleted()); -1101 Assert.assertEquals(false, output.isEmpty()); -1102 Assert.assertEquals(false, output.isHasFailedNodes()); -1103 Assert.assertEquals(false, output.isUnmodified()); -1104 Assert.assertEquals(3, output.getLogEntries().size()); -1105 } -1106 -1107 /** -1108 * Execution output for a node and step -1109 */ -1110 @Test -1111 @Betamax(tape = "execution_output_fornodeandstep", mode = TapeMode.READ_ONLY) -1112 public void executionOutputForNodeAndStep() throws Exception { -1113 final RundeckClient client = createClient(TEST_TOKEN_6, 10); -1114 RundeckOutput output = client.getExecutionOutputForNodeAndStep(146L, "node-14.qa.subgroup.mycompany.com", -1115 "1", 0, -1, 0L, -1); -1116 -1117 Assert.assertEquals(new Long(1602), output.getExecDuration()); -1118 Assert.assertEquals(new Long(146), output.getExecutionId()); -1119 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); -1120 Assert.assertEquals("node-14.qa.subgroup.mycompany.com", output.getFilterNode()); -1121 Assert.assertEquals("1", output.getFilterStep()); -1122 Assert.assertEquals(1409, output.getOffset()); -1123 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); -1124 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); -1125 Assert.assertEquals(1415, output.getTotalSize()); -1126 Assert.assertEquals(true, output.isCompleted()); -1127 Assert.assertEquals(true, output.isExecCompleted()); -1128 Assert.assertEquals(false, output.isEmpty()); -1129 Assert.assertEquals(false, output.isHasFailedNodes()); -1130 Assert.assertEquals(false, output.isUnmodified()); -1131 Assert.assertEquals(1, output.getLogEntries().size()); -1132 } -1133 -1134 /** -1135 * Execution output state sequence -1136 */ -1137 @Test -1138 @Betamax(tape = "execution_output_state", mode = TapeMode.READ_ONLY) -1139 public void executionOutputState() throws Exception { -1140 final RundeckClient client = createClient(TEST_TOKEN_6, 10); -1141 RundeckOutput output = client.getExecutionOutputState(146L, false, 0, 0L, -1); -1142 -1143 Assert.assertEquals(new Long(1602), output.getExecDuration()); -1144 Assert.assertEquals(new Long(146), output.getExecutionId()); -1145 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); -1146 Assert.assertEquals(null, output.getFilterNode()); -1147 Assert.assertEquals(null, output.getFilterStep()); -1148 Assert.assertEquals(1409, output.getOffset()); -1149 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); -1150 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); -1151 Assert.assertEquals(1415, output.getTotalSize()); -1152 Assert.assertEquals(true, output.isCompleted()); -1153 Assert.assertEquals(true, output.isExecCompleted()); -1154 Assert.assertEquals(false, output.isEmpty()); -1155 Assert.assertEquals(false, output.isHasFailedNodes()); -1156 Assert.assertEquals(false, output.isUnmodified()); -1157 Assert.assertEquals(15, output.getLogEntries().size()); -1158 } -1159 /** -1160 * Execution output state sequence -1161 */ -1162 @Test -1163 @Betamax(tape = "execution_output_state_only", mode = TapeMode.READ_ONLY) -1164 public void executionOutputStateOnly() throws Exception { -1165 final RundeckClient client = createClient(TEST_TOKEN_6, 10); -1166 RundeckOutput output = client.getExecutionOutputState(146L, true, 0, 0L, -1); -1167 -1168 Assert.assertEquals(new Long(1602), output.getExecDuration()); -1169 Assert.assertEquals(new Long(146), output.getExecutionId()); -1170 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); -1171 Assert.assertEquals(null, output.getFilterNode()); -1172 Assert.assertEquals(null, output.getFilterStep()); -1173 Assert.assertEquals(1409, output.getOffset()); -1174 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); -1175 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); -1176 Assert.assertEquals(1415, output.getTotalSize()); -1177 Assert.assertEquals(true, output.isCompleted()); -1178 Assert.assertEquals(true, output.isExecCompleted()); -1179 Assert.assertEquals(false, output.isEmpty()); -1180 Assert.assertEquals(false, output.isHasFailedNodes()); -1181 Assert.assertEquals(false, output.isUnmodified()); -1182 Assert.assertEquals(12, output.getLogEntries().size()); -1183 } -1184 /** -1185 * Execution state structure -1186 */ -1187 @Test -1188 @Betamax(tape = "execution_state", mode = TapeMode.READ_ONLY) -1189 public void executionState() throws Exception { -1190 final RundeckClient client = createClient(TEST_TOKEN_6, 10); -1191 RundeckExecutionState output = client.getExecutionState(149L); -1192 -1193 Assert.assertEquals(149,output.getExecutionId()); -1194 Assert.assertEquals(3,output.getTargetNodes().size()); -1195 Assert.assertEquals(3,output.getAllNodes().size()); -1196 Assert.assertEquals(1,output.getStepCount()); -1197 Assert.assertEquals(1,output.getSteps().size()); -1198 Assert.assertEquals(RundeckWFExecState.SUCCEEDED,output.getExecutionState()); -1199 } -1200 -1201 /** -1202 * generate api token -1203 */ -1204 @Test -1205 @Betamax(tape = "api_token_generate", mode = TapeMode.READ_ONLY) -1206 public void generateApiToken() throws Exception { -1207 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1208 String token = client.generateApiToken("bob"); -1209 -1210 Assert.assertNotNull(token); -1211 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", token); -1212 } -1213 /** -1214 * get api token -1215 */ -1216 @Test -1217 @Betamax(tape = "api_token_get", mode = TapeMode.READ_ONLY) -1218 public void getApiToken() throws Exception { -1219 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1220 RundeckToken token = client.getApiToken("MiquQjELTrEaugpmdgAKs1W3a7xonAwU"); -1221 -1222 Assert.assertNotNull(token); -1223 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", token.getToken()); -1224 Assert.assertEquals("bob", token.getUser()); -1225 } -1226 /** -1227 * list api tokens for user -1228 */ -1229 @Test -1230 @Betamax(tape = "api_tokens_list_user", mode = TapeMode.READ_ONLY) -1231 public void listApiTokens_user() throws Exception { -1232 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1233 List<RundeckToken> tokens = client.listApiTokens("bob"); -1234 -1235 Assert.assertNotNull(tokens); -1236 Assert.assertEquals(3, tokens.size()); -1237 Assert.assertEquals("hINp5eGzvYA9UePbUChaKHd5NiRkwWbx", tokens.get(0).getToken()); -1238 Assert.assertEquals("bob", tokens.get(0).getUser()); -1239 Assert.assertEquals("NaNnwVzAHAG83qOS7Wtwh6mjcXViyWUV", tokens.get(1).getToken()); -1240 Assert.assertEquals("bob", tokens.get(1).getUser()); -1241 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", tokens.get(2).getToken()); -1242 Assert.assertEquals("bob", tokens.get(2).getUser()); -1243 } -1244 /** -1245 * list api tokens all -1246 */ -1247 @Test -1248 @Betamax(tape = "api_tokens_list_all", mode = TapeMode.READ_ONLY) -1249 public void listApiTokens() throws Exception { -1250 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1251 List<RundeckToken> tokens = client.listApiTokens(); -1252 -1253 Assert.assertNotNull(tokens); -1254 Assert.assertEquals(4, tokens.size()); -1255 Assert.assertEquals("8Dp9op111ER6opsDRkddvE86K9sE499s", tokens.get(0).getToken()); -1256 Assert.assertEquals("admin", tokens.get(0).getUser()); -1257 Assert.assertEquals("hINp5eGzvYA9UePbUChaKHd5NiRkwWbx", tokens.get(1).getToken()); -1258 Assert.assertEquals("bob", tokens.get(1).getUser()); -1259 Assert.assertEquals("NaNnwVzAHAG83qOS7Wtwh6mjcXViyWUV", tokens.get(2).getToken()); -1260 Assert.assertEquals("bob", tokens.get(2).getUser()); -1261 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", tokens.get(3).getToken()); -1262 Assert.assertEquals("bob", tokens.get(3).getUser()); -1263 } -1264 -1265 /** -1266 * get api token -1267 */ -1268 @Test -1269 @Betamax(tape = "api_token_delete", mode = TapeMode.READ_ONLY) -1270 public void deleteApiToken() throws Exception { -1271 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1272 -1273 client.deleteApiToken("MiquQjELTrEaugpmdgAKs1W3a7xonAwU"); -1274 -1275 //get should now return 404 -1276 try { -1277 client.getApiToken("MiquQjELTrEaugpmdgAKs1W3a7xonAwU"); -1278 Assert.fail("expected failure"); -1279 } catch (RundeckApiException.RundeckApiHttpStatusException e) { -1280 Assert.assertEquals(404, e.getStatusCode()); -1281 } -1282 } -1283 /** -1284 * Store ssh key -1285 */ -1286 @Test -1287 @Betamax(tape = "key_store_private", mode = TapeMode.READ_ONLY) -1288 public void storeKey_private() throws Exception { -1289 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1290 File temp = File.createTempFile("test-key", ".tmp"); -1291 temp.deleteOnExit(); -1292 FileOutputStream out = new FileOutputStream(temp); -1293 try{ -1294 out.write("test1".getBytes()); -1295 }finally { -1296 out.close(); -1297 } -1298 KeyResource storageResource = client.storeKey("keys/test/example/file1.pem", temp, true); -1299 Assert.assertNotNull(storageResource); -1300 Assert.assertFalse(storageResource.isDirectory()); -1301 Assert.assertTrue(storageResource.isPrivateKey()); -1302 Assert.assertEquals("file1.pem", storageResource.getName()); -1303 Assert.assertEquals("keys/test/example/file1.pem", storageResource.getPath()); -1304 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", -1305 storageResource.getUrl()); -1306 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); -1307 Map<String, String> metadata = storageResource.getMetadata(); -1308 Assert.assertNotNull(metadata); -1309 Assert.assertEquals("application/octet-stream", metadata.get("Rundeck-content-type")); -1310 Assert.assertEquals("private", metadata.get("Rundeck-key-type")); -1311 } -1312 /** -1313 * Store ssh key -1314 */ -1315 @Test -1316 @Betamax(tape = "key_store_public", mode = TapeMode.READ_ONLY) -1317 public void storeKey_public() throws Exception { -1318 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1319 File temp = File.createTempFile("test-key", ".tmp"); -1320 temp.deleteOnExit(); -1321 FileOutputStream out = new FileOutputStream(temp); -1322 try{ -1323 out.write("test1".getBytes()); -1324 }finally { -1325 out.close(); -1326 } -1327 KeyResource storageResource = client.storeKey("keys/test/example/file2.pub", temp, false); -1328 Assert.assertNotNull(storageResource); -1329 Assert.assertFalse(storageResource.isDirectory()); -1330 Assert.assertFalse(storageResource.isPrivateKey()); -1331 Assert.assertEquals("file2.pub", storageResource.getName()); -1332 Assert.assertEquals("keys/test/example/file2.pub", storageResource.getPath()); -1333 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", -1334 storageResource.getUrl()); -1335 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); -1336 Map<String, String> metadata = storageResource.getMetadata(); -1337 Assert.assertNotNull(metadata); -1338 Assert.assertEquals("application/pgp-keys", metadata.get("Rundeck-content-type")); -1339 Assert.assertEquals("public", metadata.get("Rundeck-key-type")); -1340 } -1341 /** -1342 * get ssh key -1343 */ -1344 @Test -1345 @Betamax(tape = "key_get_public", mode = TapeMode.READ_ONLY) -1346 public void getKey_public() throws Exception { -1347 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1348 KeyResource storageResource = client.getKey("keys/test/example/file2.pub"); -1349 Assert.assertNotNull(storageResource); -1350 Assert.assertFalse(storageResource.isDirectory()); -1351 Assert.assertFalse(storageResource.isPrivateKey()); -1352 Assert.assertEquals("file2.pub", storageResource.getName()); -1353 Assert.assertEquals("keys/test/example/file2.pub", storageResource.getPath()); -1354 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", -1355 storageResource.getUrl()); -1356 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); -1357 Map<String, String> metadata = storageResource.getMetadata(); -1358 Assert.assertNotNull(metadata); -1359 Assert.assertEquals("application/pgp-keys", metadata.get("Rundeck-content-type")); -1360 Assert.assertEquals("public", metadata.get("Rundeck-key-type")); -1361 } -1362 /** -1363 * get ssh key -1364 */ -1365 @Test -1366 @Betamax(tape = "key_get_private", mode = TapeMode.READ_ONLY) -1367 public void getKey_private() throws Exception { -1368 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1369 KeyResource storageResource = client.getKey("keys/test/example/file1.pem"); -1370 Assert.assertNotNull(storageResource); -1371 Assert.assertFalse(storageResource.isDirectory()); -1372 Assert.assertTrue(storageResource.isPrivateKey()); -1373 Assert.assertEquals("file1.pem", storageResource.getName()); -1374 Assert.assertEquals("keys/test/example/file1.pem", storageResource.getPath()); -1375 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", -1376 storageResource.getUrl()); -1377 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); -1378 Map<String, String> metadata = storageResource.getMetadata(); -1379 Assert.assertNotNull(metadata); -1380 Assert.assertEquals("application/octet-stream", metadata.get("Rundeck-content-type")); -1381 Assert.assertEquals("private", metadata.get("Rundeck-key-type")); -1382 } -1383 /** -1384 * get ssh key data -1385 */ -1386 @Test -1387 @Betamax(tape = "key_get_data_private", mode = TapeMode.READ_ONLY) -1388 public void getKeyData_private() throws Exception { -1389 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1390 File temp = File.createTempFile("test-key", ".tmp"); -1391 temp.deleteOnExit(); -1392 try { -1393 int data = client.getPublicKeyContent("keys/test/example/file1.pem", temp); -1394 Assert.fail("expected failure"); -1395 } catch (RundeckApiException e) { -1396 Assert.assertEquals("Requested Key path was not a Public key: keys/test/example/file1.pem", -1397 e.getMessage()); -1398 } +830 Assert.assertEquals((Long) 24L, test.getId()); +831 Assert.assertEquals(null, test.getArgstring()); +832 Assert.assertEquals(null, test.getAbortedBy()); +833 Assert.assertEquals("echo test trigger_adhoc_command_as_user", test.getDescription()); +834 Assert.assertEquals("api-java-client-test-run-command-as-user1", test.getStartedBy()); +835 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, test.getStatus()); +836 } +837 +838 @Test +839 @Betamax(tape = "trigger_adhoc_command_as_user_unauthorized") +840 public void triggerAdhocCommandAsUserUnauthorized() throws Exception { +841 RundeckClient client = createClient(TEST_TOKEN_3, 5); +842 +843 final RundeckExecution test; +844 try { +845 test = client.triggerAdhocCommand( +846 RunAdhocCommandBuilder.builder() +847 .setProject("test") +848 .setCommand("echo test trigger_adhoc_command_as_user") +849 .setAsUser("api-java-client-test-run-command-as-user1") +850 .build() +851 ); +852 Assert.fail("should not succeed"); +853 } catch (RundeckApiException e) { +854 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); +855 } +856 } +857 +858 +859 @Test +860 @Betamax(tape = "trigger_adhoc_script") +861 public void triggerAdhocScript() throws Exception { +862 RundeckClient client = createClient(TEST_TOKEN_3, 5); +863 String script = "#!/bin/bash\n" + +864 "echo test trigger_adhoc_script\n"; +865 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +866 +867 final RundeckExecution test +868 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +869 (byteArrayInputStream).build()); +870 +871 Assert.assertEquals((Long) 25L, test.getId()); +872 Assert.assertEquals(null, test.getArgstring()); +873 Assert.assertEquals(null, test.getAbortedBy()); +874 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +875 Assert.assertEquals("admin", test.getStartedBy()); +876 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +877 } +878 +879 +880 /** +881 * Handle incorrect &lt;result&gt; wrapper for v11 response +882 * @throws Exception +883 */ +884 @Test +885 @Betamax(tape = "trigger_adhoc_script_v11_buggy") +886 public void triggerAdhocScript_v11_buggy() throws Exception { +887 RundeckClient client = createClient(TEST_TOKEN_7, 11); +888 String script = "#!/bin/bash\n" + +889 "echo test trigger_adhoc_script\n"; +890 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +891 +892 final RundeckExecution test +893 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +894 (byteArrayInputStream).build()); +895 +896 Assert.assertEquals((Long) 947L, test.getId()); +897 Assert.assertEquals(null, test.getArgstring()); +898 Assert.assertEquals(null, test.getAbortedBy()); +899 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +900 Assert.assertEquals("admin", test.getStartedBy()); +901 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +902 } +903 /** +904 * Handle v11 response without &lt;result&gt; wrapper +905 * @throws Exception +906 */ +907 @Test +908 @Betamax(tape = "trigger_adhoc_script_v11") +909 public void triggerAdhocScript_v11() throws Exception { +910 RundeckClient client = createClient(TEST_TOKEN_7, 11); +911 String script = "#!/bin/bash\n" + +912 "echo test trigger_adhoc_script\n"; +913 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +914 +915 final RundeckExecution test +916 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +917 (byteArrayInputStream).build()); +918 +919 Assert.assertEquals((Long) 948L, test.getId()); +920 Assert.assertEquals(null, test.getArgstring()); +921 Assert.assertEquals(null, test.getAbortedBy()); +922 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +923 Assert.assertEquals("admin", test.getStartedBy()); +924 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +925 } +926 +927 @Test +928 @Betamax(tape = "trigger_adhoc_script_as_user") +929 public void triggerAdhocScriptAsUser() throws Exception { +930 RundeckClient client = createClient(TEST_TOKEN_3, 5); +931 String script = "#!/bin/bash\n" + +932 "echo test trigger_adhoc_script\n"; +933 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +934 +935 final RundeckExecution test +936 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +937 (byteArrayInputStream).setAsUser("api-java-client-test-adhoc-script-as-user1").build()); +938 +939 Assert.assertEquals((Long) 26L, test.getId()); +940 Assert.assertEquals(null, test.getArgstring()); +941 Assert.assertEquals(null, test.getAbortedBy()); +942 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +943 Assert.assertEquals("api-java-client-test-adhoc-script-as-user1", test.getStartedBy()); +944 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +945 } +946 +947 @Test +948 @Betamax(tape = "trigger_adhoc_script_as_user_unauthorized") +949 public void triggerAdhocScriptAsUserUnauthorized() throws Exception { +950 RundeckClient client = createClient(TEST_TOKEN_3, 5); +951 String script = "#!/bin/bash\n" + +952 "echo test trigger_adhoc_script\n"; +953 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +954 +955 try{ +956 final RundeckExecution test +957 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder().setProject("test").setScript +958 (byteArrayInputStream).setAsUser("api-java-client-test-adhoc-script-as-user1").build()); +959 Assert.fail("should not succeed"); +960 } catch (RundeckApiException e) { +961 Assert.assertEquals("Not authorized for action \"Run as User\" for Run Adhoc", e.getMessage()); +962 } +963 +964 } +965 +966 @Test +967 @Betamax(tape = "trigger_adhoc_script_interpreter") +968 public void triggerAdhocScriptInpterpreter() throws Exception { +969 RundeckClient client = createClient(TEST_TOKEN_3, 8); +970 String script = "#!/bin/bash\n" + +971 "echo test trigger_adhoc_script\n"; +972 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(script.getBytes()); +973 final RundeckExecution test +974 = client.triggerAdhocScript(RunAdhocScriptBuilder.builder() +975 .setProject("test").setScript(byteArrayInputStream) +976 .setScriptInterpreter("sudo -c bob") +977 .build()); +978 +979 Assert.assertEquals((Long) 27L, test.getId()); +980 Assert.assertEquals(null, test.getArgstring()); +981 Assert.assertEquals(null, test.getAbortedBy()); +982 Assert.assertEquals("#!/bin/bash\necho test trigger_adhoc_script", test.getDescription()); +983 Assert.assertEquals("admin", test.getStartedBy()); +984 Assert.assertEquals(RundeckExecution.ExecutionStatus.RUNNING, test.getStatus()); +985 } +986 @Test +987 @Betamax(tape = "abort_execution") +988 public void abortExecution() throws Exception { +989 RundeckClient client = createClient(TEST_TOKEN_3, 5); +990 +991 long executionId = 21L; +992 final RundeckAbort test = client.abortExecution(executionId); +993 +994 Assert.assertEquals((Long) executionId,test.getExecution().getId()); +995 Assert.assertEquals(RundeckAbort.AbortStatus.PENDING,test.getStatus()); +996 } +997 @Test +998 @Betamax(tape = "abort_execution_as_user") +999 public void abortExecutionAsUser() throws Exception { +1000 RundeckClient client = createClient(TEST_TOKEN_3, 5); +1001 +1002 long executionId = 22L; +1003 final RundeckAbort test = client.abortExecution(executionId,"api-java-client-test-abort-as-user1"); +1004 +1005 Assert.assertEquals((Long) executionId,test.getExecution().getId()); +1006 Assert.assertEquals(RundeckAbort.AbortStatus.PENDING,test.getStatus()); +1007 } +1008 @Test +1009 @Betamax(tape = "abort_execution_as_user_unauthorized") +1010 public void abortExecutionAsUserUnauthorized() throws Exception { +1011 RundeckClient client = createClient(TEST_TOKEN_3, 5); +1012 +1013 long executionId = 28L; +1014 final RundeckAbort test = client.abortExecution(executionId, "api-java-client-test-abort-as-user1"); +1015 Assert.assertEquals(RundeckAbort.AbortStatus.FAILED, test.getStatus()); +1016 } +1017 private void assertPageResults(PagedResults<RundeckExecution> jobTest, +1018 final int size, +1019 final int count, final int max, final int offset, final int total) { +1020 Assert.assertEquals(size, jobTest.getResults().size()); +1021 Assert.assertEquals(count, jobTest.getCount()); +1022 Assert.assertEquals(max, jobTest.getMax()); +1023 Assert.assertEquals(offset, jobTest.getOffset()); +1024 Assert.assertEquals(total, jobTest.getTotal()); +1025 } +1026 +1027 /** +1028 * Import jobs, xml contains project context +1029 * @throws Exception +1030 */ +1031 @Test +1032 @Betamax(tape = "import_jobs_context_project") +1033 public void importJobsContextProject() throws Exception { +1034 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +1035 InputStream stream=new ByteArrayInputStream( +1036 ("<joblist>\n" + +1037 " <job>\n" + +1038 " <loglevel>INFO</loglevel>\n" + +1039 " <sequence keepgoing='false' strategy='node-first'>\n" + +1040 " <command>\n" + +1041 " <exec>echo hi</exec>\n" + +1042 " </command>\n" + +1043 " </sequence>\n" + +1044 " <description></description>\n" + +1045 " <name>job1</name>\n" + +1046 " <context>\n" + +1047 " <project>test</project>\n" + +1048 " </context>\n" + +1049 " </job>\n" + +1050 "</joblist>").getBytes("utf-8")); +1051 +1052 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +1053 .setStream(stream) +1054 .setFileType(FileType.XML) +1055 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +1056 .build(); +1057 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +1058 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +1059 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +1060 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +1061 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +1062 Assert.assertEquals("job1", rundeckJob.getName()); +1063 Assert.assertEquals("test", rundeckJob.getProject()); +1064 } +1065 /** +1066 * Import jobs, xml no project defined +1067 * @throws Exception +1068 */ +1069 @Test +1070 @Betamax(tape = "import_jobs_no_project") +1071 public void importJobsNoProject() throws Exception { +1072 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +1073 InputStream stream=new ByteArrayInputStream( +1074 ("<joblist>\n" + +1075 " <job>\n" + +1076 " <loglevel>INFO</loglevel>\n" + +1077 " <sequence keepgoing='false' strategy='node-first'>\n" + +1078 " <command>\n" + +1079 " <exec>echo hi</exec>\n" + +1080 " </command>\n" + +1081 " </sequence>\n" + +1082 " <description></description>\n" + +1083 " <name>job2</name>\n" + +1084 " </job>\n" + +1085 "</joblist>").getBytes("utf-8")); +1086 +1087 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +1088 .setStream(stream) +1089 .setFileType(FileType.XML) +1090 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +1091 .build(); +1092 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +1093 Assert.assertEquals(1,rundeckJobsImportResult.getFailedJobs().size()); +1094 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +1095 Assert.assertEquals(0,rundeckJobsImportResult.getSucceededJobs().size()); +1096 RundeckJob rundeckJob = rundeckJobsImportResult.getFailedJobs().entrySet().iterator().next().getKey(); +1097 String reason = rundeckJobsImportResult.getFailedJobs().get(rundeckJob); +1098 Assert.assertEquals("job2", rundeckJob.getName()); +1099 Assert.assertEquals(null, rundeckJob.getProject()); +1100 Assert.assertTrue(reason.contains("Project was not specified")); +1101 } +1102 /** +1103 * Import jobs, using project parameter +1104 * @throws Exception +1105 */ +1106 @Test +1107 @Betamax(tape = "import_jobs_project_param") +1108 public void importJobsProjectParam() throws Exception { +1109 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +1110 InputStream stream=new ByteArrayInputStream( +1111 ("<joblist>\n" + +1112 " <job>\n" + +1113 " <loglevel>INFO</loglevel>\n" + +1114 " <sequence keepgoing='false' strategy='node-first'>\n" + +1115 " <command>\n" + +1116 " <exec>echo hi</exec>\n" + +1117 " </command>\n" + +1118 " </sequence>\n" + +1119 " <description></description>\n" + +1120 " <name>importJobsProjectParam</name>\n" + +1121 " </job>\n" + +1122 "</joblist>").getBytes("utf-8")); +1123 +1124 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +1125 .setStream(stream) +1126 .setFileType(FileType.XML) +1127 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +1128 .setProject("test") +1129 .build(); +1130 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +1131 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +1132 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +1133 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +1134 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +1135 Assert.assertEquals("importJobsProjectParam", rundeckJob.getName()); +1136 Assert.assertEquals("test", rundeckJob.getProject()); +1137 } +1138 /** +1139 * Import jobs, project parameter overrides xml +1140 * @throws Exception +1141 */ +1142 @Test +1143 @Betamax(tape = "import_jobs_project_param_override") +1144 public void importJobsProjectParamOverride() throws Exception { +1145 final RundeckClient client = createClient(TEST_TOKEN_4, 8); +1146 InputStream stream=new ByteArrayInputStream( +1147 ("<joblist>\n" + +1148 " <job>\n" + +1149 " <loglevel>INFO</loglevel>\n" + +1150 " <sequence keepgoing='false' strategy='node-first'>\n" + +1151 " <command>\n" + +1152 " <exec>echo hi</exec>\n" + +1153 " </command>\n" + +1154 " </sequence>\n" + +1155 " <description></description>\n" + +1156 " <name>importJobsProjectParamOverride</name>\n" + +1157 " <context>\n" + +1158 " <project>testXYZ</project>\n" + +1159 " </context>\n" + +1160 " </job>\n" + +1161 "</joblist>").getBytes("utf-8")); +1162 +1163 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +1164 .setStream(stream) +1165 .setFileType(FileType.XML) +1166 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +1167 .setProject("test") +1168 .build(); +1169 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +1170 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +1171 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +1172 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +1173 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +1174 Assert.assertEquals("importJobsProjectParamOverride", rundeckJob.getName()); +1175 Assert.assertEquals("test", rundeckJob.getProject()); +1176 } +1177 /** +1178 * Import jobs, project parameter v7 doesn' use parameter +1179 * @throws Exception +1180 */ +1181 @Test +1182 @Betamax(tape = "import_jobs_project_param_v7") +1183 public void importJobsProjectParamV7() throws Exception { +1184 final RundeckClient client = createClient(TEST_TOKEN_4, 7); +1185 InputStream stream=new ByteArrayInputStream( +1186 ("<joblist>\n" + +1187 " <job>\n" + +1188 " <loglevel>INFO</loglevel>\n" + +1189 " <sequence keepgoing='false' strategy='node-first'>\n" + +1190 " <command>\n" + +1191 " <exec>echo hi</exec>\n" + +1192 " </command>\n" + +1193 " </sequence>\n" + +1194 " <description></description>\n" + +1195 " <name>importJobsProjectParamV7</name>\n" + +1196 " <context>\n" + +1197 " <project>testXYZ</project>\n" + +1198 " </context>\n" + +1199 " </job>\n" + +1200 "</joblist>").getBytes("utf-8")); +1201 +1202 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +1203 .setStream(stream) +1204 .setFileType(FileType.XML) +1205 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +1206 .setProject("test") +1207 .build(); +1208 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +1209 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +1210 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +1211 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +1212 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +1213 Assert.assertEquals("importJobsProjectParamV7", rundeckJob.getName()); +1214 Assert.assertEquals("testXYZ", rundeckJob.getProject()); +1215 } +1216 /** +1217 * Import jobs, project parameter v7 doesn' use parameter +1218 * @throws Exception +1219 */ +1220 @Test +1221 @Betamax(tape = "import_jobs_uuid_param_remove_v9") +1222 public void importJobsUUIDParamRemoveV9() throws Exception { +1223 final RundeckClient client = createClient(TEST_TOKEN_6, 9); +1224 InputStream stream=new ByteArrayInputStream( +1225 ("<joblist>\n" + +1226 " <job>\n" + +1227 " <uuid>testImportUUID</uuid>\n" + +1228 " <loglevel>INFO</loglevel>\n" + +1229 " <sequence keepgoing='false' strategy='node-first'>\n" + +1230 " <command>\n" + +1231 " <exec>echo hi</exec>\n" + +1232 " </command>\n" + +1233 " </sequence>\n" + +1234 " <description></description>\n" + +1235 " <name>importJobsUUIDParamRemoveV9</name>\n" + +1236 " </job>\n" + +1237 "</joblist>").getBytes("utf-8")); +1238 +1239 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +1240 .setStream(stream) +1241 .setFileType(FileType.XML) +1242 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +1243 .setUUIDImportBehavior(RundeckJobsUUIDImportBehavior.REMOVE) +1244 .setProject("test") +1245 .build(); +1246 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +1247 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +1248 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +1249 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +1250 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +1251 Assert.assertEquals("importJobsUUIDParamRemoveV9", rundeckJob.getName()); +1252 Assert.assertFalse("testImportUUID".equals(rundeckJob.getId())); +1253 Assert.assertEquals("b33c8bb1-4dfc-4661-a890-4164b264cc4a", rundeckJob.getId()); +1254 } +1255 /** +1256 * Import jobs, project parameter v7 doesn' use parameter +1257 * @throws Exception +1258 */ +1259 @Test +1260 @Betamax(tape = "import_jobs_uuid_param_preserve_v9") +1261 public void importJobsUUIDParamPreserveV9() throws Exception { +1262 final RundeckClient client = createClient(TEST_TOKEN_6, 9); +1263 InputStream stream=new ByteArrayInputStream( +1264 ("<joblist>\n" + +1265 " <job>\n" + +1266 " <uuid>testImportUUID</uuid>\n" + +1267 " <loglevel>INFO</loglevel>\n" + +1268 " <sequence keepgoing='false' strategy='node-first'>\n" + +1269 " <command>\n" + +1270 " <exec>echo hi</exec>\n" + +1271 " </command>\n" + +1272 " </sequence>\n" + +1273 " <description></description>\n" + +1274 " <name>importJobsUUIDParamPreserveV9</name>\n" + +1275 " </job>\n" + +1276 "</joblist>").getBytes("utf-8")); +1277 +1278 final RundeckJobsImport jobsImport = RundeckJobsImportBuilder.builder() +1279 .setStream(stream) +1280 .setFileType(FileType.XML) +1281 .setJobsImportMethod(RundeckJobsImportMethod.CREATE) +1282 .setUUIDImportBehavior(RundeckJobsUUIDImportBehavior.PRESERVE) +1283 .setProject("test") +1284 .build(); +1285 RundeckJobsImportResult rundeckJobsImportResult = client.importJobs(jobsImport); +1286 Assert.assertEquals(0,rundeckJobsImportResult.getFailedJobs().size()); +1287 Assert.assertEquals(0,rundeckJobsImportResult.getSkippedJobs().size()); +1288 Assert.assertEquals(1,rundeckJobsImportResult.getSucceededJobs().size()); +1289 RundeckJob rundeckJob = rundeckJobsImportResult.getSucceededJobs().get(0); +1290 Assert.assertEquals("importJobsUUIDParamPreserveV9", rundeckJob.getName()); +1291 Assert.assertEquals("testImportUUID", rundeckJob.getId()); +1292 } +1293 /** +1294 * Running executions for all projects using API v9 +1295 * @throws Exception +1296 */ +1297 @Test +1298 @Betamax(tape = "running_executions_v9") +1299 public void runningExecutionsV9() throws Exception { +1300 final RundeckClient client = createClient(TEST_TOKEN_5, 9); +1301 List<RundeckExecution> runningExecutions = client.getRunningExecutions(); +1302 Assert.assertEquals(2, runningExecutions.size()); +1303 RundeckExecution exec1 = runningExecutions.get(0); +1304 Assert.assertEquals("test", exec1.getProject()); +1305 RundeckExecution exec2 = runningExecutions.get(1); +1306 Assert.assertEquals("test2", exec2.getProject()); +1307 } +1308 +1309 /** +1310 * Running executions for all projects using API v8, which queries for project list and then individually +1311 * queries each project's now running +1312 * @throws Exception +1313 */ +1314 @Test +1315 @Betamax(tape = "running_executions_v8") +1316 public void runningExecutionsV8() throws Exception { +1317 final RundeckClient client = createClient(TEST_TOKEN_5, 8); +1318 List<RundeckExecution> runningExecutions = client.getRunningExecutions(); +1319 Assert.assertEquals(2, runningExecutions.size()); +1320 RundeckExecution exec1 = runningExecutions.get(0); +1321 Assert.assertEquals("test", exec1.getProject()); +1322 RundeckExecution exec2 = runningExecutions.get(1); +1323 Assert.assertEquals("test2", exec2.getProject()); +1324 } +1325 /** +1326 * Execution output +1327 */ +1328 @Test +1329 @Betamax(tape = "execution_output_basic", mode = TapeMode.READ_ONLY) +1330 public void executionOutputBasic() throws Exception { +1331 final RundeckClient client = createClient(TEST_TOKEN_6, 10); +1332 RundeckOutput output = client.getJobExecutionOutput(146L,0,0L,-1); +1333 +1334 Assert.assertEquals(new Long(1602), output.getExecDuration()); +1335 Assert.assertEquals(new Long(146), output.getExecutionId()); +1336 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); +1337 Assert.assertEquals(null, output.getFilterNode()); +1338 Assert.assertEquals(null, output.getFilterStep()); +1339 Assert.assertEquals(1409, output.getOffset()); +1340 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); +1341 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); +1342 Assert.assertEquals(1415, output.getTotalSize()); +1343 Assert.assertEquals(true, output.isCompleted()); +1344 Assert.assertEquals(true, output.isExecCompleted()); +1345 Assert.assertEquals(false, output.isEmpty()); +1346 Assert.assertEquals(false, output.isHasFailedNodes()); +1347 Assert.assertEquals(false, output.isUnmodified()); +1348 Assert.assertEquals(3, output.getLogEntries().size()); +1349 } +1350 /** +1351 * Execution output for a node +1352 */ +1353 @Test +1354 @Betamax(tape = "execution_output_fornode", mode = TapeMode.READ_ONLY) +1355 public void executionOutputForNode() throws Exception { +1356 final RundeckClient client = createClient(TEST_TOKEN_6, 10); +1357 RundeckOutput output = client.getExecutionOutputForNode(146L, "node-14.qa.subgroup.mycompany.com", 0, -1, 0L, -1); +1358 +1359 Assert.assertEquals(new Long(1602), output.getExecDuration()); +1360 Assert.assertEquals(new Long(146), output.getExecutionId()); +1361 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); +1362 Assert.assertEquals("node-14.qa.subgroup.mycompany.com", output.getFilterNode()); +1363 Assert.assertEquals(null, output.getFilterStep()); +1364 Assert.assertEquals(1409, output.getOffset()); +1365 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); +1366 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); +1367 Assert.assertEquals(1415, output.getTotalSize()); +1368 Assert.assertEquals(true, output.isCompleted()); +1369 Assert.assertEquals(true, output.isExecCompleted()); +1370 Assert.assertEquals(false, output.isEmpty()); +1371 Assert.assertEquals(false, output.isHasFailedNodes()); +1372 Assert.assertEquals(false, output.isUnmodified()); +1373 Assert.assertEquals(1, output.getLogEntries().size()); +1374 } +1375 /** +1376 * Execution output for a step +1377 */ +1378 @Test +1379 @Betamax(tape = "execution_output_forstep", mode = TapeMode.READ_ONLY) +1380 public void executionOutputForStep() throws Exception { +1381 final RundeckClient client = createClient(TEST_TOKEN_6, 10); +1382 RundeckOutput output = client.getExecutionOutputForStep(146L, "1", 0, -1, 0L, -1); +1383 +1384 Assert.assertEquals(new Long(1602), output.getExecDuration()); +1385 Assert.assertEquals(new Long(146), output.getExecutionId()); +1386 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); +1387 Assert.assertEquals(null, output.getFilterNode()); +1388 Assert.assertEquals("1", output.getFilterStep()); +1389 Assert.assertEquals(1409, output.getOffset()); +1390 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); +1391 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); +1392 Assert.assertEquals(1415, output.getTotalSize()); +1393 Assert.assertEquals(true, output.isCompleted()); +1394 Assert.assertEquals(true, output.isExecCompleted()); +1395 Assert.assertEquals(false, output.isEmpty()); +1396 Assert.assertEquals(false, output.isHasFailedNodes()); +1397 Assert.assertEquals(false, output.isUnmodified()); +1398 Assert.assertEquals(3, output.getLogEntries().size()); 1399 } -1400 /** -1401 * get ssh key data -1402 */ -1403 @Test -1404 @Betamax(tape = "key_get_data_public", mode = TapeMode.READ_ONLY) -1405 public void getKeyData_public() throws Exception { -1406 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1407 File temp = File.createTempFile("test-key", ".tmp"); -1408 temp.deleteOnExit(); -1409 int length = client.getPublicKeyContent("keys/test/example/file2.pub", temp); -1410 Assert.assertEquals(5, length); -1411 } -1412 /** -1413 * list directory -1414 */ -1415 @Test -1416 @Betamax(tape = "key_list_directory", mode = TapeMode.READ_ONLY) -1417 public void listKeyDirectory() throws Exception { -1418 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1419 List<KeyResource> list = client.listKeyDirectory("keys/test/example"); -1420 Assert.assertEquals(2, list.size()); -1421 KeyResource storageResource1 = list.get(0); -1422 KeyResource storageResource2 = list.get(1); -1423 -1424 Assert.assertFalse(storageResource2.isDirectory()); -1425 Assert.assertTrue(storageResource2.isPrivateKey()); -1426 Assert.assertEquals("file1.pem", storageResource2.getName()); -1427 Assert.assertEquals("keys/test/example/file1.pem", storageResource2.getPath()); -1428 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", storageResource2.getUrl()); -1429 Assert.assertNotNull(storageResource2.getMetadata()); -1430 -1431 Assert.assertEquals("application/octet-stream", storageResource2.getMetadata().get("Rundeck-content-type")); -1432 Assert.assertEquals("private", storageResource2.getMetadata().get("Rundeck-key-type")); -1433 -1434 Assert.assertFalse(storageResource1.isDirectory()); -1435 Assert.assertFalse(storageResource1.isPrivateKey()); -1436 Assert.assertEquals("file2.pub", storageResource1.getName()); -1437 Assert.assertEquals("keys/test/example/file2.pub", storageResource1.getPath()); -1438 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", -1439 storageResource1.getUrl()); -1440 Assert.assertNotNull(storageResource1.getMetadata()); -1441 Assert.assertEquals("application/pgp-keys", storageResource1.getMetadata().get("Rundeck-content-type")); -1442 Assert.assertEquals("public", storageResource1.getMetadata().get("Rundeck-key-type")); -1443 } -1444 /** -1445 * list root -1446 */ -1447 @Test -1448 @Betamax(tape = "key_list_root", mode = TapeMode.READ_ONLY) -1449 public void listKeyDirectoryRoot() throws Exception { -1450 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1451 List<KeyResource> list = client.listKeyDirectoryRoot(); -1452 Assert.assertEquals(2, list.size()); -1453 KeyResource storageResource0 = list.get(0); -1454 KeyResource storageResource1 = list.get(1); -1455 -1456 Assert.assertFalse(storageResource0.isDirectory()); -1457 Assert.assertTrue(storageResource0.isPrivateKey()); -1458 Assert.assertEquals("test1.pem", storageResource0.getName()); -1459 Assert.assertEquals("keys/test1.pem", storageResource0.getPath()); -1460 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test1.pem", storageResource0.getUrl()); -1461 Assert.assertNotNull(storageResource0.getMetadata()); -1462 -1463 Assert.assertEquals("application/octet-stream", storageResource0.getMetadata().get("Rundeck-content-type")); -1464 Assert.assertEquals("private", storageResource0.getMetadata().get("Rundeck-key-type")); -1465 -1466 Assert.assertTrue(storageResource1.toString(), storageResource1.isDirectory()); -1467 Assert.assertEquals(null, storageResource1.getName()); -1468 Assert.assertEquals("keys/test", storageResource1.getPath()); -1469 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test", -1470 storageResource1.getUrl()); -1471 Assert.assertNull(storageResource1.getMetadata()); -1472 -1473 -1474 } -1475 -1476 /** -1477 * delete ssh key -1478 */ -1479 @Test -1480 @Betamax(tape = "key_delete", mode = TapeMode.READ_ONLY) -1481 public void deleteKey() throws Exception { -1482 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1483 client.deleteKey("keys/test/example/file2.pub"); -1484 -1485 try { -1486 client.getKey("keys/test/example/file2.pub"); -1487 Assert.fail("expected failure"); -1488 } catch (RundeckApiException.RundeckApiHttpStatusException e) { -1489 Assert.assertEquals(404,e.getStatusCode()); -1490 } -1491 } -1492 /** -1493 * delete job -1494 */ -1495 @Test -1496 @Betamax(tape = "delete_job", mode = TapeMode.READ_ONLY) -1497 public void deleteJob() throws Exception { -1498 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1499 String result = client.deleteJob("api-test-job-run-scheduled"); -1500 -1501 Assert.assertEquals("Job api-test-job-run-scheduled was deleted successfully", result); -1502 } -1503 /** -1504 * delete job (DNE) -1505 */ -1506 @Test -1507 @Betamax(tape = "delete_job_not_found", mode = TapeMode.READ_ONLY) -1508 public void deleteJobNotFound() throws Exception { -1509 final RundeckClient client = createClient(TEST_TOKEN_7, 11); -1510 try { -1511 String result = client.deleteJob("does-not-exist"); -1512 Assert.fail(); -1513 } catch (RundeckApiException.RundeckApiHttpStatusException e) { -1514 Assert.assertEquals(404, e.getStatusCode()); -1515 } -1516 -1517 } -1518 -1519 @Before -1520 public void setUp() throws Exception { -1521 // not that you can put whatever here, because we don't actually connect to the RunDeck instance -1522 // but instead use betamax as a proxy to serve the previously recorded tapes (in src/test/resources) -1523 client = createClient(TEST_TOKEN_0, 5); -1524 } -1525 -1526 private RundeckClient createClient(final String token, int version) { -1527 return createBuilder(token).version(version).build(); -1528 } -1529 -1530 private RundeckClient createClient(String token) { -1531 return createBuilder(token) -1532 .build(); -1533 } -1534 -1535 private RundeckClientBuilder createBuilder(String token) { -1536 return RundeckClient.builder().url("http://rundeck.local:4440") -1537 .token(token); -1538 } -1539 -1540 } +1400 +1401 /** +1402 * Execution output for a node and step +1403 */ +1404 @Test +1405 @Betamax(tape = "execution_output_fornodeandstep", mode = TapeMode.READ_ONLY) +1406 public void executionOutputForNodeAndStep() throws Exception { +1407 final RundeckClient client = createClient(TEST_TOKEN_6, 10); +1408 RundeckOutput output = client.getExecutionOutputForNodeAndStep(146L, "node-14.qa.subgroup.mycompany.com", +1409 "1", 0, -1, 0L, -1); +1410 +1411 Assert.assertEquals(new Long(1602), output.getExecDuration()); +1412 Assert.assertEquals(new Long(146), output.getExecutionId()); +1413 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); +1414 Assert.assertEquals("node-14.qa.subgroup.mycompany.com", output.getFilterNode()); +1415 Assert.assertEquals("1", output.getFilterStep()); +1416 Assert.assertEquals(1409, output.getOffset()); +1417 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); +1418 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); +1419 Assert.assertEquals(1415, output.getTotalSize()); +1420 Assert.assertEquals(true, output.isCompleted()); +1421 Assert.assertEquals(true, output.isExecCompleted()); +1422 Assert.assertEquals(false, output.isEmpty()); +1423 Assert.assertEquals(false, output.isHasFailedNodes()); +1424 Assert.assertEquals(false, output.isUnmodified()); +1425 Assert.assertEquals(1, output.getLogEntries().size()); +1426 } +1427 +1428 /** +1429 * Execution output state sequence +1430 */ +1431 @Test +1432 @Betamax(tape = "execution_output_state", mode = TapeMode.READ_ONLY) +1433 public void executionOutputState() throws Exception { +1434 final RundeckClient client = createClient(TEST_TOKEN_6, 10); +1435 RundeckOutput output = client.getExecutionOutputState(146L, false, 0, 0L, -1); +1436 +1437 Assert.assertEquals(new Long(1602), output.getExecDuration()); +1438 Assert.assertEquals(new Long(146), output.getExecutionId()); +1439 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); +1440 Assert.assertEquals(null, output.getFilterNode()); +1441 Assert.assertEquals(null, output.getFilterStep()); +1442 Assert.assertEquals(1409, output.getOffset()); +1443 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); +1444 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); +1445 Assert.assertEquals(1415, output.getTotalSize()); +1446 Assert.assertEquals(true, output.isCompleted()); +1447 Assert.assertEquals(true, output.isExecCompleted()); +1448 Assert.assertEquals(false, output.isEmpty()); +1449 Assert.assertEquals(false, output.isHasFailedNodes()); +1450 Assert.assertEquals(false, output.isUnmodified()); +1451 Assert.assertEquals(15, output.getLogEntries().size()); +1452 } +1453 /** +1454 * Execution output state sequence +1455 */ +1456 @Test +1457 @Betamax(tape = "execution_output_state_only", mode = TapeMode.READ_ONLY) +1458 public void executionOutputStateOnly() throws Exception { +1459 final RundeckClient client = createClient(TEST_TOKEN_6, 10); +1460 RundeckOutput output = client.getExecutionOutputState(146L, true, 0, 0L, -1); +1461 +1462 Assert.assertEquals(new Long(1602), output.getExecDuration()); +1463 Assert.assertEquals(new Long(146), output.getExecutionId()); +1464 Assert.assertEquals(new Long(1389894504000L), output.getLastModified()); +1465 Assert.assertEquals(null, output.getFilterNode()); +1466 Assert.assertEquals(null, output.getFilterStep()); +1467 Assert.assertEquals(1409, output.getOffset()); +1468 Assert.assertEquals(RundeckExecution.ExecutionStatus.SUCCEEDED, output.getStatus()); +1469 Assert.assertEquals(new Float(99.57597), output.getPercentLoaded()); +1470 Assert.assertEquals(1415, output.getTotalSize()); +1471 Assert.assertEquals(true, output.isCompleted()); +1472 Assert.assertEquals(true, output.isExecCompleted()); +1473 Assert.assertEquals(false, output.isEmpty()); +1474 Assert.assertEquals(false, output.isHasFailedNodes()); +1475 Assert.assertEquals(false, output.isUnmodified()); +1476 Assert.assertEquals(12, output.getLogEntries().size()); +1477 } +1478 /** +1479 * Execution state structure +1480 */ +1481 @Test +1482 @Betamax(tape = "execution_state", mode = TapeMode.READ_ONLY) +1483 public void executionState() throws Exception { +1484 final RundeckClient client = createClient(TEST_TOKEN_6, 10); +1485 RundeckExecutionState output = client.getExecutionState(149L); +1486 +1487 Assert.assertEquals(149,output.getExecutionId()); +1488 Assert.assertEquals(3,output.getTargetNodes().size()); +1489 Assert.assertEquals(3,output.getAllNodes().size()); +1490 Assert.assertEquals(1,output.getStepCount()); +1491 Assert.assertEquals(1,output.getSteps().size()); +1492 Assert.assertEquals(RundeckWFExecState.SUCCEEDED,output.getExecutionState()); +1493 } +1494 +1495 /** +1496 * generate api token +1497 */ +1498 @Test +1499 @Betamax(tape = "api_token_generate", mode = TapeMode.READ_ONLY) +1500 public void generateApiToken() throws Exception { +1501 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1502 String token = client.generateApiToken("bob"); +1503 +1504 Assert.assertNotNull(token); +1505 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", token); +1506 } +1507 /** +1508 * get api token +1509 */ +1510 @Test +1511 @Betamax(tape = "api_token_get", mode = TapeMode.READ_ONLY) +1512 public void getApiToken() throws Exception { +1513 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1514 RundeckToken token = client.getApiToken("MiquQjELTrEaugpmdgAKs1W3a7xonAwU"); +1515 +1516 Assert.assertNotNull(token); +1517 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", token.getToken()); +1518 Assert.assertEquals("bob", token.getUser()); +1519 } +1520 /** +1521 * list api tokens for user +1522 */ +1523 @Test +1524 @Betamax(tape = "api_tokens_list_user", mode = TapeMode.READ_ONLY) +1525 public void listApiTokens_user() throws Exception { +1526 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1527 List<RundeckToken> tokens = client.listApiTokens("bob"); +1528 +1529 Assert.assertNotNull(tokens); +1530 Assert.assertEquals(3, tokens.size()); +1531 Assert.assertEquals("hINp5eGzvYA9UePbUChaKHd5NiRkwWbx", tokens.get(0).getToken()); +1532 Assert.assertEquals("bob", tokens.get(0).getUser()); +1533 Assert.assertEquals("NaNnwVzAHAG83qOS7Wtwh6mjcXViyWUV", tokens.get(1).getToken()); +1534 Assert.assertEquals("bob", tokens.get(1).getUser()); +1535 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", tokens.get(2).getToken()); +1536 Assert.assertEquals("bob", tokens.get(2).getUser()); +1537 } +1538 /** +1539 * list api tokens all +1540 */ +1541 @Test +1542 @Betamax(tape = "api_tokens_list_all", mode = TapeMode.READ_ONLY) +1543 public void listApiTokens() throws Exception { +1544 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1545 List<RundeckToken> tokens = client.listApiTokens(); +1546 +1547 Assert.assertNotNull(tokens); +1548 Assert.assertEquals(4, tokens.size()); +1549 Assert.assertEquals("8Dp9op111ER6opsDRkddvE86K9sE499s", tokens.get(0).getToken()); +1550 Assert.assertEquals("admin", tokens.get(0).getUser()); +1551 Assert.assertEquals("hINp5eGzvYA9UePbUChaKHd5NiRkwWbx", tokens.get(1).getToken()); +1552 Assert.assertEquals("bob", tokens.get(1).getUser()); +1553 Assert.assertEquals("NaNnwVzAHAG83qOS7Wtwh6mjcXViyWUV", tokens.get(2).getToken()); +1554 Assert.assertEquals("bob", tokens.get(2).getUser()); +1555 Assert.assertEquals("MiquQjELTrEaugpmdgAKs1W3a7xonAwU", tokens.get(3).getToken()); +1556 Assert.assertEquals("bob", tokens.get(3).getUser()); +1557 } +1558 +1559 /** +1560 * get api token +1561 */ +1562 @Test +1563 @Betamax(tape = "api_token_delete", mode = TapeMode.READ_ONLY) +1564 public void deleteApiToken() throws Exception { +1565 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1566 +1567 client.deleteApiToken("MiquQjELTrEaugpmdgAKs1W3a7xonAwU"); +1568 +1569 //get should now return 404 +1570 try { +1571 client.getApiToken("MiquQjELTrEaugpmdgAKs1W3a7xonAwU"); +1572 Assert.fail("expected failure"); +1573 } catch (RundeckApiException.RundeckApiHttpStatusException e) { +1574 Assert.assertEquals(404, e.getStatusCode()); +1575 } +1576 } +1577 /** +1578 * Store ssh key +1579 */ +1580 @Test +1581 @Betamax(tape = "key_store_private", mode = TapeMode.READ_ONLY) +1582 public void storeKey_private() throws Exception { +1583 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1584 File temp = File.createTempFile("test-key", ".tmp"); +1585 temp.deleteOnExit(); +1586 FileOutputStream out = new FileOutputStream(temp); +1587 try{ +1588 out.write("test1".getBytes()); +1589 }finally { +1590 out.close(); +1591 } +1592 KeyResource storageResource = client.storeKey("keys/test/example/file1.pem", temp, true); +1593 Assert.assertNotNull(storageResource); +1594 Assert.assertFalse(storageResource.isDirectory()); +1595 Assert.assertTrue(storageResource.isPrivateKey()); +1596 Assert.assertEquals("file1.pem", storageResource.getName()); +1597 Assert.assertEquals("keys/test/example/file1.pem", storageResource.getPath()); +1598 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", +1599 storageResource.getUrl()); +1600 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); +1601 Map<String, String> metadata = storageResource.getMetadata(); +1602 Assert.assertNotNull(metadata); +1603 Assert.assertEquals("application/octet-stream", metadata.get("Rundeck-content-type")); +1604 Assert.assertEquals("private", metadata.get("Rundeck-key-type")); +1605 } +1606 /** +1607 * Store ssh key +1608 */ +1609 @Test +1610 @Betamax(tape = "key_store_public", mode = TapeMode.READ_ONLY) +1611 public void storeKey_public() throws Exception { +1612 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1613 File temp = File.createTempFile("test-key", ".tmp"); +1614 temp.deleteOnExit(); +1615 FileOutputStream out = new FileOutputStream(temp); +1616 try{ +1617 out.write("test1".getBytes()); +1618 }finally { +1619 out.close(); +1620 } +1621 KeyResource storageResource = client.storeKey("keys/test/example/file2.pub", temp, false); +1622 Assert.assertNotNull(storageResource); +1623 Assert.assertFalse(storageResource.isDirectory()); +1624 Assert.assertFalse(storageResource.isPrivateKey()); +1625 Assert.assertEquals("file2.pub", storageResource.getName()); +1626 Assert.assertEquals("keys/test/example/file2.pub", storageResource.getPath()); +1627 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", +1628 storageResource.getUrl()); +1629 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); +1630 Map<String, String> metadata = storageResource.getMetadata(); +1631 Assert.assertNotNull(metadata); +1632 Assert.assertEquals("application/pgp-keys", metadata.get("Rundeck-content-type")); +1633 Assert.assertEquals("public", metadata.get("Rundeck-key-type")); +1634 } +1635 /** +1636 * get ssh key +1637 */ +1638 @Test +1639 @Betamax(tape = "key_get_public", mode = TapeMode.READ_ONLY) +1640 public void getKey_public() throws Exception { +1641 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1642 KeyResource storageResource = client.getKey("keys/test/example/file2.pub"); +1643 Assert.assertNotNull(storageResource); +1644 Assert.assertFalse(storageResource.isDirectory()); +1645 Assert.assertFalse(storageResource.isPrivateKey()); +1646 Assert.assertEquals("file2.pub", storageResource.getName()); +1647 Assert.assertEquals("keys/test/example/file2.pub", storageResource.getPath()); +1648 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", +1649 storageResource.getUrl()); +1650 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); +1651 Map<String, String> metadata = storageResource.getMetadata(); +1652 Assert.assertNotNull(metadata); +1653 Assert.assertEquals("application/pgp-keys", metadata.get("Rundeck-content-type")); +1654 Assert.assertEquals("public", metadata.get("Rundeck-key-type")); +1655 } +1656 /** +1657 * get ssh key +1658 */ +1659 @Test +1660 @Betamax(tape = "key_get_private", mode = TapeMode.READ_ONLY) +1661 public void getKey_private() throws Exception { +1662 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1663 KeyResource storageResource = client.getKey("keys/test/example/file1.pem"); +1664 Assert.assertNotNull(storageResource); +1665 Assert.assertFalse(storageResource.isDirectory()); +1666 Assert.assertTrue(storageResource.isPrivateKey()); +1667 Assert.assertEquals("file1.pem", storageResource.getName()); +1668 Assert.assertEquals("keys/test/example/file1.pem", storageResource.getPath()); +1669 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", +1670 storageResource.getUrl()); +1671 Assert.assertEquals(0, storageResource.getDirectoryContents().size()); +1672 Map<String, String> metadata = storageResource.getMetadata(); +1673 Assert.assertNotNull(metadata); +1674 Assert.assertEquals("application/octet-stream", metadata.get("Rundeck-content-type")); +1675 Assert.assertEquals("private", metadata.get("Rundeck-key-type")); +1676 } +1677 /** +1678 * get ssh key data +1679 */ +1680 @Test +1681 @Betamax(tape = "key_get_data_private", mode = TapeMode.READ_ONLY) +1682 public void getKeyData_private() throws Exception { +1683 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1684 File temp = File.createTempFile("test-key", ".tmp"); +1685 temp.deleteOnExit(); +1686 try { +1687 int data = client.getPublicKeyContent("keys/test/example/file1.pem", temp); +1688 Assert.fail("expected failure"); +1689 } catch (RundeckApiException e) { +1690 Assert.assertEquals("Requested Key path was not a Public key: keys/test/example/file1.pem", +1691 e.getMessage()); +1692 } +1693 } +1694 /** +1695 * get ssh key data +1696 */ +1697 @Test +1698 @Betamax(tape = "key_get_data_public", mode = TapeMode.READ_ONLY) +1699 public void getKeyData_public() throws Exception { +1700 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1701 File temp = File.createTempFile("test-key", ".tmp"); +1702 temp.deleteOnExit(); +1703 int length = client.getPublicKeyContent("keys/test/example/file2.pub", temp); +1704 Assert.assertEquals(5, length); +1705 } +1706 /** +1707 * list directory +1708 */ +1709 @Test +1710 @Betamax(tape = "key_list_directory", mode = TapeMode.READ_ONLY) +1711 public void listKeyDirectory() throws Exception { +1712 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1713 List<KeyResource> list = client.listKeyDirectory("keys/test/example"); +1714 Assert.assertEquals(2, list.size()); +1715 KeyResource storageResource1 = list.get(0); +1716 KeyResource storageResource2 = list.get(1); +1717 +1718 Assert.assertFalse(storageResource2.isDirectory()); +1719 Assert.assertTrue(storageResource2.isPrivateKey()); +1720 Assert.assertEquals("file1.pem", storageResource2.getName()); +1721 Assert.assertEquals("keys/test/example/file1.pem", storageResource2.getPath()); +1722 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file1.pem", storageResource2.getUrl()); +1723 Assert.assertNotNull(storageResource2.getMetadata()); +1724 +1725 Assert.assertEquals("application/octet-stream", storageResource2.getMetadata().get("Rundeck-content-type")); +1726 Assert.assertEquals("private", storageResource2.getMetadata().get("Rundeck-key-type")); +1727 +1728 Assert.assertFalse(storageResource1.isDirectory()); +1729 Assert.assertFalse(storageResource1.isPrivateKey()); +1730 Assert.assertEquals("file2.pub", storageResource1.getName()); +1731 Assert.assertEquals("keys/test/example/file2.pub", storageResource1.getPath()); +1732 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test/example/file2.pub", +1733 storageResource1.getUrl()); +1734 Assert.assertNotNull(storageResource1.getMetadata()); +1735 Assert.assertEquals("application/pgp-keys", storageResource1.getMetadata().get("Rundeck-content-type")); +1736 Assert.assertEquals("public", storageResource1.getMetadata().get("Rundeck-key-type")); +1737 } +1738 /** +1739 * list root +1740 */ +1741 @Test +1742 @Betamax(tape = "key_list_root", mode = TapeMode.READ_ONLY) +1743 public void listKeyDirectoryRoot() throws Exception { +1744 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1745 List<KeyResource> list = client.listKeyDirectoryRoot(); +1746 Assert.assertEquals(2, list.size()); +1747 KeyResource storageResource0 = list.get(0); +1748 KeyResource storageResource1 = list.get(1); +1749 +1750 Assert.assertFalse(storageResource0.isDirectory()); +1751 Assert.assertTrue(storageResource0.isPrivateKey()); +1752 Assert.assertEquals("test1.pem", storageResource0.getName()); +1753 Assert.assertEquals("keys/test1.pem", storageResource0.getPath()); +1754 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test1.pem", storageResource0.getUrl()); +1755 Assert.assertNotNull(storageResource0.getMetadata()); +1756 +1757 Assert.assertEquals("application/octet-stream", storageResource0.getMetadata().get("Rundeck-content-type")); +1758 Assert.assertEquals("private", storageResource0.getMetadata().get("Rundeck-key-type")); +1759 +1760 Assert.assertTrue(storageResource1.toString(), storageResource1.isDirectory()); +1761 Assert.assertEquals(null, storageResource1.getName()); +1762 Assert.assertEquals("keys/test", storageResource1.getPath()); +1763 Assert.assertEquals("http://dignan.local:4440/api/11/storage/keys/test", +1764 storageResource1.getUrl()); +1765 Assert.assertNull(storageResource1.getMetadata()); +1766 +1767 +1768 } +1769 +1770 /** +1771 * delete ssh key +1772 */ +1773 @Test +1774 @Betamax(tape = "key_delete", mode = TapeMode.READ_ONLY) +1775 public void deleteKey() throws Exception { +1776 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1777 client.deleteKey("keys/test/example/file2.pub"); +1778 +1779 try { +1780 client.getKey("keys/test/example/file2.pub"); +1781 Assert.fail("expected failure"); +1782 } catch (RundeckApiException.RundeckApiHttpStatusException e) { +1783 Assert.assertEquals(404,e.getStatusCode()); +1784 } +1785 } +1786 /** +1787 * delete job +1788 */ +1789 @Test +1790 @Betamax(tape = "delete_job", mode = TapeMode.READ_ONLY) +1791 public void deleteJob() throws Exception { +1792 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1793 String result = client.deleteJob("api-test-job-run-scheduled"); +1794 +1795 Assert.assertEquals("Job api-test-job-run-scheduled was deleted successfully", result); +1796 } +1797 /** +1798 * delete job (DNE) +1799 */ +1800 @Test +1801 @Betamax(tape = "delete_job_not_found", mode = TapeMode.READ_ONLY) +1802 public void deleteJobNotFound() throws Exception { +1803 final RundeckClient client = createClient(TEST_TOKEN_7, 11); +1804 try { +1805 String result = client.deleteJob("does-not-exist"); +1806 Assert.fail(); +1807 } catch (RundeckApiException.RundeckApiHttpStatusException e) { +1808 Assert.assertEquals(404, e.getStatusCode()); +1809 } +1810 +1811 } +1812 +1813 /** +1814 * delete executions with failure +1815 */ +1816 @Test +1817 @Betamax(tape = "delete_executions_unauthorized", mode = TapeMode.READ_ONLY) +1818 public void deleteExecutionsUnauthorized() throws Exception { +1819 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1820 final DeleteExecutionsResponse response = client.deleteExecutions( +1821 new HashSet<Long>() {{ +1822 add(640L); +1823 add(641L); +1824 }} +1825 ); +1826 Assert.assertEquals(2, response.getRequestCount()); +1827 Assert.assertEquals(0, response.getSuccessCount()); +1828 Assert.assertEquals(2, response.getFailedCount()); +1829 Assert.assertFalse(response.isAllsuccessful()); +1830 Assert.assertNotNull(response.getFailures()); +1831 Assert.assertEquals(2, response.getFailures().size()); +1832 Assert.assertEquals(Long.valueOf(641L), response.getFailures().get(0).getExecutionId()); +1833 Assert.assertEquals( +1834 "Unauthorized: Delete execution in project test", +1835 response.getFailures().get(0).getMessage() +1836 ); +1837 Assert.assertEquals(Long.valueOf(640L), response.getFailures().get(1).getExecutionId()); +1838 Assert.assertEquals( +1839 "Unauthorized: Delete execution in project test", +1840 response.getFailures().get(1).getMessage() +1841 ); +1842 } +1843 /** +1844 * delete executions with success +1845 */ +1846 @Test +1847 @Betamax(tape = "delete_executions_success", mode = TapeMode.READ_ONLY) +1848 public void deleteExecutionsSuccess() throws Exception { +1849 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1850 final DeleteExecutionsResponse response = client.deleteExecutions( +1851 new HashSet<Long>() {{ +1852 add(640L); +1853 add(641L); +1854 }} +1855 ); +1856 Assert.assertEquals(2, response.getRequestCount()); +1857 Assert.assertEquals(2, response.getSuccessCount()); +1858 Assert.assertEquals(0, response.getFailedCount()); +1859 Assert.assertTrue(response.isAllsuccessful()); +1860 Assert.assertNotNull(response.getFailures()); +1861 Assert.assertEquals(0, response.getFailures().size()); +1862 } +1863 /** +1864 * delete executions mixed success +1865 */ +1866 @Test +1867 @Betamax(tape = "delete_executions_mixed", mode = TapeMode.READ_ONLY) +1868 public void deleteExecutionsMixed() throws Exception { +1869 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1870 final DeleteExecutionsResponse response = client.deleteExecutions( +1871 new HashSet<Long>() {{ +1872 add(642L); +1873 add(640L); +1874 add(1640L); +1875 }} +1876 ); +1877 Assert.assertEquals(3, response.getRequestCount()); +1878 Assert.assertEquals(1, response.getSuccessCount()); +1879 Assert.assertEquals(2, response.getFailedCount()); +1880 Assert.assertFalse(response.isAllsuccessful()); +1881 Assert.assertNotNull(response.getFailures()); +1882 Assert.assertEquals(2, response.getFailures().size()); +1883 Assert.assertEquals(Long.valueOf(1640L), response.getFailures().get(0).getExecutionId()); +1884 Assert.assertEquals( +1885 "Execution Not found: 1640", +1886 response.getFailures().get(0).getMessage() +1887 ); +1888 Assert.assertEquals(Long.valueOf(640L), response.getFailures().get(1).getExecutionId()); +1889 Assert.assertEquals( +1890 "Execution Not found: 640", +1891 response.getFailures().get(1).getMessage() +1892 ); +1893 } +1894 /** +1895 * delete executions with failure +1896 */ +1897 @Test +1898 @Betamax(tape = "delete_all_job_executions_unauthorized", mode = TapeMode.READ_ONLY) +1899 public void deleteAllJobExecutionsUnauthorized() throws Exception { +1900 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1901 try { +1902 final DeleteExecutionsResponse response = client.deleteAllJobExecutions( +1903 "764c1209-68ed-4185-8d43-a739364bf156" +1904 ); +1905 Assert.fail(); +1906 } catch (RundeckApiException.RundeckApiTokenException e) { +1907 e.printStackTrace(); +1908 } +1909 } +1910 +1911 /** +1912 * +1913 * @throws Exception +1914 */ +1915 @Test +1916 @Betamax(tape = "delete_all_job_executions_success", mode = TapeMode.READ_ONLY) +1917 public void deleteAllJobExecutionsSuccess() throws Exception { +1918 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1919 final DeleteExecutionsResponse response = client.deleteAllJobExecutions( +1920 "764c1209-68ed-4185-8d43-a739364bf156" +1921 ); +1922 Assert.assertEquals(2, response.getRequestCount()); +1923 Assert.assertEquals(2, response.getSuccessCount()); +1924 Assert.assertEquals(0, response.getFailedCount()); +1925 Assert.assertTrue(response.isAllsuccessful()); +1926 Assert.assertNotNull(response.getFailures()); +1927 Assert.assertEquals(0, response.getFailures().size()); +1928 } +1929 +1930 /** +1931 * delete single execution success +1932 */ +1933 @Test +1934 @Betamax(tape = "delete_execution_success", mode = TapeMode.READ_ONLY) +1935 public void deleteExecutionSuccess() throws Exception { +1936 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1937 client.deleteExecution(643L); +1938 } +1939 /** +1940 * delete single execution failure (does not exist) +1941 */ +1942 @Test +1943 @Betamax(tape = "delete_execution_failure", mode = TapeMode.READ_ONLY) +1944 public void deleteExecutionFailure() throws Exception { +1945 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1946 try { +1947 client.deleteExecution(640L); +1948 Assert.fail(); +1949 } catch (RundeckApiException.RundeckApiHttpStatusException e) { +1950 Assert.assertEquals(404, e.getStatusCode()); +1951 } +1952 } +1953 /** +1954 * delete single execution null input +1955 */ +1956 @Test +1957 public void deleteExecutionNullInput() throws Exception { +1958 final RundeckClient client = createClient(TEST_TOKEN_8, 12); +1959 try { +1960 client.deleteExecution(null); +1961 Assert.fail(); +1962 } catch (IllegalArgumentException e) { +1963 +1964 } +1965 } +1966 @Before +1967 public void setUp() throws Exception { +1968 // not that you can put whatever here, because we don't actually connect to the RunDeck instance +1969 // but instead use betamax as a proxy to serve the previously recorded tapes (in src/test/resources) +1970 client = createClient(TEST_TOKEN_0, 5); +1971 } +1972 +1973 private RundeckClient createClient(final String token, int version) { +1974 return createBuilder(token).version(version).build(); +1975 } +1976 +1977 private RundeckClient createClient(String token) { +1978 return createBuilder(token) +1979 .build(); +1980 } +1981 +1982 private RundeckClientBuilder createBuilder(String token) { +1983 return RundeckClient.builder().url("http://rundeck.local:4440") +1984 .token(token); +1985 } +1986 +1987 }
    diff --git a/xref-test/org/rundeck/api/generator/package-frame.html b/xref-test/org/rundeck/api/generator/package-frame.html index f70cf88..da46076 100644 --- a/xref-test/org/rundeck/api/generator/package-frame.html +++ b/xref-test/org/rundeck/api/generator/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference Package org.rundeck.api.generator + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.generator diff --git a/xref-test/org/rundeck/api/generator/package-summary.html b/xref-test/org/rundeck/api/generator/package-summary.html index 48b3f74..7b3ce74 100644 --- a/xref-test/org/rundeck/api/generator/package-summary.html +++ b/xref-test/org/rundeck/api/generator/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference Package org.rundeck.api.generator + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.generator diff --git a/xref-test/org/rundeck/api/package-frame.html b/xref-test/org/rundeck/api/package-frame.html index ddb3106..f8a800a 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 11.1 Reference Package org.rundeck.api + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api @@ -16,6 +16,9 @@ diff --git a/xref-test/org/rundeck/api/package-summary.html b/xref-test/org/rundeck/api/package-summary.html index 230a46f..deeec03 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 11.1 Reference Package org.rundeck.api + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api @@ -36,6 +36,11 @@
  • + + + diff --git a/xref-test/org/rundeck/api/parser/package-frame.html b/xref-test/org/rundeck/api/parser/package-frame.html index bcbbd94..38c1ec5 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 11.1 Reference Package org.rundeck.api.parser + RunDeck API - Java Client 12.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 5f8add0..b14c529 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 11.1 Reference Package org.rundeck.api.parser + RunDeck API - Java Client 12.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 0631e45..bf939ee 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 11.1 Reference Package org.rundeck.api.util + RunDeck API - Java Client 12.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 36490de..8fdf080 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 11.1 Reference Package org.rundeck.api.util + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.util diff --git a/xref-test/overview-frame.html b/xref-test/overview-frame.html index c034df3..93646f3 100644 --- a/xref-test/overview-frame.html +++ b/xref-test/overview-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference + RunDeck API - Java Client 12.0 Reference diff --git a/xref-test/overview-summary.html b/xref-test/overview-summary.html index 80726b4..a9fbbb9 100644 --- a/xref-test/overview-summary.html +++ b/xref-test/overview-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference + RunDeck API - Java Client 12.0 Reference @@ -24,7 +24,7 @@ -

    RunDeck API - Java Client 11.1 Reference

    +

    RunDeck API - Java Client 12.0 Reference

    ExecutionQueryParametersTestExecutionQueryParametersTest is ... 
    RundeckClientTest Test the RundeckClient. 
    + ExecutionQueryParametersTest +
    RundeckClientTest
    diff --git a/xref/allclasses-frame.html b/xref/allclasses-frame.html index 7336cc1..b8b18dd 100644 --- a/xref/allclasses-frame.html +++ b/xref/allclasses-frame.html @@ -12,6 +12,9 @@
    • + APIV11Helper +
    • +
    • AbortParser
    • @@ -79,6 +82,18 @@
    • DefaultRunJob +
    • +
    • + DeleteExecutionsGenerator +
    • +
    • + DeleteExecutionsResponse +
    • +
    • + DeleteExecutionsResponseParser +
    • +
    • + DeleteFailure
    • DeleteParser @@ -136,6 +151,9 @@
    • NodeParser +
    • +
    • + NodeParser_unwrap
    • NodeSummary diff --git a/xref/index.html b/xref/index.html index f697ca1..a37015c 100644 --- a/xref/index.html +++ b/xref/index.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference + RunDeck API - Java Client 12.0 Reference diff --git a/xref/org/rundeck/api/ApiCall.html b/xref/org/rundeck/api/ApiCall.html index 88510e0..e3134c5 100644 --- a/xref/org/rundeck/api/ApiCall.html +++ b/xref/org/rundeck/api/ApiCall.html @@ -47,712 +47,711 @@ 37 import org.apache.http.protocol.HTTP; 38 import org.apache.http.protocol.HttpContext; 39 import org.apache.http.util.EntityUtils; -40 import org.dom4j.Document; -41 import org.rundeck.api.RundeckApiException.RundeckApiLoginException; -42 import org.rundeck.api.RundeckApiException.RundeckApiTokenException; -43 import org.rundeck.api.parser.ParserHelper; -44 import org.rundeck.api.parser.XmlNodeParser; -45 import org.rundeck.api.util.AssertUtil; -46 import org.rundeck.api.util.DocumentContentProducer; -47 -48 import java.io.*; -49 import java.net.ProxySelector; -50 import java.security.KeyManagementException; -51 import java.security.KeyStoreException; -52 import java.security.NoSuchAlgorithmException; -53 import java.security.UnrecoverableKeyException; -54 import java.security.cert.CertificateException; -55 import java.security.cert.X509Certificate; -56 import java.util.ArrayList; -57 import java.util.List; -58 import java.util.Map.Entry; -59 -60 /** -61 * Class responsible for making the HTTP API calls -62 * -63 * @author Vincent Behar -64 */ -65 class ApiCall { -66 -67 /** RunDeck HTTP header for the auth-token (in case of token-based authentication) */ -68 private static final transient String AUTH_TOKEN_HEADER = "X-RunDeck-Auth-Token"; -69 -70 /** RunDeck HTTP header for the setting session cookie (in case of session-based authentication) */ -71 private static final transient String COOKIE_HEADER = "Cookie"; -72 -73 /** {@link RundeckClient} instance holding the RunDeck url and the credentials */ -74 private final RundeckClient client; -75 -76 /** -77 * Build a new instance, linked to the given RunDeck client -78 * -79 * @param client holding the RunDeck url and the credentials -80 * @throws IllegalArgumentException if client is null -81 */ -82 public ApiCall(RundeckClient client) throws IllegalArgumentException { -83 super(); -84 this.client = client; -85 AssertUtil.notNull(client, "The RunDeck Client must not be null !"); -86 } -87 -88 /** -89 * Try to "ping" the RunDeck instance to see if it is alive -90 * -91 * @throws RundeckApiException if the ping fails -92 */ -93 public void ping() throws RundeckApiException { -94 HttpClient httpClient = instantiateHttpClient(); -95 try { -96 HttpResponse response = httpClient.execute(new HttpGet(client.getUrl())); -97 if (response.getStatusLine().getStatusCode() / 100 != 2) { -98 throw new RundeckApiException("Invalid HTTP response '" + response.getStatusLine() + "' when pinging " -99 + client.getUrl()); -100 } -101 } catch (IOException e) { -102 throw new RundeckApiException("Failed to ping RunDeck instance at " + client.getUrl(), e); -103 } finally { -104 httpClient.getConnectionManager().shutdown(); -105 } -106 } -107 -108 /** -109 * Test the authentication on the RunDeck instance. Will delegate to either {@link #testLoginAuth()} (in case of -110 * login-based auth) or {@link #testTokenAuth()} (in case of token-based auth). -111 * -112 * @return the login session ID if using login-based auth, otherwise null -113 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -114 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -115 * @see #testLoginAuth() -116 * @see #testTokenAuth() -117 */ -118 public String testAuth() throws RundeckApiLoginException, RundeckApiTokenException { -119 String sessionID = null; -120 if (client.getToken() != null || client.getSessionID() != null) { -121 testTokenAuth(); -122 } else { -123 sessionID = testLoginAuth(); -124 } -125 return sessionID; -126 } -127 -128 /** -129 * Test the login-based authentication on the RunDeck instance -130 * -131 * @throws RundeckApiLoginException if the login fails -132 * @see #testAuth() -133 */ -134 public String testLoginAuth() throws RundeckApiLoginException { -135 String sessionID = null; -136 HttpClient httpClient = instantiateHttpClient(); -137 try { -138 sessionID = login(httpClient); -139 } finally { -140 httpClient.getConnectionManager().shutdown(); -141 } -142 return sessionID; -143 } -144 -145 /** -146 * Test the token-based authentication on the RunDeck instance -147 * -148 * @throws RundeckApiTokenException if the token is invalid -149 * @see #testAuth() -150 */ -151 public void testTokenAuth() throws RundeckApiTokenException { -152 try { -153 execute(new HttpGet(client.getUrl() + client.getApiEndpoint() + "/system/info")); -154 } catch (RundeckApiTokenException e) { -155 throw e; -156 } catch (RundeckApiException e) { -157 throw new RundeckApiTokenException("Failed to verify token", e); -158 } -159 } -160 -161 /** -162 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the -163 * API call. At the end, the given parser will be used to convert the response to a more useful result object. -164 * -165 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -166 * @param parser used to parse the response -167 * @return the result of the call, as formatted by the parser -168 * @throws RundeckApiException in case of error when calling the API -169 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -170 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -171 */ -172 public <T> T get(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, -173 RundeckApiLoginException, RundeckApiTokenException { -174 HttpGet request = new HttpGet(client.getUrl() + client.getApiEndpoint() + apiPath); -175 if (null != apiPath.getAccept()) { -176 request.setHeader("Accept", apiPath.getAccept()); -177 } -178 return execute(request, parser); -179 } -180 -181 /** -182 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the -183 * API call. -184 * -185 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -186 * @return a new {@link InputStream} instance, not linked with network resources -187 * @throws RundeckApiException in case of error when calling the API -188 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -189 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -190 */ -191 public InputStream get(ApiPathBuilder apiPath) throws RundeckApiException, RundeckApiLoginException, -192 RundeckApiTokenException { -193 HttpGet request = new HttpGet(client.getUrl() + client.getApiEndpoint() + apiPath); -194 if (null != apiPath.getAccept()) { -195 request.setHeader("Accept", apiPath.getAccept()); -196 } -197 ByteArrayInputStream response = execute(request); -198 -199 // try to load the document, to throw an exception in case of error -200 ParserHelper.loadDocument(response); -201 response.reset(); -202 -203 return response; -204 } -205 -206 /** -207 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the -208 * API call without appending the API_ENDPOINT to the URL. -209 * -210 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -211 * @return a new {@link InputStream} instance, not linked with network resources -212 * @throws RundeckApiException in case of error when calling the API -213 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -214 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -215 */ -216 public InputStream getNonApi(ApiPathBuilder apiPath) throws RundeckApiException, RundeckApiLoginException, -217 RundeckApiTokenException { -218 HttpGet request = new HttpGet(client.getUrl() + apiPath); -219 if (null != apiPath.getAccept()) { -220 request.setHeader("Accept", apiPath.getAccept()); -221 } -222 ByteArrayInputStream response = execute(request); -223 response.reset(); -224 -225 return response; -226 } -227 -228 /** -229 * Execute an HTTP POST or GET request to the RunDeck instance, on the given path, depend ing of the {@link -230 * ApiPathBuilder} contains POST content or not (attachments or Form data). We will login first, and then execute -231 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. -232 * -233 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -234 * @param parser used to parse the response -235 * -236 * @return the result of the call, as formatted by the parser -237 * -238 * @throws RundeckApiException in case of error when calling the API -239 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -240 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -241 */ -242 public <T> T postOrGet(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, -243 RundeckApiLoginException, -244 RundeckApiTokenException { -245 if (apiPath.hasPostContent()) { -246 return post(apiPath, parser); -247 } else { -248 return get(apiPath, parser); -249 } -250 } -251 -252 /** -253 * Execute an HTTP POST request to the RunDeck instance, on the given path. We will login first, and then execute -254 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. -255 * -256 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -257 * @param parser used to parse the response -258 * @return the result of the call, as formatted by the parser -259 * @throws RundeckApiException in case of error when calling the API -260 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -261 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -262 */ -263 public <T> T post(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, -264 RundeckApiLoginException, RundeckApiTokenException { -265 HttpPost httpPost = new HttpPost(client.getUrl() + client.getApiEndpoint() + apiPath); -266 return requestWithEntity(apiPath, parser, httpPost); -267 } -268 /** -269 * Execute an HTTP PUT request to the RunDeck instance, on the given path. We will login first, and then execute -270 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. -271 * -272 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -273 * @param parser used to parse the response -274 * @return the result of the call, as formatted by the parser -275 * @throws RundeckApiException in case of error when calling the API -276 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -277 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -278 */ -279 public <T> T put(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, -280 RundeckApiLoginException, RundeckApiTokenException { -281 HttpPut httpPut = new HttpPut(client.getUrl() + client.getApiEndpoint() + apiPath); -282 return requestWithEntity(apiPath, parser, httpPut); -283 } -284 -285 private <T> T requestWithEntity(ApiPathBuilder apiPath, XmlNodeParser<T> parser, HttpEntityEnclosingRequestBase -286 httpPost) { -287 if(null!= apiPath.getAccept()) { -288 httpPost.setHeader("Accept", apiPath.getAccept()); -289 } -290 // POST a multi-part request, with all attachments -291 if(apiPath.getAttachments().size()>0){ -292 MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); -293 for (Entry<String, InputStream> attachment : apiPath.getAttachments().entrySet()) { -294 entity.addPart(attachment.getKey(), new InputStreamBody(attachment.getValue(), attachment.getKey())); -295 } -296 httpPost.setEntity(entity); -297 }else if(apiPath.getForm().size()>0){ -298 try { -299 httpPost.setEntity(new UrlEncodedFormEntity(apiPath.getForm(), HTTP.UTF_8)); -300 } catch (UnsupportedEncodingException e) { -301 throw new RundeckApiException("Unsupported encoding: " + e.getMessage(), e); -302 } -303 }else if(apiPath.getContentStream() !=null && apiPath.getContentType()!=null){ -304 BasicHttpEntity entity = new BasicHttpEntity(); -305 entity.setContent(apiPath.getContentStream()); -306 entity.setContentType(apiPath.getContentType()); -307 httpPost.setEntity(entity); -308 }else if(apiPath.getContentFile() !=null && apiPath.getContentType()!=null){ -309 httpPost.setEntity(new FileEntity(apiPath.getContentFile(), apiPath.getContentType())); -310 }else if(apiPath.getXmlDocument()!=null) { -311 httpPost.setHeader("Content-Type", "application/xml"); -312 httpPost.setEntity(new EntityTemplate(new DocumentContentProducer(apiPath.getXmlDocument()))); -313 }else if(apiPath.isEmptyContent()){ -314 //empty content -315 }else { -316 throw new IllegalArgumentException("No Form or Multipart entity for POST content-body"); -317 } -318 -319 return execute(httpPost, parser); -320 } -321 -322 /** -323 * Execute an HTTP DELETE request to the RunDeck instance, on the given path. We will login first, and then execute -324 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. -325 * -326 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -327 * @param parser used to parse the response -328 * @return the result of the call, as formatted by the parser -329 * @throws RundeckApiException in case of error when calling the API -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 */ -333 public <T> T delete(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, -334 RundeckApiLoginException, RundeckApiTokenException { -335 return execute(new HttpDelete(client.getUrl() + client.getApiEndpoint() + apiPath), parser); -336 } -337 /** -338 * Execute an HTTP DELETE request to the RunDeck instance, on the given path, and expect a 204 response. -339 * -340 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -341 * @throws RundeckApiException in case of error when calling the API -342 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -343 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -344 */ -345 public void delete(ApiPathBuilder apiPath) throws RundeckApiException, -346 RundeckApiLoginException, RundeckApiTokenException { -347 -348 InputStream response = execute(new HttpDelete(client.getUrl() + client.getApiEndpoint() + apiPath)); -349 if(null!=response){ -350 throw new RundeckApiException("Unexpected Rundeck response content, expected no content!"); -351 } -352 } -353 -354 /** -355 * Execute an HTTP request to the RunDeck instance. We will login first, and then execute the API call. At the end, -356 * the given parser will be used to convert the response to a more useful result object. -357 * -358 * @param request to execute. see {@link HttpGet}, {@link HttpDelete}, and so on... -359 * @param parser used to parse the response -360 * @return the result of the call, as formatted by the parser -361 * @throws RundeckApiException in case of error when calling the API -362 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -363 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -364 */ -365 private <T> T execute(HttpRequestBase request, XmlNodeParser<T> parser) throws RundeckApiException, -366 RundeckApiLoginException, RundeckApiTokenException { -367 // execute the request -368 return new ParserHandler<T>(parser).handle(execute(request, new ResultHandler())); -369 } -370 -371 /** -372 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the -373 * API call. At the end, the given parser will be used to convert the response to a more useful result object. -374 * -375 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} -376 * @param parser used to parse the response -377 * -378 * @return the result of the call, as formatted by the parser -379 * -380 * @throws RundeckApiException in case of error when calling the API -381 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -382 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -383 */ -384 public int get(ApiPathBuilder apiPath, OutputStream outputStream) throws RundeckApiException, -385 RundeckApiLoginException, RundeckApiTokenException, IOException { -386 HttpGet request = new HttpGet(client.getUrl() + client.getApiEndpoint() + apiPath); -387 if (null != apiPath.getAccept()) { -388 request.setHeader("Accept", apiPath.getAccept()); -389 } -390 final WriteOutHandler writeOutHandler = new WriteOutHandler(outputStream); -391 Handler<HttpResponse,Integer> handler = writeOutHandler; -392 if(null!=apiPath.getRequiredContentType()){ -393 handler = new RequireContentTypeHandler<Integer>(apiPath.getRequiredContentType(), handler); -394 } -395 final int wrote = execute(request, handler); -396 if(writeOutHandler.thrown!=null){ -397 throw writeOutHandler.thrown; -398 } -399 return wrote; -400 } -401 /** -402 * Execute an HTTP request to the RunDeck instance. We will login first, and then execute the API call. -403 * -404 * @param request to execute. see {@link HttpGet}, {@link HttpDelete}, and so on... -405 * @return a new {@link InputStream} instance, not linked with network resources -406 * @throws RundeckApiException in case of error when calling the API -407 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -408 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -409 */ -410 private ByteArrayInputStream execute(HttpUriRequest request) throws RundeckApiException, RundeckApiLoginException, -411 RundeckApiTokenException { -412 return execute(request, new ResultHandler() ); -413 } -414 -415 /** -416 * Handles one type into another -417 * @param <T> -418 * @param <V> -419 */ -420 private static interface Handler<T,V>{ -421 public V handle(T response); -422 } -423 -424 /** -425 * Handles parsing inputstream via a parser -426 * @param <S> -427 */ -428 private static class ParserHandler<S> implements Handler<InputStream,S> { -429 XmlNodeParser<S> parser; -430 -431 private ParserHandler(XmlNodeParser<S> parser) { -432 this.parser = parser; -433 } -434 -435 @Override -436 public S handle(InputStream response) { -437 // read and parse the response -438 return parser.parseXmlNode(ParserHelper.loadDocument(response)); -439 } -440 } -441 -442 /** -443 * Handles writing response to an output stream -444 */ -445 private static class ChainHandler<T> implements Handler<HttpResponse,T> { -446 Handler<HttpResponse, T> chain; -447 private ChainHandler(Handler<HttpResponse,T> chain) { -448 this.chain=chain; -449 } -450 @Override -451 public T handle(final HttpResponse response) { -452 return chain.handle(response); -453 } -454 } -455 -456 /** -457 * Handles writing response to an output stream -458 */ -459 private static class RequireContentTypeHandler<T> extends ChainHandler<T> { -460 String contentType; -461 -462 private RequireContentTypeHandler(final String contentType, final Handler<HttpResponse, T> chain) { -463 super(chain); -464 this.contentType = contentType; -465 } -466 -467 @Override -468 public T handle(final HttpResponse response) { -469 final Header firstHeader = response.getFirstHeader("Content-Type"); -470 final String[] split = firstHeader.getValue().split(";"); -471 boolean matched=false; -472 for (int i = 0; i < split.length; i++) { -473 String s = split[i]; -474 if (this.contentType.equalsIgnoreCase(s.trim())) { -475 matched=true; -476 break; -477 } -478 } -479 if(!matched) { -480 throw new RundeckApiException.RundeckApiHttpContentTypeException(firstHeader.getValue(), -481 this.contentType); -482 } -483 return super.handle(response); -484 } -485 } -486 -487 /** -488 * Handles writing response to an output stream -489 */ -490 private static class WriteOutHandler implements Handler<HttpResponse,Integer> { -491 private WriteOutHandler(OutputStream writeOut) { -492 this.writeOut = writeOut; -493 } -494 -495 OutputStream writeOut; -496 IOException thrown; -497 @Override -498 public Integer handle(final HttpResponse response) { -499 try { -500 return IOUtils.copy(response.getEntity().getContent(), writeOut); -501 } catch (IOException e) { -502 thrown=e; -503 } -504 return -1; -505 } -506 } -507 -508 /** -509 * Handles reading response into a byte array stream -510 */ -511 private static class ResultHandler implements Handler<HttpResponse,ByteArrayInputStream> { -512 @Override -513 public ByteArrayInputStream handle(final HttpResponse response) { -514 // return a new inputStream, so that we can close all network resources -515 try { -516 return new ByteArrayInputStream(EntityUtils.toByteArray(response.getEntity())); -517 } catch (IOException e) { -518 throw new RundeckApiException("Failed to consume entity and convert the inputStream", e); -519 } -520 } -521 } -522 /** -523 * Execute an HTTP request to the RunDeck instance. We will login first, and then execute the API call. -524 * -525 * @param request to execute. see {@link HttpGet}, {@link HttpDelete}, and so on... -526 * @return a new {@link InputStream} instance, not linked with network resources -527 * @throws RundeckApiException in case of error when calling the API -528 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -529 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -530 */ -531 private <T> T execute(HttpUriRequest request, Handler<HttpResponse,T> handler) throws RundeckApiException, -532 RundeckApiLoginException, -533 RundeckApiTokenException { -534 HttpClient httpClient = instantiateHttpClient(); -535 try { -536 // we only need to manually login in case of login-based authentication -537 // note that in case of token-based auth, the auth (via an HTTP header) is managed by an interceptor. -538 if (client.getToken() == null && client.getSessionID() == null) { -539 login(httpClient); -540 } -541 -542 // execute the HTTP request -543 HttpResponse response = null; -544 try { -545 response = httpClient.execute(request); -546 } catch (IOException e) { -547 throw new RundeckApiException("Failed to execute an HTTP " + request.getMethod() + " on url : " -548 + request.getURI(), e); -549 } -550 -551 // in case of error, we get a redirect to /api/error -552 // that we need to follow manually for POST and DELETE requests (as GET) -553 int statusCode = response.getStatusLine().getStatusCode(); -554 if (statusCode / 100 == 3) { -555 String newLocation = response.getFirstHeader("Location").getValue(); -556 try { -557 EntityUtils.consume(response.getEntity()); -558 } catch (IOException e) { -559 throw new RundeckApiException("Failed to consume entity (release connection)", e); -560 } -561 request = new HttpGet(newLocation); -562 try { -563 response = httpClient.execute(request); -564 statusCode = response.getStatusLine().getStatusCode(); -565 } catch (IOException e) { -566 throw new RundeckApiException("Failed to execute an HTTP GET on url : " + request.getURI(), e); -567 } -568 } -569 -570 // check the response code (should be 2xx, even in case of error : error message is in the XML result) -571 if (statusCode / 100 != 2) { -572 if (statusCode == 403 && -573 (client.getToken() != null || client.getSessionID() != null)) { -574 throw new RundeckApiTokenException("Invalid Token or sessionID ! Got HTTP response '" + response.getStatusLine() -575 + "' for " + request.getURI()); -576 } else { -577 throw new RundeckApiException.RundeckApiHttpStatusException("Invalid HTTP response '" + response.getStatusLine() + "' for " -578 + request.getURI(), statusCode); -579 } -580 } -581 if(statusCode==204){ -582 return null; -583 } -584 if (response.getEntity() == null) { -585 throw new RundeckApiException("Empty RunDeck response ! HTTP status line is : " -586 + response.getStatusLine()); -587 } -588 return handler.handle(response); -589 } finally { -590 httpClient.getConnectionManager().shutdown(); -591 } -592 } -593 -594 /** -595 * Do the actual work of login, using the given {@link HttpClient} instance. You'll need to re-use this instance -596 * when making API calls (such as running a job). Only use this in case of login-based authentication. -597 * -598 * @param httpClient pre-instantiated -599 * @throws RundeckApiLoginException if the login failed -600 */ -601 private String login(HttpClient httpClient) throws RundeckApiLoginException { -602 String sessionID = null; -603 -604 // 1. call expected GET request -605 String location = client.getUrl(); -606 -607 try { -608 HttpGet getRequest = new HttpGet(location); -609 HttpResponse response = httpClient.execute(getRequest); -610 -611 // sessionID stored in case user wants to cache it for reuse -612 Header cookieHeader = response.getFirstHeader("Set-Cookie"); -613 if (cookieHeader != null) { -614 String cookieStr = cookieHeader.getValue(); -615 if (cookieStr != null) { -616 int i1 = cookieStr.indexOf("JSESSIONID="); -617 if (i1 >= 0) { -618 cookieStr = cookieStr.substring(i1 + "JSESSIONID=".length()); -619 int i2 = cookieStr.indexOf(";"); -620 if (i2 >= 0) { -621 sessionID = cookieStr.substring(0, i2); -622 } -623 } -624 } -625 } -626 -627 try { -628 EntityUtils.consume(response.getEntity()); -629 } catch (IOException e) { -630 throw new RundeckApiLoginException("Failed to consume entity (release connection)", e); -631 } -632 } catch (IOException e) { -633 throw new RundeckApiLoginException("Failed to get request on " + location, e); -634 } -635 -636 // 2. then call POST login request -637 location += "/j_security_check"; -638 -639 while (true) { -640 try { -641 HttpPost postLogin = new HttpPost(location); -642 List params = new ArrayList(); -643 params.add(new BasicNameValuePair("j_username", client.getLogin())); -644 params.add(new BasicNameValuePair("j_password", client.getPassword())); -645 params.add(new BasicNameValuePair("action", "login")); -646 postLogin.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8)); -647 HttpResponse response = httpClient.execute(postLogin); -648 -649 if (response.getStatusLine().getStatusCode() / 100 == 3) { -650 // HTTP client refuses to handle redirects (code 3xx) for POST, so we have to do it manually... -651 location = response.getFirstHeader("Location").getValue(); -652 try { -653 EntityUtils.consume(response.getEntity()); -654 } catch (IOException e) { -655 throw new RundeckApiLoginException("Failed to consume entity (release connection)", e); -656 } -657 continue; -658 } -659 -660 if (response.getStatusLine().getStatusCode() / 100 != 2) { -661 throw new RundeckApiLoginException("Invalid HTTP response '" + response.getStatusLine() + "' for " -662 + location); -663 } -664 -665 try { -666 String content = EntityUtils.toString(response.getEntity(), HTTP.UTF_8); -667 if (StringUtils.contains(content, "j_security_check")) { -668 throw new RundeckApiLoginException("Login failed for user " + client.getLogin()); -669 } -670 try { -671 EntityUtils.consume(response.getEntity()); -672 } catch (IOException e) { -673 throw new RundeckApiLoginException("Failed to consume entity (release connection)", e); -674 } -675 break; -676 } catch (IOException io) { -677 throw new RundeckApiLoginException("Failed to read RunDeck result", io); -678 } catch (ParseException p) { -679 throw new RundeckApiLoginException("Failed to parse RunDeck response", p); -680 } -681 } catch (IOException e) { -682 throw new RundeckApiLoginException("Failed to post login form on " + location, e); -683 } -684 } -685 -686 return sessionID; -687 } +40 import org.rundeck.api.RundeckApiException.RundeckApiLoginException; +41 import org.rundeck.api.RundeckApiException.RundeckApiTokenException; +42 import org.rundeck.api.parser.ParserHelper; +43 import org.rundeck.api.parser.XmlNodeParser; +44 import org.rundeck.api.util.AssertUtil; +45 import org.rundeck.api.util.DocumentContentProducer; +46 +47 import java.io.*; +48 import java.net.ProxySelector; +49 import java.security.KeyManagementException; +50 import java.security.KeyStoreException; +51 import java.security.NoSuchAlgorithmException; +52 import java.security.UnrecoverableKeyException; +53 import java.security.cert.CertificateException; +54 import java.security.cert.X509Certificate; +55 import java.util.ArrayList; +56 import java.util.List; +57 import java.util.Map.Entry; +58 +59 /** +60 * Class responsible for making the HTTP API calls +61 * +62 * @author Vincent Behar +63 */ +64 class ApiCall { +65 +66 /** RunDeck HTTP header for the auth-token (in case of token-based authentication) */ +67 private static final transient String AUTH_TOKEN_HEADER = "X-RunDeck-Auth-Token"; +68 +69 /** RunDeck HTTP header for the setting session cookie (in case of session-based authentication) */ +70 private static final transient String COOKIE_HEADER = "Cookie"; +71 +72 /** {@link RundeckClient} instance holding the RunDeck url and the credentials */ +73 private final RundeckClient client; +74 +75 /** +76 * Build a new instance, linked to the given RunDeck client +77 * +78 * @param client holding the RunDeck url and the credentials +79 * @throws IllegalArgumentException if client is null +80 */ +81 public ApiCall(RundeckClient client) throws IllegalArgumentException { +82 super(); +83 this.client = client; +84 AssertUtil.notNull(client, "The RunDeck Client must not be null !"); +85 } +86 +87 /** +88 * Try to "ping" the RunDeck instance to see if it is alive +89 * +90 * @throws RundeckApiException if the ping fails +91 */ +92 public void ping() throws RundeckApiException { +93 HttpClient httpClient = instantiateHttpClient(); +94 try { +95 HttpResponse response = httpClient.execute(new HttpGet(client.getUrl())); +96 if (response.getStatusLine().getStatusCode() / 100 != 2) { +97 throw new RundeckApiException("Invalid HTTP response '" + response.getStatusLine() + "' when pinging " +98 + client.getUrl()); +99 } +100 } catch (IOException e) { +101 throw new RundeckApiException("Failed to ping RunDeck instance at " + client.getUrl(), e); +102 } finally { +103 httpClient.getConnectionManager().shutdown(); +104 } +105 } +106 +107 /** +108 * Test the authentication on the RunDeck instance. Will delegate to either {@link #testLoginAuth()} (in case of +109 * login-based auth) or {@link #testTokenAuth()} (in case of token-based auth). +110 * +111 * @return the login session ID if using login-based auth, otherwise null +112 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +113 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +114 * @see #testLoginAuth() +115 * @see #testTokenAuth() +116 */ +117 public String testAuth() throws RundeckApiLoginException, RundeckApiTokenException { +118 String sessionID = null; +119 if (client.getToken() != null || client.getSessionID() != null) { +120 testTokenAuth(); +121 } else { +122 sessionID = testLoginAuth(); +123 } +124 return sessionID; +125 } +126 +127 /** +128 * Test the login-based authentication on the RunDeck instance +129 * +130 * @throws RundeckApiLoginException if the login fails +131 * @see #testAuth() +132 */ +133 public String testLoginAuth() throws RundeckApiLoginException { +134 String sessionID = null; +135 HttpClient httpClient = instantiateHttpClient(); +136 try { +137 sessionID = login(httpClient); +138 } finally { +139 httpClient.getConnectionManager().shutdown(); +140 } +141 return sessionID; +142 } +143 +144 /** +145 * Test the token-based authentication on the RunDeck instance +146 * +147 * @throws RundeckApiTokenException if the token is invalid +148 * @see #testAuth() +149 */ +150 public void testTokenAuth() throws RundeckApiTokenException { +151 try { +152 execute(new HttpGet(client.getUrl() + client.getApiEndpoint() + "/system/info")); +153 } catch (RundeckApiTokenException e) { +154 throw e; +155 } catch (RundeckApiException e) { +156 throw new RundeckApiTokenException("Failed to verify token", e); +157 } +158 } +159 +160 /** +161 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the +162 * API call. At the end, the given parser will be used to convert the response to a more useful result object. +163 * +164 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +165 * @param parser used to parse the response +166 * @return the result of the call, as formatted by the parser +167 * @throws RundeckApiException in case of error when calling the API +168 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +169 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +170 */ +171 public <T> T get(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, +172 RundeckApiLoginException, RundeckApiTokenException { +173 HttpGet request = new HttpGet(client.getUrl() + client.getApiEndpoint() + apiPath); +174 if (null != apiPath.getAccept()) { +175 request.setHeader("Accept", apiPath.getAccept()); +176 } +177 return execute(request, parser); +178 } +179 +180 /** +181 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the +182 * API call. +183 * +184 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +185 * @return a new {@link InputStream} instance, not linked with network resources +186 * @throws RundeckApiException in case of error when calling the API +187 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +188 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +189 */ +190 public InputStream get(ApiPathBuilder apiPath) throws RundeckApiException, RundeckApiLoginException, +191 RundeckApiTokenException { +192 HttpGet request = new HttpGet(client.getUrl() + client.getApiEndpoint() + apiPath); +193 if (null != apiPath.getAccept()) { +194 request.setHeader("Accept", apiPath.getAccept()); +195 } +196 ByteArrayInputStream response = execute(request); +197 +198 // try to load the document, to throw an exception in case of error +199 ParserHelper.loadDocument(response); +200 response.reset(); +201 +202 return response; +203 } +204 +205 /** +206 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the +207 * API call without appending the API_ENDPOINT to the URL. +208 * +209 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +210 * @return a new {@link InputStream} instance, not linked with network resources +211 * @throws RundeckApiException in case of error when calling the API +212 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +213 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +214 */ +215 public InputStream getNonApi(ApiPathBuilder apiPath) throws RundeckApiException, RundeckApiLoginException, +216 RundeckApiTokenException { +217 HttpGet request = new HttpGet(client.getUrl() + apiPath); +218 if (null != apiPath.getAccept()) { +219 request.setHeader("Accept", apiPath.getAccept()); +220 } +221 ByteArrayInputStream response = execute(request); +222 response.reset(); +223 +224 return response; +225 } +226 +227 /** +228 * Execute an HTTP POST or GET request to the RunDeck instance, on the given path, depend ing of the {@link +229 * ApiPathBuilder} contains POST content or not (attachments or Form data). We will login first, and then execute +230 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. +231 * +232 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +233 * @param parser used to parse the response +234 * +235 * @return the result of the call, as formatted by the parser +236 * +237 * @throws RundeckApiException in case of error when calling the API +238 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +239 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +240 */ +241 public <T> T postOrGet(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, +242 RundeckApiLoginException, +243 RundeckApiTokenException { +244 if (apiPath.hasPostContent()) { +245 return post(apiPath, parser); +246 } else { +247 return get(apiPath, parser); +248 } +249 } +250 +251 /** +252 * Execute an HTTP POST request to the RunDeck instance, on the given path. We will login first, and then execute +253 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. +254 * +255 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +256 * @param parser used to parse the response +257 * @return the result of the call, as formatted by the parser +258 * @throws RundeckApiException in case of error when calling the API +259 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +260 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +261 */ +262 public <T> T post(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, +263 RundeckApiLoginException, RundeckApiTokenException { +264 HttpPost httpPost = new HttpPost(client.getUrl() + client.getApiEndpoint() + apiPath); +265 return requestWithEntity(apiPath, parser, httpPost); +266 } +267 /** +268 * Execute an HTTP PUT request to the RunDeck instance, on the given path. We will login first, and then execute +269 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. +270 * +271 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +272 * @param parser used to parse the response +273 * @return the result of the call, as formatted by the parser +274 * @throws RundeckApiException in case of error when calling the API +275 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +276 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +277 */ +278 public <T> T put(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, +279 RundeckApiLoginException, RundeckApiTokenException { +280 HttpPut httpPut = new HttpPut(client.getUrl() + client.getApiEndpoint() + apiPath); +281 return requestWithEntity(apiPath, parser, httpPut); +282 } +283 +284 private <T> T requestWithEntity(ApiPathBuilder apiPath, XmlNodeParser<T> parser, HttpEntityEnclosingRequestBase +285 httpPost) { +286 if(null!= apiPath.getAccept()) { +287 httpPost.setHeader("Accept", apiPath.getAccept()); +288 } +289 // POST a multi-part request, with all attachments +290 if(apiPath.getAttachments().size()>0){ +291 MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); +292 for (Entry<String, InputStream> attachment : apiPath.getAttachments().entrySet()) { +293 entity.addPart(attachment.getKey(), new InputStreamBody(attachment.getValue(), attachment.getKey())); +294 } +295 httpPost.setEntity(entity); +296 }else if(apiPath.getForm().size()>0){ +297 try { +298 httpPost.setEntity(new UrlEncodedFormEntity(apiPath.getForm(), HTTP.UTF_8)); +299 } catch (UnsupportedEncodingException e) { +300 throw new RundeckApiException("Unsupported encoding: " + e.getMessage(), e); +301 } +302 }else if(apiPath.getContentStream() !=null && apiPath.getContentType()!=null){ +303 BasicHttpEntity entity = new BasicHttpEntity(); +304 entity.setContent(apiPath.getContentStream()); +305 entity.setContentType(apiPath.getContentType()); +306 httpPost.setEntity(entity); +307 }else if(apiPath.getContentFile() !=null && apiPath.getContentType()!=null){ +308 httpPost.setEntity(new FileEntity(apiPath.getContentFile(), apiPath.getContentType())); +309 }else if(apiPath.getXmlDocument()!=null) { +310 httpPost.setHeader("Content-Type", "application/xml"); +311 httpPost.setEntity(new EntityTemplate(new DocumentContentProducer(apiPath.getXmlDocument()))); +312 }else if(apiPath.isEmptyContent()){ +313 //empty content +314 }else { +315 throw new IllegalArgumentException("No Form or Multipart entity for POST content-body"); +316 } +317 +318 return execute(httpPost, parser); +319 } +320 +321 /** +322 * Execute an HTTP DELETE request to the RunDeck instance, on the given path. We will login first, and then execute +323 * the API call. At the end, the given parser will be used to convert the response to a more useful result object. +324 * +325 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +326 * @param parser used to parse the response +327 * @return the result of the call, as formatted by the parser +328 * @throws RundeckApiException in case of error when calling the API +329 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +330 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +331 */ +332 public <T> T delete(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, +333 RundeckApiLoginException, RundeckApiTokenException { +334 return execute(new HttpDelete(client.getUrl() + client.getApiEndpoint() + apiPath), parser); +335 } +336 /** +337 * Execute an HTTP DELETE request to the RunDeck instance, on the given path, and expect a 204 response. +338 * +339 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +340 * @throws RundeckApiException in case of error when calling the API +341 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +342 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +343 */ +344 public void delete(ApiPathBuilder apiPath) throws RundeckApiException, +345 RundeckApiLoginException, RundeckApiTokenException { +346 +347 InputStream response = execute(new HttpDelete(client.getUrl() + client.getApiEndpoint() + apiPath)); +348 if(null!=response){ +349 throw new RundeckApiException("Unexpected Rundeck response content, expected no content!"); +350 } +351 } +352 +353 /** +354 * Execute an HTTP request to the RunDeck instance. We will login first, and then execute the API call. At the end, +355 * the given parser will be used to convert the response to a more useful result object. +356 * +357 * @param request to execute. see {@link HttpGet}, {@link HttpDelete}, and so on... +358 * @param parser used to parse the response +359 * @return the result of the call, as formatted by the parser +360 * @throws RundeckApiException in case of error when calling the API +361 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +362 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +363 */ +364 private <T> T execute(HttpRequestBase request, XmlNodeParser<T> parser) throws RundeckApiException, +365 RundeckApiLoginException, RundeckApiTokenException { +366 // execute the request +367 return new ParserHandler<T>(parser).handle(execute(request, new ResultHandler())); +368 } +369 +370 /** +371 * Execute an HTTP GET request to the RunDeck instance, on the given path. We will login first, and then execute the +372 * API call. At the end, the given parser will be used to convert the response to a more useful result object. +373 * +374 * @param apiPath on which we will make the HTTP request - see {@link ApiPathBuilder} +375 * @param parser used to parse the response +376 * +377 * @return the result of the call, as formatted by the parser +378 * +379 * @throws RundeckApiException in case of error when calling the API +380 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +381 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +382 */ +383 public int get(ApiPathBuilder apiPath, OutputStream outputStream) throws RundeckApiException, +384 RundeckApiLoginException, RundeckApiTokenException, IOException { +385 HttpGet request = new HttpGet(client.getUrl() + client.getApiEndpoint() + apiPath); +386 if (null != apiPath.getAccept()) { +387 request.setHeader("Accept", apiPath.getAccept()); +388 } +389 final WriteOutHandler writeOutHandler = new WriteOutHandler(outputStream); +390 Handler<HttpResponse,Integer> handler = writeOutHandler; +391 if(null!=apiPath.getRequiredContentType()){ +392 handler = new RequireContentTypeHandler<Integer>(apiPath.getRequiredContentType(), handler); +393 } +394 final int wrote = execute(request, handler); +395 if(writeOutHandler.thrown!=null){ +396 throw writeOutHandler.thrown; +397 } +398 return wrote; +399 } +400 /** +401 * Execute an HTTP request to the RunDeck instance. We will login first, and then execute the API call. +402 * +403 * @param request to execute. see {@link HttpGet}, {@link HttpDelete}, and so on... +404 * @return a new {@link InputStream} instance, not linked with network resources +405 * @throws RundeckApiException in case of error when calling the API +406 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +407 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +408 */ +409 private ByteArrayInputStream execute(HttpUriRequest request) throws RundeckApiException, RundeckApiLoginException, +410 RundeckApiTokenException { +411 return execute(request, new ResultHandler() ); +412 } +413 +414 /** +415 * Handles one type into another +416 * @param <T> +417 * @param <V> +418 */ +419 private static interface Handler<T,V>{ +420 public V handle(T response); +421 } +422 +423 /** +424 * Handles parsing inputstream via a parser +425 * @param <S> +426 */ +427 private static class ParserHandler<S> implements Handler<InputStream,S> { +428 XmlNodeParser<S> parser; +429 +430 private ParserHandler(XmlNodeParser<S> parser) { +431 this.parser = parser; +432 } +433 +434 @Override +435 public S handle(InputStream response) { +436 // read and parse the response +437 return parser.parseXmlNode(ParserHelper.loadDocument(response)); +438 } +439 } +440 +441 /** +442 * Handles writing response to an output stream +443 */ +444 private static class ChainHandler<T> implements Handler<HttpResponse,T> { +445 Handler<HttpResponse, T> chain; +446 private ChainHandler(Handler<HttpResponse,T> chain) { +447 this.chain=chain; +448 } +449 @Override +450 public T handle(final HttpResponse response) { +451 return chain.handle(response); +452 } +453 } +454 +455 /** +456 * Handles writing response to an output stream +457 */ +458 private static class RequireContentTypeHandler<T> extends ChainHandler<T> { +459 String contentType; +460 +461 private RequireContentTypeHandler(final String contentType, final Handler<HttpResponse, T> chain) { +462 super(chain); +463 this.contentType = contentType; +464 } +465 +466 @Override +467 public T handle(final HttpResponse response) { +468 final Header firstHeader = response.getFirstHeader("Content-Type"); +469 final String[] split = firstHeader.getValue().split(";"); +470 boolean matched=false; +471 for (int i = 0; i < split.length; i++) { +472 String s = split[i]; +473 if (this.contentType.equalsIgnoreCase(s.trim())) { +474 matched=true; +475 break; +476 } +477 } +478 if(!matched) { +479 throw new RundeckApiException.RundeckApiHttpContentTypeException(firstHeader.getValue(), +480 this.contentType); +481 } +482 return super.handle(response); +483 } +484 } +485 +486 /** +487 * Handles writing response to an output stream +488 */ +489 private static class WriteOutHandler implements Handler<HttpResponse,Integer> { +490 private WriteOutHandler(OutputStream writeOut) { +491 this.writeOut = writeOut; +492 } +493 +494 OutputStream writeOut; +495 IOException thrown; +496 @Override +497 public Integer handle(final HttpResponse response) { +498 try { +499 return IOUtils.copy(response.getEntity().getContent(), writeOut); +500 } catch (IOException e) { +501 thrown=e; +502 } +503 return -1; +504 } +505 } +506 +507 /** +508 * Handles reading response into a byte array stream +509 */ +510 private static class ResultHandler implements Handler<HttpResponse,ByteArrayInputStream> { +511 @Override +512 public ByteArrayInputStream handle(final HttpResponse response) { +513 // return a new inputStream, so that we can close all network resources +514 try { +515 return new ByteArrayInputStream(EntityUtils.toByteArray(response.getEntity())); +516 } catch (IOException e) { +517 throw new RundeckApiException("Failed to consume entity and convert the inputStream", e); +518 } +519 } +520 } +521 /** +522 * Execute an HTTP request to the RunDeck instance. We will login first, and then execute the API call. +523 * +524 * @param request to execute. see {@link HttpGet}, {@link HttpDelete}, and so on... +525 * @return a new {@link InputStream} instance, not linked with network resources +526 * @throws RundeckApiException in case of error when calling the API +527 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +528 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +529 */ +530 private <T> T execute(HttpUriRequest request, Handler<HttpResponse,T> handler) throws RundeckApiException, +531 RundeckApiLoginException, +532 RundeckApiTokenException { +533 HttpClient httpClient = instantiateHttpClient(); +534 try { +535 // we only need to manually login in case of login-based authentication +536 // note that in case of token-based auth, the auth (via an HTTP header) is managed by an interceptor. +537 if (client.getToken() == null && client.getSessionID() == null) { +538 login(httpClient); +539 } +540 +541 // execute the HTTP request +542 HttpResponse response = null; +543 try { +544 response = httpClient.execute(request); +545 } catch (IOException e) { +546 throw new RundeckApiException("Failed to execute an HTTP " + request.getMethod() + " on url : " +547 + request.getURI(), e); +548 } +549 +550 // in case of error, we get a redirect to /api/error +551 // that we need to follow manually for POST and DELETE requests (as GET) +552 int statusCode = response.getStatusLine().getStatusCode(); +553 if (statusCode / 100 == 3) { +554 String newLocation = response.getFirstHeader("Location").getValue(); +555 try { +556 EntityUtils.consume(response.getEntity()); +557 } catch (IOException e) { +558 throw new RundeckApiException("Failed to consume entity (release connection)", e); +559 } +560 request = new HttpGet(newLocation); +561 try { +562 response = httpClient.execute(request); +563 statusCode = response.getStatusLine().getStatusCode(); +564 } catch (IOException e) { +565 throw new RundeckApiException("Failed to execute an HTTP GET on url : " + request.getURI(), e); +566 } +567 } +568 +569 // check the response code (should be 2xx, even in case of error : error message is in the XML result) +570 if (statusCode / 100 != 2) { +571 if (statusCode == 403 && +572 (client.getToken() != null || client.getSessionID() != null)) { +573 throw new RundeckApiTokenException("Invalid Token or sessionID ! Got HTTP response '" + response.getStatusLine() +574 + "' for " + request.getURI()); +575 } else { +576 throw new RundeckApiException.RundeckApiHttpStatusException("Invalid HTTP response '" + response.getStatusLine() + "' for " +577 + request.getURI(), statusCode); +578 } +579 } +580 if(statusCode==204){ +581 return null; +582 } +583 if (response.getEntity() == null) { +584 throw new RundeckApiException("Empty RunDeck response ! HTTP status line is : " +585 + response.getStatusLine()); +586 } +587 return handler.handle(response); +588 } finally { +589 httpClient.getConnectionManager().shutdown(); +590 } +591 } +592 +593 /** +594 * Do the actual work of login, using the given {@link HttpClient} instance. You'll need to re-use this instance +595 * when making API calls (such as running a job). Only use this in case of login-based authentication. +596 * +597 * @param httpClient pre-instantiated +598 * @throws RundeckApiLoginException if the login failed +599 */ +600 private String login(HttpClient httpClient) throws RundeckApiLoginException { +601 String sessionID = null; +602 +603 // 1. call expected GET request +604 String location = client.getUrl(); +605 +606 try { +607 HttpGet getRequest = new HttpGet(location); +608 HttpResponse response = httpClient.execute(getRequest); +609 +610 // sessionID stored in case user wants to cache it for reuse +611 Header cookieHeader = response.getFirstHeader("Set-Cookie"); +612 if (cookieHeader != null) { +613 String cookieStr = cookieHeader.getValue(); +614 if (cookieStr != null) { +615 int i1 = cookieStr.indexOf("JSESSIONID="); +616 if (i1 >= 0) { +617 cookieStr = cookieStr.substring(i1 + "JSESSIONID=".length()); +618 int i2 = cookieStr.indexOf(";"); +619 if (i2 >= 0) { +620 sessionID = cookieStr.substring(0, i2); +621 } +622 } +623 } +624 } +625 +626 try { +627 EntityUtils.consume(response.getEntity()); +628 } catch (IOException e) { +629 throw new RundeckApiLoginException("Failed to consume entity (release connection)", e); +630 } +631 } catch (IOException e) { +632 throw new RundeckApiLoginException("Failed to get request on " + location, e); +633 } +634 +635 // 2. then call POST login request +636 location += "/j_security_check"; +637 +638 while (true) { +639 try { +640 HttpPost postLogin = new HttpPost(location); +641 List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>(); +642 params.add(new BasicNameValuePair("j_username", client.getLogin())); +643 params.add(new BasicNameValuePair("j_password", client.getPassword())); +644 params.add(new BasicNameValuePair("action", "login")); +645 postLogin.setEntity(new UrlEncodedFormEntity(params, Consts.UTF_8)); +646 HttpResponse response = httpClient.execute(postLogin); +647 +648 if (response.getStatusLine().getStatusCode() / 100 == 3) { +649 // HTTP client refuses to handle redirects (code 3xx) for POST, so we have to do it manually... +650 location = response.getFirstHeader("Location").getValue(); +651 try { +652 EntityUtils.consume(response.getEntity()); +653 } catch (IOException e) { +654 throw new RundeckApiLoginException("Failed to consume entity (release connection)", e); +655 } +656 continue; +657 } +658 +659 if (response.getStatusLine().getStatusCode() / 100 != 2) { +660 throw new RundeckApiLoginException("Invalid HTTP response '" + response.getStatusLine() + "' for " +661 + location); +662 } +663 +664 try { +665 String content = EntityUtils.toString(response.getEntity(), Consts.UTF_8); +666 if (StringUtils.contains(content, "j_security_check")) { +667 throw new RundeckApiLoginException("Login failed for user " + client.getLogin()); +668 } +669 try { +670 EntityUtils.consume(response.getEntity()); +671 } catch (IOException e) { +672 throw new RundeckApiLoginException("Failed to consume entity (release connection)", e); +673 } +674 break; +675 } catch (IOException io) { +676 throw new RundeckApiLoginException("Failed to read RunDeck result", io); +677 } catch (ParseException p) { +678 throw new RundeckApiLoginException("Failed to parse RunDeck response", p); +679 } +680 } catch (IOException e) { +681 throw new RundeckApiLoginException("Failed to post login form on " + location, e); +682 } +683 } +684 +685 return sessionID; +686 } +687 688 -689 -690 /** -691 * Instantiate a new {@link HttpClient} instance, configured to accept all SSL certificates -692 * -693 * @return an {@link HttpClient} instance - won't be null -694 */ -695 private HttpClient instantiateHttpClient() { -696 DefaultHttpClient httpClient = new DefaultHttpClient(); -697 -698 // configure user-agent -699 HttpProtocolParams.setUserAgent(httpClient.getParams(), "RunDeck API Java Client " + client.getApiVersion()); -700 -701 // configure SSL -702 SSLSocketFactory socketFactory = null; -703 try { -704 socketFactory = new SSLSocketFactory(new TrustStrategy() { -705 -706 @Override -707 public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { -708 return true; -709 } -710 }, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); -711 } catch (KeyManagementException e) { -712 throw new RuntimeException(e); -713 } catch (UnrecoverableKeyException e) { -714 throw new RuntimeException(e); -715 } catch (NoSuchAlgorithmException e) { -716 throw new RuntimeException(e); -717 } catch (KeyStoreException e) { -718 throw new RuntimeException(e); -719 } -720 httpClient.getConnectionManager().getSchemeRegistry().register(new Scheme("https", 443, socketFactory)); -721 -722 // configure proxy (use system env : http.proxyHost / http.proxyPort) -723 System.setProperty("java.net.useSystemProxies", "true"); -724 httpClient.setRoutePlanner(new ProxySelectorRoutePlanner(httpClient.getConnectionManager().getSchemeRegistry(), -725 ProxySelector.getDefault())); -726 -727 // in case of token-based authentication, add the correct HTTP header to all requests via an interceptor -728 httpClient.addRequestInterceptor(new HttpRequestInterceptor() { -729 -730 @Override -731 public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { -732 if (client.getToken() != null) { -733 request.addHeader(AUTH_TOKEN_HEADER, client.getToken()); -734 //System.out.println("httpClient adding token header"); -735 } -736 else if(client.getSessionID() != null) { -737 request.addHeader(COOKIE_HEADER, "JSESSIONID="+client.getSessionID()); -738 //System.out.println("httpClient adding session header, sessionID="+client.getSessionID()); -739 } -740 } -741 }); -742 -743 return httpClient; -744 } -745 } +689 /** +690 * Instantiate a new {@link HttpClient} instance, configured to accept all SSL certificates +691 * +692 * @return an {@link HttpClient} instance - won't be null +693 */ +694 private HttpClient instantiateHttpClient() { +695 DefaultHttpClient httpClient = new DefaultHttpClient(); +696 +697 // configure user-agent +698 HttpProtocolParams.setUserAgent(httpClient.getParams(), "RunDeck API Java Client " + client.getApiVersion()); +699 +700 // configure SSL +701 SSLSocketFactory socketFactory = null; +702 try { +703 socketFactory = new SSLSocketFactory(new TrustStrategy() { +704 +705 @Override +706 public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { +707 return true; +708 } +709 }, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); +710 } catch (KeyManagementException e) { +711 throw new RuntimeException(e); +712 } catch (UnrecoverableKeyException e) { +713 throw new RuntimeException(e); +714 } catch (NoSuchAlgorithmException e) { +715 throw new RuntimeException(e); +716 } catch (KeyStoreException e) { +717 throw new RuntimeException(e); +718 } +719 httpClient.getConnectionManager().getSchemeRegistry().register(new Scheme("https", 443, socketFactory)); +720 +721 // configure proxy (use system env : http.proxyHost / http.proxyPort) +722 System.setProperty("java.net.useSystemProxies", "true"); +723 httpClient.setRoutePlanner(new ProxySelectorRoutePlanner(httpClient.getConnectionManager().getSchemeRegistry(), +724 ProxySelector.getDefault())); +725 +726 // in case of token-based authentication, add the correct HTTP header to all requests via an interceptor +727 httpClient.addRequestInterceptor(new HttpRequestInterceptor() { +728 +729 @Override +730 public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { +731 if (client.getToken() != null) { +732 request.addHeader(AUTH_TOKEN_HEADER, client.getToken()); +733 //System.out.println("httpClient adding token header"); +734 } +735 else if(client.getSessionID() != null) { +736 request.addHeader(COOKIE_HEADER, "JSESSIONID="+client.getSessionID()); +737 //System.out.println("httpClient adding session header, sessionID="+client.getSessionID()); +738 } +739 } +740 }); +741 +742 return httpClient; +743 } +744 }
      diff --git a/xref/org/rundeck/api/QueryParameterBuilder.html b/xref/org/rundeck/api/QueryParameterBuilder.html index da36bc8..85e57a3 100644 --- a/xref/org/rundeck/api/QueryParameterBuilder.html +++ b/xref/org/rundeck/api/QueryParameterBuilder.html @@ -46,51 +46,54 @@ 36 abstract class QueryParameterBuilder implements ApiPathBuilder.BuildsParameters { 37 public static final String W3C_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; 38 static final SimpleDateFormat format = new SimpleDateFormat(W3C_DATE_FORMAT); -39 -40 /** -41 * Add a value to the builder for a given key -42 * -43 * @param key parameter name -44 * @param value value which can be a String, Boolean, Date or collection of Strings. Other types will be converted -45 * via {@link Object#toString()} -46 * @param doPost if true, add POST field instead of query parameters -47 * @param builder the builder -48 * -49 * @return true if the value was not null and was added to the builder -50 */ -51 protected boolean visit(String key, Object value, boolean doPost, ApiPathBuilder builder) { -52 if (null != value) { -53 if (doPost) { -54 if (value instanceof Collection) { -55 builder.field(key, (Collection<String>) value); -56 } else { -57 builder.field(key, stringVal(value)); -58 } -59 return true; -60 } else { -61 if (value instanceof Collection) { -62 builder.param(key, (Collection<String>) value); -63 } else { -64 builder.param(key, stringVal(value)); -65 } -66 return true; -67 } -68 } -69 return false; -70 } -71 -72 private String stringVal(Object value) { -73 return value instanceof String ? (String) value : -74 value instanceof Boolean ? Boolean.toString((Boolean) value) : -75 value instanceof Date ? formatDate((Date) value) -76 -77 : value.toString(); -78 } +39 static { +40 format.setTimeZone(TimeZone.getTimeZone("GMT")); +41 } +42 +43 /** +44 * Add a value to the builder for a given key +45 * +46 * @param key parameter name +47 * @param value value which can be a String, Boolean, Date or collection of Strings. Other types will be converted +48 * via {@link Object#toString()} +49 * @param doPost if true, add POST field instead of query parameters +50 * @param builder the builder +51 * +52 * @return true if the value was not null and was added to the builder +53 */ +54 protected boolean visit(String key, Object value, boolean doPost, ApiPathBuilder builder) { +55 if (null != value) { +56 if (doPost) { +57 if (value instanceof Collection) { +58 builder.field(key, (Collection<String>) value); +59 } else { +60 builder.field(key, stringVal(value)); +61 } +62 return true; +63 } else { +64 if (value instanceof Collection) { +65 builder.param(key, (Collection<String>) value); +66 } else { +67 builder.param(key, stringVal(value)); +68 } +69 return true; +70 } +71 } +72 return false; +73 } +74 +75 private String stringVal(Object value) { +76 return value instanceof String ? (String) value : +77 value instanceof Boolean ? Boolean.toString((Boolean) value) : +78 value instanceof Date ? formatDate((Date) value) 79 -80 private String formatDate(Date value) { -81 return format.format(value); -82 } -83 } +80 : value.toString(); +81 } +82 +83 private String formatDate(Date value) { +84 return format.format(value); +85 } +86 }
      diff --git a/xref/org/rundeck/api/RundeckClient.html b/xref/org/rundeck/api/RundeckClient.html index 75cfbd2..b3007e1 100644 --- a/xref/org/rundeck/api/RundeckClient.html +++ b/xref/org/rundeck/api/RundeckClient.html @@ -33,2583 +33,2676 @@ 23 import org.rundeck.api.RundeckApiException.RundeckApiTokenException; 24 import org.rundeck.api.domain.*; 25 import org.rundeck.api.domain.RundeckExecution.ExecutionStatus; -26 import org.rundeck.api.generator.ProjectConfigGenerator; -27 import org.rundeck.api.generator.ProjectConfigPropertyGenerator; -28 import org.rundeck.api.generator.ProjectGenerator; -29 import org.rundeck.api.parser.*; -30 import org.rundeck.api.query.ExecutionQuery; -31 import org.rundeck.api.util.AssertUtil; -32 import org.rundeck.api.util.PagedResults; -33 import org.rundeck.api.util.ParametersUtil; -34 -35 import java.io.*; -36 import java.util.*; -37 import java.util.concurrent.TimeUnit; -38 -39 /** -40 * Rundeck API client. -41 * <p> -42 * There are three methods for authentication : login-based or token-based or session-based. -43 * Login authentication requires -44 * both a "login" and a "password". Token-based requires a "token" (also called "auth-token"). See the RunDeck -45 * documentation for generating such a token.</p> -46 * <p> -47 * Session-based authentication allows re-use of a previous login session. See {@link #testAuth()}. -48 * </p> -49 * <p> -50 * Deprecation notice: All public constructors for this class are deprecated. Use the {@link RundeckClientBuilder} or {@link #builder()} convenience method to create a RundeckClient. The public constructors will be made non-public in version 12 of this library. -51 * </p> -52 * <br> -53 * Usage : <br> -54 * <code> -55 * <pre> -56 * // using login-based authentication : -57 * RundeckClient rundeck = RundeckClient.builder() -58 * .url("http://localhost:4440") -59 * .login("admin", "admin").build(); -60 * // or for a token-based authentication : -61 * RundeckClient rundeck = RundeckClient.builder() -62 * .url("http://localhost:4440") -63 * .token("PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD").build(); -64 * -65 * List&lt;RundeckProject&gt; projects = rundeck.getProjects(); -66 * -67 * RundeckJob job = rundeck.findJob("my-project", "main-group/sub-group", "job-name"); -68 * RundeckExecution execution = rundeck.triggerJob(job.getId(), -69 * new OptionsBuilder().addOption("version", "1.2.0").toProperties()); -70 * -71 * List&lt;RundeckExecution&gt; runningExecutions = rundeck.getRunningExecutions("my-project"); -72 * -73 * rundeck.exportJobsToFile("/tmp/jobs.xml", FileType.XML, "my-project"); -74 * rundeck.importJobs("/tmp/jobs.xml", FileType.XML); -75 * </pre> -76 * </code> -77 * -78 * @author Vincent Behar -79 */ -80 public class RundeckClient implements Serializable { -81 -82 private static final long serialVersionUID = 1L; -83 public static final String JOBS_IMPORT = "/jobs/import"; -84 public static final String STORAGE_ROOT_PATH = "/storage/"; -85 public static final String STORAGE_KEYS_PATH = "keys/"; -86 -87 /** -88 * Supported version numbers -89 */ -90 public static enum Version { -91 V5(5), -92 V6(6), -93 V7(7), -94 V8(8), -95 V9(9), -96 V10(10), -97 V11(11), -98 ; -99 -100 private int versionNumber; +26 import org.rundeck.api.generator.DeleteExecutionsGenerator; +27 import org.rundeck.api.generator.ProjectConfigGenerator; +28 import org.rundeck.api.generator.ProjectConfigPropertyGenerator; +29 import org.rundeck.api.generator.ProjectGenerator; +30 import org.rundeck.api.parser.*; +31 import org.rundeck.api.query.ExecutionQuery; +32 import org.rundeck.api.util.AssertUtil; +33 import org.rundeck.api.util.PagedResults; +34 import org.rundeck.api.util.ParametersUtil; +35 +36 import java.io.*; +37 import java.util.*; +38 import java.util.concurrent.TimeUnit; +39 +40 /** +41 * Rundeck API client. +42 * <p> +43 * There are three methods for authentication : login-based or token-based or session-based. +44 * Login authentication requires +45 * both a "login" and a "password". Token-based requires a "token" (also called "auth-token"). See the RunDeck +46 * documentation for generating such a token.</p> +47 * <p> +48 * Session-based authentication allows re-use of a previous login session. See {@link #testAuth()}. +49 * </p> +50 * <p> +51 * Deprecation notice: All public constructors for this class are deprecated. Use the {@link RundeckClientBuilder} or {@link #builder()} convenience method to create a RundeckClient. The public constructors will be made non-public in version 12 of this library. +52 * </p> +53 * <br> +54 * Usage : <br> +55 * <code> +56 * <pre> +57 * // using login-based authentication : +58 * RundeckClient rundeck = RundeckClient.builder() +59 * .url("http://localhost:4440") +60 * .login("admin", "admin").build(); +61 * // or for a token-based authentication : +62 * RundeckClient rundeck = RundeckClient.builder() +63 * .url("http://localhost:4440") +64 * .token("PDDNKo5VE29kpk4prOUDr2rsKdRkEvsD").build(); +65 * +66 * List&lt;RundeckProject&gt; projects = rundeck.getProjects(); +67 * +68 * RundeckJob job = rundeck.findJob("my-project", "main-group/sub-group", "job-name"); +69 * RundeckExecution execution = rundeck.triggerJob(job.getId(), +70 * new OptionsBuilder().addOption("version", "1.2.0").toProperties()); +71 * +72 * List&lt;RundeckExecution&gt; runningExecutions = rundeck.getRunningExecutions("my-project"); +73 * +74 * rundeck.exportJobsToFile("/tmp/jobs.xml", FileType.XML, "my-project"); +75 * rundeck.importJobs("/tmp/jobs.xml", FileType.XML); +76 * </pre> +77 * </code> +78 * +79 * @author Vincent Behar +80 */ +81 public class RundeckClient implements Serializable { +82 +83 private static final long serialVersionUID = 1L; +84 public static final String JOBS_IMPORT = "/jobs/import"; +85 public static final String STORAGE_ROOT_PATH = "/storage/"; +86 public static final String STORAGE_KEYS_PATH = "keys/"; +87 +88 /** +89 * Supported version numbers +90 */ +91 public static enum Version { +92 V5(5), +93 V6(6), +94 V7(7), +95 V8(8), +96 V9(9), +97 V10(10), +98 V11(11), +99 V12(12), +100 ; 101 -102 Version(final int i) { -103 versionNumber = i; -104 } -105 -106 public int getVersionNumber() { -107 return versionNumber; -108 } -109 } -110 /** Version of the API supported */ -111 public static final transient int API_VERSION = Version.V11.getVersionNumber(); -112 -113 private static final String API = "/api/"; +102 private int versionNumber; +103 +104 Version(final int i) { +105 versionNumber = i; +106 } +107 +108 public int getVersionNumber() { +109 return versionNumber; +110 } +111 } +112 /** Version of the API supported */ +113 public static final transient int API_VERSION = Version.V12.getVersionNumber(); 114 -115 /** End-point of the API */ -116 public static final transient String API_ENDPOINT = API + API_VERSION; -117 -118 /** Default value for the "pooling interval" used when running jobs/commands/scripts */ -119 public static final transient long DEFAULT_POOLING_INTERVAL = 5; -120 -121 /** Default unit of the "pooling interval" used when running jobs/commands/scripts */ -122 public static final TimeUnit DEFAULT_POOLING_UNIT = TimeUnit.SECONDS; -123 -124 /** URL of the RunDeck instance ("http://localhost:4440" target="alexandria_uri">http://localhost:4440", "http://rundeck.your-compagny.com/", etc) */ -125 private final String url; -126 -127 private int apiVersion = API_VERSION; +115 private static final String API = "/api/"; +116 +117 /** End-point of the API */ +118 public static final transient String API_ENDPOINT = API + API_VERSION; +119 +120 /** Default value for the "pooling interval" used when running jobs/commands/scripts */ +121 public static final transient long DEFAULT_POOLING_INTERVAL = 5; +122 +123 /** Default unit of the "pooling interval" used when running jobs/commands/scripts */ +124 public static final TimeUnit DEFAULT_POOLING_UNIT = TimeUnit.SECONDS; +125 +126 /** URL of the RunDeck instance ("http://localhost:4440" target="alexandria_uri">http://localhost:4440", "http://rundeck.your-compagny.com/", etc) */ +127 private final String url; 128 -129 private String token; +129 private int apiVersion = API_VERSION; 130 -131 private String login; +131 private String token; 132 -133 private String password; +133 private String login; 134 -135 private String sessionID; +135 private String password; 136 -137 void setToken(String token) { -138 this.token = token; -139 } -140 -141 void setLogin(String login) { -142 this.login = login; -143 } -144 -145 void setPassword(String password) { -146 this.password = password; -147 } -148 -149 void setSessionID(String sessionID) { -150 this.sessionID = sessionID; -151 } -152 -153 int getApiVersion() { -154 return (apiVersion > 0 ? apiVersion : API_VERSION); -155 } -156 -157 void setApiVersion(int apiVersion) { -158 this.apiVersion = (apiVersion > 0 ? apiVersion : API_VERSION); -159 } -160 -161 void setApiVersion(Version apiVersion) { -162 setApiVersion(apiVersion.getVersionNumber()); -163 } -164 -165 String getApiEndpoint() { -166 return API + getApiVersion(); -167 } -168 -169 /** -170 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, using login-based -171 * authentication. -172 * -173 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) -174 * @param login to use for authentication on the RunDeck instance -175 * @param password to use for authentication on the RunDeck instance -176 * @throws IllegalArgumentException if the url, login or password is blank (null, empty or whitespace) -177 * -178 * @deprecated Use the builder {@link RundeckClientBuilder} or {@link #builder()}, this method will not be public in version 12 of this -179 * library. -180 */ -181 public RundeckClient(String url, String login, String password) throws IllegalArgumentException { -182 this(url); -183 AssertUtil.notBlank(login, "The RunDeck login is mandatory !"); -184 AssertUtil.notBlank(password, "The RunDeck password is mandatory !"); -185 this.login = login; -186 this.password = password; -187 this.token = null; -188 } -189 -190 /** -191 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, -192 * using token-based or session-based authentication. Either token or sessionID must be valid -193 * -194 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) -195 * @param token to use for authentication on the RunDeck instance -196 * @param sessionID to use for session authentication on the RunDeck instance -197 * @param useToken should be true if using token, false if using sessionID -198 * @throws IllegalArgumentException if the url or token is blank (null, empty or whitespace) -199 * @deprecated Use the builder {@link RundeckClientBuilder} or {@link #builder()}, this method will not be public in version 10 of this library. -200 */ -201 private RundeckClient(String url, String token, String sessionID, boolean useToken) throws IllegalArgumentException { -202 this(url); -203 -204 if(useToken){ -205 AssertUtil.notBlank(token, "Token is mandatory!"); -206 this.token = token; -207 this.sessionID = null; -208 } -209 else { -210 AssertUtil.notBlank(sessionID, "sessionID is mandatory!"); -211 this.sessionID = sessionID; -212 this.token = null; -213 } -214 this.login = null; -215 this.password = null; -216 } -217 -218 -219 /** -220 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, -221 * using token-based authentication. Either token must be valid -222 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) -223 * @param token to use for authentication on the RunDeck instance -224 * @throws IllegalArgumentException if the url or token is blank (null, empty or whitespace) -225 * @deprecated Use the builder {@link RundeckClientBuilder} or {@link #builder()}, -226 * this method will not be public in version 12 of this -227 * library. -228 */ -229 public RundeckClient(String url, String token) throws IllegalArgumentException { -230 this(url, token, null, true); -231 } -232 -233 /** -234 * Used by RundeckClientBuilder -235 */ -236 RundeckClient(final String url) throws IllegalArgumentException { -237 AssertUtil.notBlank(url, "The RunDeck URL is mandatory !"); -238 this.url=url; -239 } -240 -241 /** -242 * Create a builder for RundeckClient -243 */ -244 public static RundeckClientBuilder builder() { -245 return new RundeckClientBuilder(); -246 } -247 -248 /** -249 * Try to "ping" the RunDeck instance to see if it is alive -250 * -251 * @throws RundeckApiException if the ping fails -252 */ -253 public void ping() throws RundeckApiException { -254 new ApiCall(this).ping(); -255 } -256 -257 /** -258 * Test the authentication on the RunDeck instance. -259 * -260 * @return sessionID if doing username+password login and it succeeded -261 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -262 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -263 */ -264 public String testAuth() throws RundeckApiLoginException, RundeckApiTokenException { -265 return (new ApiCall(this)).testAuth(); -266 } -267 -268 /** -269 * @deprecated Use {@link #testAuth()}, will be removed in version 12 of this library. -270 * @see #testAuth() -271 */ -272 @Deprecated -273 public void testCredentials() throws RundeckApiLoginException, RundeckApiTokenException { -274 testAuth(); -275 } -276 -277 /** -278 * Return root xpath for xml api results. for v11 and later it is empty, for earlier it is "result" -279 * -280 * @return -281 */ -282 private String rootXpath() { -283 return getApiVersion() < Version.V11.getVersionNumber() ? "result" : ""; -284 } -285 /* -286 * Projects -287 */ -288 -289 private ProjectParser createProjectParser() { -290 return createProjectParser(null); -291 } -292 -293 private ProjectParser createProjectParser(final String xpath) { -294 return new ProjectParserV11(xpath); -295 } -296 -297 /** -298 * List all projects -299 * -300 * @return a {@link List} of {@link RundeckProject} : might be empty, but won't be null -301 * @throws RundeckApiException in case of error when calling the API -302 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -303 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -304 */ -305 public List<RundeckProject> getProjects() throws RundeckApiException, RundeckApiLoginException, -306 RundeckApiTokenException { -307 return new ApiCall(this).get(new ApiPathBuilder("/projects"), -308 new ListParser<RundeckProject>(createProjectParser(), rootXpath() + -309 "/projects/project")); -310 } -311 -312 /** -313 * Get the definition of a single project, identified by the given name -314 * -315 * @param projectName name of the project - mandatory -316 * @return a {@link RundeckProject} instance - won't be null -317 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -318 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -319 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -320 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -321 */ -322 public RundeckProject getProject(String projectName) throws RundeckApiException, RundeckApiLoginException, -323 RundeckApiTokenException, IllegalArgumentException { -324 AssertUtil.notBlank(projectName, "projectName is mandatory to get the details of a project !"); -325 return new ApiCall(this).get(new ApiPathBuilder("/project/", projectName), -326 createProjectParser(rootXpath() + -327 (getApiVersion() < Version.V11.getVersionNumber() -328 ? "/projects/project" -329 : "/project" -330 ))); -331 } -332 -333 /** -334 * Create a new project, and return the new definition -335 * -336 * @param projectName name of the project - mandatory -337 * @param configuration project configuration properties -338 * -339 * @return a {@link RundeckProject} instance - won't be null +137 private String sessionID; +138 +139 void setToken(String token) { +140 this.token = token; +141 } +142 +143 void setLogin(String login) { +144 this.login = login; +145 } +146 +147 void setPassword(String password) { +148 this.password = password; +149 } +150 +151 void setSessionID(String sessionID) { +152 this.sessionID = sessionID; +153 } +154 +155 int getApiVersion() { +156 return (apiVersion > 0 ? apiVersion : API_VERSION); +157 } +158 +159 void setApiVersion(int apiVersion) { +160 this.apiVersion = (apiVersion > 0 ? apiVersion : API_VERSION); +161 } +162 +163 void setApiVersion(Version apiVersion) { +164 setApiVersion(apiVersion.getVersionNumber()); +165 } +166 +167 String getApiEndpoint() { +168 return API + getApiVersion(); +169 } +170 +171 /** +172 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, using login-based +173 * authentication. +174 * +175 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) +176 * @param login to use for authentication on the RunDeck instance +177 * @param password to use for authentication on the RunDeck instance +178 * @throws IllegalArgumentException if the url, login or password is blank (null, empty or whitespace) +179 * +180 * @deprecated Use the builder {@link RundeckClientBuilder} or {@link #builder()}, this method will not be public in version 12 of this +181 * library. +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} or {@link #builder()}, this method will not be public in version 10 of this library. +202 */ +203 private 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 /** +222 * Instantiate a new {@link RundeckClient} for the RunDeck instance at the given url, +223 * using token-based authentication. Either token must be valid +224 * @param url of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) +225 * @param token to use for authentication on the RunDeck instance +226 * @throws IllegalArgumentException if the url or token is blank (null, empty or whitespace) +227 * @deprecated Use the builder {@link RundeckClientBuilder} or {@link #builder()}, +228 * this method will not be public in version 12 of this +229 * library. +230 */ +231 public RundeckClient(String url, String token) throws IllegalArgumentException { +232 this(url, token, null, true); +233 } +234 +235 /** +236 * Used by RundeckClientBuilder +237 */ +238 RundeckClient(final String url) throws IllegalArgumentException { +239 AssertUtil.notBlank(url, "The RunDeck URL is mandatory !"); +240 this.url=url; +241 } +242 +243 /** +244 * Create a builder for RundeckClient +245 */ +246 public static RundeckClientBuilder builder() { +247 return new RundeckClientBuilder(); +248 } +249 +250 /** +251 * Try to "ping" the RunDeck instance to see if it is alive +252 * +253 * @throws RundeckApiException if the ping fails +254 */ +255 public void ping() throws RundeckApiException { +256 new ApiCall(this).ping(); +257 } +258 +259 /** +260 * Test the authentication on the RunDeck instance. +261 * +262 * @return sessionID if doing username+password login and it succeeded +263 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +264 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +265 */ +266 public String testAuth() throws RundeckApiLoginException, RundeckApiTokenException { +267 return (new ApiCall(this)).testAuth(); +268 } +269 +270 /** +271 * @deprecated Use {@link #testAuth()}, will be removed in version 12 of this library. +272 * @see #testAuth() +273 */ +274 @Deprecated +275 public void testCredentials() throws RundeckApiLoginException, RundeckApiTokenException { +276 testAuth(); +277 } +278 +279 /** +280 * Return root xpath for xml api results. for v11 and later it is empty, for earlier it is "result" +281 * +282 * @return +283 */ +284 private String rootXpath() { +285 return getApiVersion() < Version.V11.getVersionNumber() ? "result" : ""; +286 } +287 /* +288 * Projects +289 */ +290 +291 private ProjectParser createProjectParser() { +292 return createProjectParser(null); +293 } +294 +295 private ProjectParser createProjectParser(final String xpath) { +296 return new ProjectParserV11(xpath); +297 } +298 +299 /** +300 * List all projects +301 * +302 * @return a {@link List} of {@link RundeckProject} : might be empty, but won't be null +303 * @throws RundeckApiException in case of error when calling the API +304 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +305 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +306 */ +307 public List<RundeckProject> getProjects() throws RundeckApiException, RundeckApiLoginException, +308 RundeckApiTokenException { +309 return new ApiCall(this).get(new ApiPathBuilder("/projects"), +310 new ListParser<RundeckProject>(createProjectParser(), rootXpath() + +311 "/projects/project")); +312 } +313 +314 /** +315 * Get the definition of a single project, identified by the given name +316 * +317 * @param projectName name of the project - mandatory +318 * @return a {@link RundeckProject} instance - won't be null +319 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +320 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +321 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +322 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +323 */ +324 public RundeckProject getProject(String projectName) throws RundeckApiException, RundeckApiLoginException, +325 RundeckApiTokenException, IllegalArgumentException { +326 AssertUtil.notBlank(projectName, "projectName is mandatory to get the details of a project !"); +327 return new ApiCall(this).get(new ApiPathBuilder("/project/", projectName), +328 createProjectParser(rootXpath() + +329 (getApiVersion() < Version.V11.getVersionNumber() +330 ? "/projects/project" +331 : "/project" +332 ))); +333 } +334 +335 /** +336 * Create a new project, and return the new definition +337 * +338 * @param projectName name of the project - mandatory +339 * @param configuration project configuration properties 340 * -341 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -342 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -343 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -344 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -345 */ -346 public RundeckProject createProject(String projectName, Map<String, String> configuration) throws -347 RundeckApiException, RundeckApiLoginException, -348 RundeckApiTokenException, IllegalArgumentException { -349 -350 AssertUtil.notBlank(projectName, "projectName is mandatory to create a project !"); -351 return new ApiCall(this) -352 .post(new ApiPathBuilder("/projects").xml( -353 projectDocument(projectName, configuration) -354 ), createProjectParser(rootXpath() + -355 (getApiVersion() < Version.V11.getVersionNumber() -356 ? "/projects/project" -357 : "/project" -358 ))); -359 } -360 /** -361 * Delete a project -362 * -363 * @param projectName name of the project - mandatory +341 * @return a {@link RundeckProject} instance - won't be null +342 * +343 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +344 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +345 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +346 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +347 */ +348 public RundeckProject createProject(String projectName, Map<String, String> configuration) throws +349 RundeckApiException, RundeckApiLoginException, +350 RundeckApiTokenException, IllegalArgumentException { +351 +352 AssertUtil.notBlank(projectName, "projectName is mandatory to create a project !"); +353 return new ApiCall(this) +354 .post(new ApiPathBuilder("/projects").xml( +355 projectDocument(projectName, configuration) +356 ), createProjectParser(rootXpath() + +357 (getApiVersion() < Version.V11.getVersionNumber() +358 ? "/projects/project" +359 : "/project" +360 ))); +361 } +362 /** +363 * Delete a project 364 * -365 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -366 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -367 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -368 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -369 */ -370 public void deleteProject(String projectName) throws -371 RundeckApiException, RundeckApiLoginException, -372 RundeckApiTokenException, IllegalArgumentException { -373 -374 AssertUtil.notBlank(projectName, "projectName is mandatory to create a project !"); -375 new ApiCall(this).delete(new ApiPathBuilder("/project/", projectName)); -376 } -377 /** -378 * Convenience method to export the archive of a project to the specified file. -379 * -380 * @param projectName name of the project - mandatory -381 * @param out file to write to -382 * @return number of bytes written to the stream -383 * -384 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -385 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -386 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -387 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -388 */ -389 public int exportProject(final String projectName, final File out) throws -390 RundeckApiException, RundeckApiLoginException, -391 RundeckApiTokenException, IllegalArgumentException, IOException { -392 final FileOutputStream fileOutputStream = new FileOutputStream(out); -393 try { -394 return exportProject(projectName, fileOutputStream); -395 }finally { -396 fileOutputStream.close(); -397 } -398 } -399 /** -400 * Export the archive of a project to the specified outputstream -401 * -402 * @param projectName name of the project - mandatory -403 * @return number of bytes written to the stream -404 * -405 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -406 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -407 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -408 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -409 */ -410 public int exportProject(String projectName, OutputStream out) throws -411 RundeckApiException, RundeckApiLoginException, -412 RundeckApiTokenException, IllegalArgumentException, IOException { -413 -414 AssertUtil.notBlank(projectName, "projectName is mandatory to export a project archive!"); -415 return new ApiCall(this).get( -416 new ApiPathBuilder("/project/", projectName, "/export") -417 .accept("application/zip"), -418 out); -419 } -420 -421 /** -422 * Import a archive file to the specified project. -423 * -424 * @param projectName name of the project - mandatory -425 * @param archiveFile zip archive file -426 * @param includeExecutions if true, import executions defined in the archive, otherwise skip them -427 * @param preserveJobUuids if true, do not remove UUIDs from imported jobs, otherwise remove them -428 * -429 * @return Result of the import request, may contain a list of import error messages +365 * @param projectName name of the project - mandatory +366 * +367 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +368 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +369 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +370 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +371 */ +372 public void deleteProject(String projectName) throws +373 RundeckApiException, RundeckApiLoginException, +374 RundeckApiTokenException, IllegalArgumentException { +375 +376 AssertUtil.notBlank(projectName, "projectName is mandatory to create a project !"); +377 new ApiCall(this).delete(new ApiPathBuilder("/project/", projectName)); +378 } +379 /** +380 * Convenience method to export the archive of a project to the specified file. +381 * +382 * @param projectName name of the project - mandatory +383 * @param out file to write to +384 * @return number of bytes written to the stream +385 * +386 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +387 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +388 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +389 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +390 */ +391 public int exportProject(final String projectName, final File out) throws +392 RundeckApiException, RundeckApiLoginException, +393 RundeckApiTokenException, IllegalArgumentException, IOException { +394 final FileOutputStream fileOutputStream = new FileOutputStream(out); +395 try { +396 return exportProject(projectName, fileOutputStream); +397 }finally { +398 fileOutputStream.close(); +399 } +400 } +401 /** +402 * Export the archive of a project to the specified outputstream +403 * +404 * @param projectName name of the project - mandatory +405 * @return number of bytes written to the stream +406 * +407 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +408 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +409 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +410 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +411 */ +412 public int exportProject(String projectName, OutputStream out) throws +413 RundeckApiException, RundeckApiLoginException, +414 RundeckApiTokenException, IllegalArgumentException, IOException { +415 +416 AssertUtil.notBlank(projectName, "projectName is mandatory to export a project archive!"); +417 return new ApiCall(this).get( +418 new ApiPathBuilder("/project/", projectName, "/export") +419 .accept("application/zip"), +420 out); +421 } +422 +423 /** +424 * Import a archive file to the specified project. +425 * +426 * @param projectName name of the project - mandatory +427 * @param archiveFile zip archive file +428 * @param includeExecutions if true, import executions defined in the archive, otherwise skip them +429 * @param preserveJobUuids if true, do not remove UUIDs from imported jobs, otherwise remove them 430 * -431 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -432 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -433 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -434 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -435 */ -436 public ArchiveImport importArchive(final String projectName, final File archiveFile, -437 final boolean includeExecutions, final boolean preserveJobUuids) throws -438 RundeckApiException, RundeckApiLoginException, -439 RundeckApiTokenException, IllegalArgumentException, IOException { -440 -441 AssertUtil.notBlank(projectName, "projectName is mandatory to import a project archive!"); -442 AssertUtil.notNull(archiveFile, "archiveFile is mandatory to import a project archive!"); ; -443 return callImportProject(projectName, includeExecutions, preserveJobUuids, -444 new ApiPathBuilder().content("application/zip", archiveFile)); -445 } -446 -447 private ArchiveImport callImportProject(final String projectName, final boolean includeExecutions, final boolean preserveJobUuids, -448 final ApiPathBuilder param) { -449 param.paths("/project/", projectName, "/import") -450 .param("importExecutions", includeExecutions) -451 .param("jobUuidOption", preserveJobUuids ? "preserve" : "remove"); -452 return new ApiCall(this).put( -453 param, -454 new ArchiveImportParser() -455 ); -456 } -457 -458 /** -459 * Return the configuration of a project -460 * -461 * @param projectName name of the project - mandatory +431 * @return Result of the import request, may contain a list of import error messages +432 * +433 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +434 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +435 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +436 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +437 */ +438 public ArchiveImport importArchive(final String projectName, final File archiveFile, +439 final boolean includeExecutions, final boolean preserveJobUuids) throws +440 RundeckApiException, RundeckApiLoginException, +441 RundeckApiTokenException, IllegalArgumentException, IOException { +442 +443 AssertUtil.notBlank(projectName, "projectName is mandatory to import a project archive!"); +444 AssertUtil.notNull(archiveFile, "archiveFile is mandatory to import a project archive!"); ; +445 return callImportProject(projectName, includeExecutions, preserveJobUuids, +446 new ApiPathBuilder().content("application/zip", archiveFile)); +447 } +448 +449 private ArchiveImport callImportProject(final String projectName, final boolean includeExecutions, final boolean preserveJobUuids, +450 final ApiPathBuilder param) { +451 param.paths("/project/", projectName, "/import") +452 .param("importExecutions", includeExecutions) +453 .param("jobUuidOption", preserveJobUuids ? "preserve" : "remove"); +454 return new ApiCall(this).put( +455 param, +456 new ArchiveImportParser() +457 ); +458 } +459 +460 /** +461 * Return the configuration of a project 462 * -463 * @return a {@link ProjectConfig} instance - won't be null +463 * @param projectName name of the project - mandatory 464 * -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 projectName is blank (null, empty or whitespace) -469 */ -470 public ProjectConfig getProjectConfig(String projectName) throws -471 RundeckApiException, RundeckApiLoginException, -472 RundeckApiTokenException, IllegalArgumentException { -473 -474 AssertUtil.notBlank(projectName, "projectName is mandatory to get the config of a project !"); -475 return new ApiCall(this) -476 .get(new ApiPathBuilder("/project/", projectName, "/config"), new ProjectConfigParser("/config")); -477 } -478 /** -479 * Get a single project configuration key -480 * -481 * @param projectName name of the project - mandatory -482 * @param key name of the configuration key -483 * -484 * @return value, or null if the value is not set +465 * @return a {@link ProjectConfig} instance - won't be null +466 * +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 projectName is blank (null, empty or whitespace) +471 */ +472 public ProjectConfig getProjectConfig(String projectName) throws +473 RundeckApiException, RundeckApiLoginException, +474 RundeckApiTokenException, IllegalArgumentException { +475 +476 AssertUtil.notBlank(projectName, "projectName is mandatory to get the config of a project !"); +477 return new ApiCall(this) +478 .get(new ApiPathBuilder("/project/", projectName, "/config"), new ProjectConfigParser("/config")); +479 } +480 /** +481 * Get a single project configuration key +482 * +483 * @param projectName name of the project - mandatory +484 * @param key name of the configuration key 485 * -486 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -487 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -488 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -489 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -490 */ -491 public String getProjectConfig(final String projectName, final String key) throws -492 RundeckApiException, RundeckApiLoginException, -493 RundeckApiTokenException, IllegalArgumentException { -494 -495 AssertUtil.notBlank(projectName, "projectName is mandatory to get the config of a project !"); -496 AssertUtil.notBlank(key, "key is mandatory to get the config key value!"); -497 -498 ConfigProperty configProperty = null; -499 try { -500 configProperty = new ApiCall(this) -501 .get(new ApiPathBuilder("/project/", projectName, "/config/", key), -502 new ProjectConfigPropertyParser("/property")); -503 } catch (RundeckApiException.RundeckApiHttpStatusException e) { -504 if(404==e.getStatusCode()){ -505 return null; -506 } -507 throw e; -508 } -509 return configProperty.getValue(); -510 } -511 /** -512 * Set a single project configuration property value -513 * -514 * @param projectName name of the project - mandatory -515 * @param key name of the configuration property -516 * @param value value of the property -517 * -518 * @return new value +486 * @return value, or null if the value is not set +487 * +488 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +489 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +490 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +491 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +492 */ +493 public String getProjectConfig(final String projectName, final String key) throws +494 RundeckApiException, RundeckApiLoginException, +495 RundeckApiTokenException, IllegalArgumentException { +496 +497 AssertUtil.notBlank(projectName, "projectName is mandatory to get the config of a project !"); +498 AssertUtil.notBlank(key, "key is mandatory to get the config key value!"); +499 +500 ConfigProperty configProperty = null; +501 try { +502 configProperty = new ApiCall(this) +503 .get(new ApiPathBuilder("/project/", projectName, "/config/", key), +504 new ProjectConfigPropertyParser("/property")); +505 } catch (RundeckApiException.RundeckApiHttpStatusException e) { +506 if(404==e.getStatusCode()){ +507 return null; +508 } +509 throw e; +510 } +511 return configProperty.getValue(); +512 } +513 /** +514 * Set a single project configuration property value +515 * +516 * @param projectName name of the project - mandatory +517 * @param key name of the configuration property +518 * @param value value of the property 519 * -520 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -521 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -522 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -523 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -524 */ -525 public String setProjectConfig(final String projectName, final String key, final String value) throws -526 RundeckApiException, RundeckApiLoginException, -527 RundeckApiTokenException, IllegalArgumentException { -528 -529 AssertUtil.notBlank(projectName, "projectName is mandatory to set the config of a project !"); -530 AssertUtil.notBlank(key, "key is mandatory to set the config key value!"); -531 AssertUtil.notBlank(value, "value is mandatory to set the config key value!"); -532 -533 final ConfigProperty configProperty = new ApiCall(this) -534 .put(new ApiPathBuilder("/project/", projectName, "/config/", key) -535 .xml(new ProjectConfigPropertyGenerator(new ConfigProperty(key, value))), -536 new ProjectConfigPropertyParser("/property")); -537 -538 return configProperty.getValue(); -539 } -540 /** -541 * Set a single project configuration property value -542 * -543 * @param projectName name of the project - mandatory -544 * @param key name of the configuration property -545 * @param value value of the property -546 * -547 * @return new value +520 * @return new value +521 * +522 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +523 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +524 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +525 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +526 */ +527 public String setProjectConfig(final String projectName, final String key, final String value) throws +528 RundeckApiException, RundeckApiLoginException, +529 RundeckApiTokenException, IllegalArgumentException { +530 +531 AssertUtil.notBlank(projectName, "projectName is mandatory to set the config of a project !"); +532 AssertUtil.notBlank(key, "key is mandatory to set the config key value!"); +533 AssertUtil.notBlank(value, "value is mandatory to set the config key value!"); +534 +535 final ConfigProperty configProperty = new ApiCall(this) +536 .put(new ApiPathBuilder("/project/", projectName, "/config/", key) +537 .xml(new ProjectConfigPropertyGenerator(new ConfigProperty(key, value))), +538 new ProjectConfigPropertyParser("/property")); +539 +540 return configProperty.getValue(); +541 } +542 /** +543 * Set a single project configuration property value +544 * +545 * @param projectName name of the project - mandatory +546 * @param key name of the configuration property +547 * @param value value of the property 548 * -549 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -550 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -551 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -552 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -553 */ -554 public void deleteProjectConfig(final String projectName, final String key) throws -555 RundeckApiException, RundeckApiLoginException, -556 RundeckApiTokenException, IllegalArgumentException { -557 -558 AssertUtil.notBlank(projectName, "projectName is mandatory to set the config of a project !"); -559 AssertUtil.notBlank(key, "key is mandatory to set the config key value!"); -560 -561 new ApiCall(this).delete(new ApiPathBuilder("/project/", projectName, "/config/", -562 key).accept("application/xml")); -563 } -564 /** -565 * Return the configuration of a project -566 * -567 * @param projectName name of the project - mandatory +549 * @return new value +550 * +551 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +552 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +553 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +554 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +555 */ +556 public void deleteProjectConfig(final String projectName, final String key) throws +557 RundeckApiException, RundeckApiLoginException, +558 RundeckApiTokenException, IllegalArgumentException { +559 +560 AssertUtil.notBlank(projectName, "projectName is mandatory to set the config of a project !"); +561 AssertUtil.notBlank(key, "key is mandatory to set the config key value!"); +562 +563 new ApiCall(this).delete(new ApiPathBuilder("/project/", projectName, "/config/", +564 key).accept("application/xml")); +565 } +566 /** +567 * Return the configuration of a project 568 * -569 * @return a {@link ProjectConfig} instance - won't be null +569 * @param projectName name of the project - mandatory 570 * -571 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -572 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -573 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -574 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) -575 */ -576 public ProjectConfig setProjectConfig(String projectName, Map<String,String> configuration) throws -577 RundeckApiException, RundeckApiLoginException, -578 RundeckApiTokenException, IllegalArgumentException { -579 -580 AssertUtil.notBlank(projectName, "projectName is mandatory to get the config of a project !"); -581 return new ApiCall(this) -582 .put(new ApiPathBuilder("/project/", projectName, "/config") -583 .xml(new ProjectConfigGenerator(new ProjectConfig(configuration))) -584 , new ProjectConfigParser("/config")); -585 } -586 -587 private Document projectDocument(String projectName, Map<String, String> configuration) { -588 RundeckProject project = new RundeckProject(); -589 project.setName(projectName); -590 if (null != configuration) { -591 project.setProjectConfig(new ProjectConfig(configuration)); -592 } -593 return new ProjectGenerator(project).generateXmlDocument(); -594 } -595 -596 /* -597 * Jobs -598 */ -599 -600 /** -601 * List all jobs (for all projects) -602 * -603 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null -604 * @throws RundeckApiException in case of error when calling the API -605 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -606 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -607 */ -608 public List<RundeckJob> getJobs() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { -609 List<RundeckJob> jobs = new ArrayList<RundeckJob>(); -610 for (RundeckProject project : getProjects()) { -611 jobs.addAll(getJobs(project.getName())); -612 } -613 return jobs; -614 } -615 -616 /** -617 * List all jobs that belongs to the given project -618 * -619 * @param project name of the project - mandatory -620 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null -621 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -622 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -623 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -624 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -625 * @see #getJobs(String, String, String, String...) -626 */ -627 public List<RundeckJob> getJobs(String project) throws RundeckApiException, RundeckApiLoginException, -628 RundeckApiTokenException, IllegalArgumentException { -629 return getJobs(project, null, null, new String[0]); -630 } -631 -632 /** -633 * List the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds) -634 * -635 * @param project name of the project - mandatory -636 * @param jobFilter a filter for the job Name - optional -637 * @param groupPath a group or partial group path to include all jobs within that group path - optional -638 * @param jobIds a list of Job IDs to include - optional -639 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null -640 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -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 project is blank (null, empty or whitespace) -644 * @see #getJobs(String) -645 */ -646 public List<RundeckJob> getJobs(String project, String jobFilter, String groupPath, String... jobIds) -647 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -648 AssertUtil.notBlank(project, "project is mandatory to get all jobs !"); -649 return new ApiCall(this).get(new ApiPathBuilder("/jobs").param("project", project) -650 .param("jobFilter", jobFilter) -651 .param("groupPath", groupPath) -652 .param("idlist", StringUtils.join(jobIds, ",")), -653 new ListParser<RundeckJob>(new JobParser(), rootXpath()+"/jobs/job")); -654 } -655 -656 /** -657 * Export the definitions of all jobs that belongs to the given project -658 * -659 * @param filename path of the file where the content should be saved - mandatory -660 * @param format of the export. See {@link FileType} - mandatory -661 * @param project name of the project - mandatory -662 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -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 format or project is blank (null, empty or whitespace), or the format is -666 * invalid -667 * @throws IOException if we failed to write to the file -668 * @see #exportJobsToFile(String, FileType, String, String, String, String...) -669 * @see #exportJobs(String, String) -670 */ -671 public void exportJobsToFile(String filename, String format, String project) throws RundeckApiException, -672 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -673 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -674 exportJobsToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), project); -675 } -676 -677 /** -678 * Export the definitions of all jobs that belongs to the given project -679 * -680 * @param filename path of the file where the content should be saved - mandatory -681 * @param format of the export. See {@link FileType} - mandatory -682 * @param project name of the project - mandatory -683 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -684 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -685 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -686 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null -687 * @throws IOException if we failed to write to the file -688 * @see #exportJobsToFile(String, FileType, String, String, String, String...) -689 * @see #exportJobs(FileType, String) -690 */ -691 public void exportJobsToFile(String filename, FileType format, String project) throws RundeckApiException, -692 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -693 exportJobsToFile(filename, format, project, null, null, new String[0]); -694 } -695 -696 /** -697 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -698 * groupPath and jobIds) -699 * -700 * @param filename path of the file where the content should be saved - mandatory -701 * @param format of the export. See {@link FileType} - mandatory -702 * @param project name of the project - mandatory -703 * @param jobFilter a filter for the job Name - optional -704 * @param groupPath a group or partial group path to include all jobs within that group path - optional -705 * @param jobIds a list of Job IDs to include - optional -706 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -707 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -708 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -709 * @throws IllegalArgumentException if the filename, format or project is blank (null, empty or whitespace), or the -710 * format is invalid -711 * @throws IOException if we failed to write to the file -712 * @see #exportJobsToFile(String, FileType, String, String, String, String...) -713 * @see #exportJobs(FileType, String, String, String, String...) -714 */ -715 public void exportJobsToFile(String filename, String format, String project, String jobFilter, String groupPath, -716 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -717 IllegalArgumentException, IOException { -718 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -719 exportJobsToFile(filename, -720 FileType.valueOf(StringUtils.upperCase(format)), -721 project, -722 jobFilter, -723 groupPath, -724 jobIds); -725 } -726 -727 /** -728 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -729 * groupPath and jobIds) -730 * -731 * @param filename path of the file where the content should be saved - mandatory -732 * @param format of the export. See {@link FileType} - mandatory -733 * @param project name of the project - mandatory -734 * @param jobFilter a filter for the job Name - optional -735 * @param groupPath a group or partial group path to include all jobs within that group path - optional -736 * @param jobIds a list of Job IDs to include - optional -737 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -738 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -739 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -740 * @throws IllegalArgumentException if the filename or project is blank (null, empty or whitespace), or the format -741 * is null -742 * @throws IOException if we failed to write to the file -743 * @see #exportJobs(FileType, String, String, String, String...) -744 */ -745 public void exportJobsToFile(String filename, FileType format, String project, String jobFilter, String groupPath, -746 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -747 IllegalArgumentException, IOException { -748 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); -749 InputStream inputStream = exportJobs(format, project, jobFilter, groupPath, jobIds); -750 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); -751 } -752 -753 /** -754 * Export the definitions of all jobs that belongs to the given project -755 * -756 * @param format of the export. See {@link FileType} - mandatory -757 * @param project name of the project - mandatory -758 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -759 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -760 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -761 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -762 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is -763 * invalid -764 * @see #exportJobs(FileType, String, String, String, String...) -765 * @see #exportJobsToFile(String, String, String) -766 */ -767 public InputStream exportJobs(String format, String project) throws RundeckApiException, RundeckApiLoginException, -768 RundeckApiTokenException, IllegalArgumentException { -769 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -770 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project); -771 } -772 -773 /** -774 * Export the definitions of all jobs that belongs to the given project -775 * -776 * @param format of the export. See {@link FileType} - mandatory -777 * @param project name of the project - mandatory -778 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -779 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -780 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -781 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -782 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null -783 * @see #exportJobs(FileType, String, String, String, String...) -784 * @see #exportJobsToFile(String, FileType, String) -785 */ -786 public InputStream exportJobs(FileType format, String project) throws RundeckApiException, -787 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -788 return exportJobs(format, project, null, null, new String[0]); -789 } -790 -791 /** -792 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -793 * groupPath and jobIds) -794 * -795 * @param format of the export. See {@link FileType} - mandatory -796 * @param project name of the project - mandatory -797 * @param jobFilter a filter for the job Name - optional -798 * @param groupPath a group or partial group path to include all jobs within that group path - optional -799 * @param jobIds a list of Job IDs to include - optional -800 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -801 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -802 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -803 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -804 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is -805 * invalid -806 * @see #exportJobs(FileType, String, String, String, String...) -807 * @see #exportJobsToFile(String, String, String, String, String, String...) -808 */ -809 public InputStream exportJobs(String format, String project, String jobFilter, String groupPath, String... jobIds) -810 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -811 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); -812 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project, jobFilter, groupPath, jobIds); -813 } -814 -815 /** -816 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, -817 * groupPath and jobIds) -818 * -819 * @param format of the export. See {@link FileType} - mandatory -820 * @param project name of the project - mandatory -821 * @param jobFilter a filter for the job Name - optional -822 * @param groupPath a group or partial group path to include all jobs within that group path - optional -823 * @param jobIds a list of Job IDs to include - optional -824 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -825 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -826 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -827 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -828 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null -829 * @see #exportJobsToFile(String, FileType, String, String, String, String...) -830 */ -831 public InputStream exportJobs(FileType format, String project, String jobFilter, String groupPath, String... jobIds) -832 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -833 AssertUtil.notNull(format, "format is mandatory to export jobs !"); -834 AssertUtil.notBlank(project, "project is mandatory to export jobs !"); -835 return new ApiCall(this).get(new ApiPathBuilder("/jobs/export") -836 .accept(format == FileType.XML ? "text/xml" : "text/yaml") -837 .param("format", format) -838 .param("project", project) -839 .param("jobFilter", jobFilter) -840 .param("groupPath", groupPath) -841 .param("idlist", StringUtils.join(jobIds, ","))); -842 } -843 -844 /** -845 * Export the definition of a single job (identified by the given ID) -846 * -847 * @param filename path of the file where the content should be saved - mandatory -848 * @param format of the export. See {@link FileType} - mandatory -849 * @param jobId identifier of the job - mandatory -850 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -851 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -852 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -853 * @throws IllegalArgumentException if the filename, format or jobId is blank (null, empty or whitespace), or the -854 * format is invalid -855 * @throws IOException if we failed to write to the file -856 * @see #exportJobToFile(String, FileType, String) -857 * @see #exportJob(String, String) -858 * @see #getJob(String) -859 */ -860 public void exportJobToFile(String filename, String format, String jobId) throws RundeckApiException, -861 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -862 AssertUtil.notBlank(format, "format is mandatory to export a job !"); -863 exportJobToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), jobId); -864 } -865 -866 /** -867 * Export the definition of a single job (identified by the given ID) -868 * -869 * @param filename path of the file where the content should be saved - mandatory -870 * @param format of the export. See {@link FileType} - mandatory -871 * @param jobId identifier of the job - mandatory -872 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -873 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -874 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -875 * @throws IllegalArgumentException if the filename or jobId is blank (null, empty or whitespace), or the format is -876 * null -877 * @throws IOException if we failed to write to the file -878 * @see #exportJob(FileType, String) -879 * @see #getJob(String) -880 */ -881 public void exportJobToFile(String filename, FileType format, String jobId) throws RundeckApiException, -882 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -883 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); -884 InputStream inputStream = exportJob(format, jobId); -885 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); -886 } -887 -888 /** -889 * Export the definition of a single job, identified by the given ID -890 * -891 * @param format of the export. See {@link FileType} - mandatory -892 * @param jobId identifier of the job - mandatory -893 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -894 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -895 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -896 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -897 * @throws IllegalArgumentException if the format or jobId is blank (null, empty or whitespace), or the format is -898 * invalid -899 * @see #exportJobToFile(String, String, String) -900 * @see #getJob(String) -901 */ -902 public InputStream exportJob(String format, String jobId) throws RundeckApiException, RundeckApiLoginException, -903 RundeckApiTokenException, IllegalArgumentException { -904 AssertUtil.notBlank(format, "format is mandatory to export a job !"); -905 return exportJob(FileType.valueOf(StringUtils.upperCase(format)), jobId); -906 } -907 -908 /** -909 * Export the definition of a single job, identified by the given ID -910 * -911 * @param format of the export. See {@link FileType} - mandatory -912 * @param jobId identifier of the job - mandatory -913 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -914 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -915 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -916 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -917 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the format is null -918 * @see #exportJobToFile(String, FileType, String) -919 * @see #getJob(String) -920 */ -921 public InputStream exportJob(FileType format, String jobId) throws RundeckApiException, RundeckApiLoginException, -922 RundeckApiTokenException, IllegalArgumentException { -923 AssertUtil.notNull(format, "format is mandatory to export a job !"); -924 AssertUtil.notBlank(jobId, "jobId is mandatory to export a job !"); -925 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId).param("format", format)); -926 } -927 -928 -929 /** -930 * Import the definitions of jobs, from the given input stream, using the given behavior -931 * -932 * @param rundeckJobsImport import request, see {@link RundeckJobsImportBuilder} +571 * @return a {@link ProjectConfig} instance - won't be null +572 * +573 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +574 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +575 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +576 * @throws IllegalArgumentException if the projectName is blank (null, empty or whitespace) +577 */ +578 public ProjectConfig setProjectConfig(String projectName, Map<String,String> configuration) throws +579 RundeckApiException, RundeckApiLoginException, +580 RundeckApiTokenException, IllegalArgumentException { +581 +582 AssertUtil.notBlank(projectName, "projectName is mandatory to get the config of a project !"); +583 return new ApiCall(this) +584 .put(new ApiPathBuilder("/project/", projectName, "/config") +585 .xml(new ProjectConfigGenerator(new ProjectConfig(configuration))) +586 , new ProjectConfigParser("/config")); +587 } +588 +589 private Document projectDocument(String projectName, Map<String, String> configuration) { +590 RundeckProject project = new RundeckProject(); +591 project.setName(projectName); +592 if (null != configuration) { +593 project.setProjectConfig(new ProjectConfig(configuration)); +594 } +595 return new ProjectGenerator(project).generateXmlDocument(); +596 } +597 +598 /* +599 * Jobs +600 */ +601 +602 /** +603 * List all jobs (for all projects) +604 * +605 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null +606 * @throws RundeckApiException in case of error when calling the API +607 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +608 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +609 */ +610 public List<RundeckJob> getJobs() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { +611 List<RundeckJob> jobs = new ArrayList<RundeckJob>(); +612 for (RundeckProject project : getProjects()) { +613 jobs.addAll(getJobs(project.getName())); +614 } +615 return jobs; +616 } +617 +618 /** +619 * List all jobs that belongs to the given project +620 * +621 * @param project name of the project - mandatory +622 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null +623 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +624 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +625 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +626 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +627 * @see #getJobs(String, String, String, String...) +628 */ +629 public List<RundeckJob> getJobs(String project) throws RundeckApiException, RundeckApiLoginException, +630 RundeckApiTokenException, IllegalArgumentException { +631 return getJobs(project, null, null, new String[0]); +632 } +633 +634 /** +635 * List the jobs that belongs to the given project, and matches the given criteria (jobFilter, groupPath and jobIds) +636 * +637 * @param project name of the project - mandatory +638 * @param jobFilter a filter for the job Name - optional +639 * @param groupPath a group or partial group path to include all jobs within that group path - optional +640 * @param jobIds a list of Job IDs to include - optional +641 * @return a {@link List} of {@link RundeckJob} : might be empty, but won't be null +642 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +643 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +644 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +645 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +646 * @see #getJobs(String) +647 */ +648 public List<RundeckJob> getJobs(String project, String jobFilter, String groupPath, String... jobIds) +649 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +650 AssertUtil.notBlank(project, "project is mandatory to get all jobs !"); +651 return new ApiCall(this).get(new ApiPathBuilder("/jobs").param("project", project) +652 .param("jobFilter", jobFilter) +653 .param("groupPath", groupPath) +654 .param("idlist", StringUtils.join(jobIds, ",")), +655 new ListParser<RundeckJob>(new JobParser(), rootXpath()+"/jobs/job")); +656 } +657 +658 /** +659 * Export the definitions of all jobs that belongs to the given project +660 * +661 * @param filename path of the file where the content should be saved - mandatory +662 * @param format of the export. See {@link FileType} - mandatory +663 * @param project name of the project - mandatory +664 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +665 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +666 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +667 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is +668 * invalid +669 * @throws IOException if we failed to write to the file +670 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +671 * @see #exportJobs(String, String) +672 */ +673 public void exportJobsToFile(String filename, String format, String project) throws RundeckApiException, +674 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +675 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +676 exportJobsToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), project); +677 } +678 +679 /** +680 * Export the definitions of all jobs that belongs to the given project +681 * +682 * @param filename path of the file where the content should be saved - mandatory +683 * @param format of the export. See {@link FileType} - mandatory +684 * @param project name of the project - mandatory +685 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +686 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +687 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +688 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null +689 * @throws IOException if we failed to write to the file +690 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +691 * @see #exportJobs(FileType, String) +692 */ +693 public void exportJobsToFile(String filename, FileType format, String project) throws RundeckApiException, +694 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +695 exportJobsToFile(filename, format, project, null, null, new String[0]); +696 } +697 +698 /** +699 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +700 * groupPath and jobIds) +701 * +702 * @param filename path of the file where the content should be saved - mandatory +703 * @param format of the export. See {@link FileType} - mandatory +704 * @param project name of the project - mandatory +705 * @param jobFilter a filter for the job Name - optional +706 * @param groupPath a group or partial group path to include all jobs within that group path - optional +707 * @param jobIds a list of Job IDs to include - optional +708 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +709 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +710 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +711 * @throws IllegalArgumentException if the filename, format or project is blank (null, empty or whitespace), or the +712 * format is invalid +713 * @throws IOException if we failed to write to the file +714 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +715 * @see #exportJobs(FileType, String, String, String, String...) +716 */ +717 public void exportJobsToFile(String filename, String format, String project, String jobFilter, String groupPath, +718 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +719 IllegalArgumentException, IOException { +720 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +721 exportJobsToFile(filename, +722 FileType.valueOf(StringUtils.upperCase(format)), +723 project, +724 jobFilter, +725 groupPath, +726 jobIds); +727 } +728 +729 /** +730 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +731 * groupPath and jobIds) +732 * +733 * @param filename path of the file where the content should be saved - mandatory +734 * @param format of the export. See {@link FileType} - mandatory +735 * @param project name of the project - mandatory +736 * @param jobFilter a filter for the job Name - optional +737 * @param groupPath a group or partial group path to include all jobs within that group path - optional +738 * @param jobIds a list of Job IDs to include - optional +739 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +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 filename or project is blank (null, empty or whitespace), or the format +743 * is null +744 * @throws IOException if we failed to write to the file +745 * @see #exportJobs(FileType, String, String, String, String...) +746 */ +747 public void exportJobsToFile(String filename, FileType format, String project, String jobFilter, String groupPath, +748 String... jobIds) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +749 IllegalArgumentException, IOException { +750 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); +751 InputStream inputStream = exportJobs(format, project, jobFilter, groupPath, jobIds); +752 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); +753 } +754 +755 /** +756 * Export the definitions of all jobs that belongs to the given project +757 * +758 * @param format of the export. See {@link FileType} - mandatory +759 * @param project name of the project - mandatory +760 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +761 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +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 format or project is blank (null, empty or whitespace), or the format is +765 * invalid +766 * @see #exportJobs(FileType, String, String, String, String...) +767 * @see #exportJobsToFile(String, String, String) +768 */ +769 public InputStream exportJobs(String format, String project) throws RundeckApiException, RundeckApiLoginException, +770 RundeckApiTokenException, IllegalArgumentException { +771 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +772 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project); +773 } +774 +775 /** +776 * Export the definitions of all jobs that belongs to the given project +777 * +778 * @param format of the export. See {@link FileType} - mandatory +779 * @param project name of the project - mandatory +780 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +781 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +782 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +783 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +784 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null +785 * @see #exportJobs(FileType, String, String, String, String...) +786 * @see #exportJobsToFile(String, FileType, String) +787 */ +788 public InputStream exportJobs(FileType format, String project) throws RundeckApiException, +789 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +790 return exportJobs(format, project, null, null, new String[0]); +791 } +792 +793 /** +794 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +795 * groupPath and jobIds) +796 * +797 * @param format of the export. See {@link FileType} - mandatory +798 * @param project name of the project - mandatory +799 * @param jobFilter a filter for the job Name - optional +800 * @param groupPath a group or partial group path to include all jobs within that group path - optional +801 * @param jobIds a list of Job IDs to include - optional +802 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +803 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +804 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +805 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +806 * @throws IllegalArgumentException if the format or project is blank (null, empty or whitespace), or the format is +807 * invalid +808 * @see #exportJobs(FileType, String, String, String, String...) +809 * @see #exportJobsToFile(String, String, String, String, String, String...) +810 */ +811 public InputStream exportJobs(String format, String project, String jobFilter, String groupPath, String... jobIds) +812 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +813 AssertUtil.notBlank(format, "format is mandatory to export jobs !"); +814 return exportJobs(FileType.valueOf(StringUtils.upperCase(format)), project, jobFilter, groupPath, jobIds); +815 } +816 +817 /** +818 * Export the definitions of the jobs that belongs to the given project, and matches the given criteria (jobFilter, +819 * groupPath and jobIds) +820 * +821 * @param format of the export. See {@link FileType} - mandatory +822 * @param project name of the project - mandatory +823 * @param jobFilter a filter for the job Name - optional +824 * @param groupPath a group or partial group path to include all jobs within that group path - optional +825 * @param jobIds a list of Job IDs to include - optional +826 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +827 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +828 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +829 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +830 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the format is null +831 * @see #exportJobsToFile(String, FileType, String, String, String, String...) +832 */ +833 public InputStream exportJobs(FileType format, String project, String jobFilter, String groupPath, String... jobIds) +834 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +835 AssertUtil.notNull(format, "format is mandatory to export jobs !"); +836 AssertUtil.notBlank(project, "project is mandatory to export jobs !"); +837 return new ApiCall(this).get(new ApiPathBuilder("/jobs/export") +838 .accept(format == FileType.XML ? "text/xml" : "text/yaml") +839 .param("format", format) +840 .param("project", project) +841 .param("jobFilter", jobFilter) +842 .param("groupPath", groupPath) +843 .param("idlist", StringUtils.join(jobIds, ","))); +844 } +845 +846 /** +847 * Export the definition of a single job (identified by the given ID) +848 * +849 * @param filename path of the file where the content should be saved - mandatory +850 * @param format of the export. See {@link FileType} - mandatory +851 * @param jobId identifier of the job - mandatory +852 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +853 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +854 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +855 * @throws IllegalArgumentException if the filename, format or jobId is blank (null, empty or whitespace), or the +856 * format is invalid +857 * @throws IOException if we failed to write to the file +858 * @see #exportJobToFile(String, FileType, String) +859 * @see #exportJob(String, String) +860 * @see #getJob(String) +861 */ +862 public void exportJobToFile(String filename, String format, String jobId) throws RundeckApiException, +863 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +864 AssertUtil.notBlank(format, "format is mandatory to export a job !"); +865 exportJobToFile(filename, FileType.valueOf(StringUtils.upperCase(format)), jobId); +866 } +867 +868 /** +869 * Export the definition of a single job (identified by the given ID) +870 * +871 * @param filename path of the file where the content should be saved - mandatory +872 * @param format of the export. See {@link FileType} - mandatory +873 * @param jobId identifier of the job - mandatory +874 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +875 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +876 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +877 * @throws IllegalArgumentException if the filename or jobId is blank (null, empty or whitespace), or the format is +878 * null +879 * @throws IOException if we failed to write to the file +880 * @see #exportJob(FileType, String) +881 * @see #getJob(String) +882 */ +883 public void exportJobToFile(String filename, FileType format, String jobId) throws RundeckApiException, +884 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +885 AssertUtil.notBlank(filename, "filename is mandatory to export a job !"); +886 InputStream inputStream = exportJob(format, jobId); +887 FileUtils.writeByteArrayToFile(new File(filename), IOUtils.toByteArray(inputStream)); +888 } +889 +890 /** +891 * Export the definition of a single job, identified by the given ID +892 * +893 * @param format of the export. See {@link FileType} - mandatory +894 * @param jobId identifier of the job - mandatory +895 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +896 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +897 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +898 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +899 * @throws IllegalArgumentException if the format or jobId is blank (null, empty or whitespace), or the format is +900 * invalid +901 * @see #exportJobToFile(String, String, String) +902 * @see #getJob(String) +903 */ +904 public InputStream exportJob(String format, String jobId) throws RundeckApiException, RundeckApiLoginException, +905 RundeckApiTokenException, IllegalArgumentException { +906 AssertUtil.notBlank(format, "format is mandatory to export a job !"); +907 return exportJob(FileType.valueOf(StringUtils.upperCase(format)), jobId); +908 } +909 +910 /** +911 * Export the definition of a single job, identified by the given ID +912 * +913 * @param format of the export. See {@link FileType} - mandatory +914 * @param jobId identifier of the job - mandatory +915 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +916 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +917 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +918 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +919 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the format is null +920 * @see #exportJobToFile(String, FileType, String) +921 * @see #getJob(String) +922 */ +923 public InputStream exportJob(FileType format, String jobId) throws RundeckApiException, RundeckApiLoginException, +924 RundeckApiTokenException, IllegalArgumentException { +925 AssertUtil.notNull(format, "format is mandatory to export a job !"); +926 AssertUtil.notBlank(jobId, "jobId is mandatory to export a job !"); +927 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId).param("format", format)); +928 } +929 +930 +931 /** +932 * Import the definitions of jobs, from the given input stream, using the given behavior 933 * -934 * @return a {@link RundeckJobsImportResult} instance - won't be null +934 * @param rundeckJobsImport import request, see {@link RundeckJobsImportBuilder} 935 * -936 * @throws RundeckApiException in case of error when calling the API -937 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -938 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -939 * @throws IllegalArgumentException if the stream or fileType is null -940 * @see #importJobs(String, FileType, RundeckJobsImportMethod) -941 */ -942 public RundeckJobsImportResult importJobs(final String filename,final RundeckJobsImport rundeckJobsImport) throws RundeckApiException, -943 RundeckApiLoginException, -944 RundeckApiTokenException, IllegalArgumentException, IOException { -945 AssertUtil.notBlank(filename, "filename (of jobs file) is mandatory to import jobs !"); -946 FileInputStream stream = null; -947 try { -948 stream = FileUtils.openInputStream(new File(filename)); -949 return importJobs(RundeckJobsImportBuilder.builder(rundeckJobsImport).setStream(stream).build()); -950 } finally { -951 -952 IOUtils.closeQuietly(stream); -953 } -954 } -955 /** -956 * Import the definitions of jobs, from the given input stream, using the given behavior -957 * -958 * @param rundeckJobsImport import request, see {@link RundeckJobsImportBuilder} +936 * @return a {@link RundeckJobsImportResult} instance - won't be null +937 * +938 * @throws RundeckApiException in case of error when calling the API +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 stream or fileType is null +942 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +943 */ +944 public RundeckJobsImportResult importJobs(final String filename,final RundeckJobsImport rundeckJobsImport) throws RundeckApiException, +945 RundeckApiLoginException, +946 RundeckApiTokenException, IllegalArgumentException, IOException { +947 AssertUtil.notBlank(filename, "filename (of jobs file) is mandatory to import jobs !"); +948 FileInputStream stream = null; +949 try { +950 stream = FileUtils.openInputStream(new File(filename)); +951 return importJobs(RundeckJobsImportBuilder.builder(rundeckJobsImport).setStream(stream).build()); +952 } finally { +953 +954 IOUtils.closeQuietly(stream); +955 } +956 } +957 /** +958 * Import the definitions of jobs, from the given input stream, using the given behavior 959 * -960 * @return a {@link RundeckJobsImportResult} instance - won't be null +960 * @param rundeckJobsImport import request, see {@link RundeckJobsImportBuilder} 961 * -962 * @throws RundeckApiException in case of error when calling the API -963 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -964 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -965 * @throws IllegalArgumentException if the stream or fileType is null -966 * @see #importJobs(String, FileType, RundeckJobsImportMethod) -967 */ -968 public RundeckJobsImportResult importJobs(final RundeckJobsImport rundeckJobsImport) throws RundeckApiException, -969 RundeckApiLoginException, -970 RundeckApiTokenException, IllegalArgumentException { -971 -972 AssertUtil.notNull(rundeckJobsImport.getStream(), "inputStream of jobs is mandatory to import jobs !"); -973 AssertUtil.notNull(rundeckJobsImport.getFileType(), "fileType is mandatory to import jobs !"); -974 final ApiPathBuilder request = new ApiPathBuilder(JOBS_IMPORT) -975 .param("format", rundeckJobsImport.getFileType()) -976 .param("dupeOption", rundeckJobsImport.getImportMethod()) -977 .attach("xmlBatch", rundeckJobsImport.getStream()); -978 if(null!=rundeckJobsImport.getUuidImportBehavior()) { -979 //API v9 -980 request.param("uuidOption", rundeckJobsImport.getUuidImportBehavior()); -981 } -982 if(null!=rundeckJobsImport.getProject()) { -983 //API v8 -984 request.param("project", rundeckJobsImport.getProject()); -985 } -986 return new ApiCall(this).post(request, new JobsImportResultParser(rootXpath())); -987 } -988 -989 /** -990 * Find a job, identified by its project, group and name. Note that the groupPath is optional, as a job does not -991 * need to belong to a group (either pass null, or an empty string). -992 * -993 * @param project name of the project - mandatory -994 * @param groupPath group to which the job belongs (if it belongs to a group) - optional -995 * @param name of the job to find - mandatory -996 * @return a {@link RundeckJob} instance - null if not found -997 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -998 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -999 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1000 * @throws IllegalArgumentException if the project or the name is blank (null, empty or whitespace) -1001 * @see #getJob(String) -1002 */ -1003 public RundeckJob findJob(String project, String groupPath, String name) throws RundeckApiException, -1004 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1005 AssertUtil.notBlank(project, "project is mandatory to find a job !"); -1006 AssertUtil.notBlank(name, "job name is mandatory to find a job !"); -1007 List<RundeckJob> jobs = getJobs(project, name, groupPath, new String[0]); -1008 return jobs.isEmpty() ? null : jobs.get(0); -1009 } -1010 -1011 /** -1012 * Get the definition of a single job, identified by the given ID -1013 * -1014 * @param jobId identifier of the job - mandatory -1015 * @return a {@link RundeckJob} instance - won't be null -1016 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1017 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1018 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1019 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1020 * @see #findJob(String, String, String) -1021 * @see #exportJob(String, String) -1022 */ -1023 public RundeckJob getJob(String jobId) throws RundeckApiException, RundeckApiLoginException, -1024 RundeckApiTokenException, IllegalArgumentException { -1025 AssertUtil.notBlank(jobId, "jobId is mandatory to get the details of a job !"); -1026 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId), new JobParser("joblist/job")); -1027 } -1028 -1029 /** -1030 * Delete a single job, identified by the given ID -1031 * -1032 * @param jobId identifier of the job - mandatory -1033 * @return the success message (note that in case of error, you'll get an exception) -1034 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1035 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1036 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1037 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1038 */ -1039 public String deleteJob(String jobId) throws RundeckApiException, RundeckApiLoginException, -1040 RundeckApiTokenException, IllegalArgumentException { -1041 AssertUtil.notBlank(jobId, "jobId is mandatory to delete a job !"); -1042 new ApiCall(this).delete(new ApiPathBuilder("/job/", jobId)); -1043 return "Job " + jobId + " was deleted successfully"; -1044 } -1045 /** -1046 * Delete multiple jobs, identified by the given IDs -1047 * -1048 * @param jobIds List of job IDS -1049 * @return the bulk delete result -1050 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1051 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1052 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1053 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1054 */ -1055 public RundeckJobDeleteBulk deleteJobs(final List<String> jobIds) throws RundeckApiException, RundeckApiLoginException, -1056 RundeckApiTokenException, IllegalArgumentException { -1057 if (null == jobIds || 0 == jobIds.size()) { -1058 throw new IllegalArgumentException("jobIds are mandatory to delete a job"); -1059 } -1060 return new ApiCall(this).post(new ApiPathBuilder("/jobs/delete").field("ids",jobIds), -1061 new BulkDeleteParser(rootXpath()+"/deleteJobs")); -1062 } -1063 -1064 /** -1065 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the -1066 * end of the job execution) -1067 * -1068 * @param jobRun the RunJob, see {@link RunJobBuilder} -1069 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1070 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1071 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1072 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1073 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1074 * @see #triggerJob(String) -1075 * @see #runJob(String, Properties, Properties) -1076 */ -1077 public RundeckExecution triggerJob(final RunJob jobRun) -1078 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1079 AssertUtil.notBlank(jobRun.getJobId(), "jobId is mandatory to trigger a job !"); -1080 ApiPathBuilder apiPath = new ApiPathBuilder("/job/", jobRun.getJobId(), "/run").param("argString", -1081 ParametersUtil.generateArgString(jobRun.getOptions())) -1082 .nodeFilters(jobRun.getNodeFilters()); -1083 if(null!=jobRun.getAsUser()) { -1084 apiPath.param("asUser", jobRun.getAsUser()); -1085 } -1086 return new ApiCall(this).get(apiPath, new ExecutionParser(rootXpath()+"/executions/execution")); -1087 } -1088 -1089 -1090 /** -1091 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. -1092 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or -1093 * aborted) or is still running. -1094 * -1095 * @param runJob the RunJob, see {@link RunJobBuilder} -1096 * -1097 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1098 * -1099 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1100 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1101 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1102 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1103 * @see #triggerJob(RunJob) -1104 * @see #runJob(RunJob, long, TimeUnit) -1105 */ -1106 public RundeckExecution runJob(final RunJob runJob) throws RundeckApiException, RundeckApiLoginException, -1107 RundeckApiTokenException, IllegalArgumentException { -1108 return runJob(runJob, DEFAULT_POOLING_INTERVAL, DEFAULT_POOLING_UNIT); -1109 } -1110 -1111 /** -1112 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. -1113 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to -1114 * know if the execution is finished (or aborted) or is still running. -1115 * -1116 * @param jobRun the RunJob, see {@link RunJobBuilder} -1117 * @param poolingInterval for checking the status of the execution. Must be > 0. -1118 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1119 * -1120 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1121 * -1122 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1123 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1124 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1125 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1126 * @see #triggerJob(RunJob) -1127 */ -1128 public RundeckExecution runJob(final RunJob jobRun, long poolingInterval, -1129 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1130 IllegalArgumentException { -1131 -1132 if (poolingInterval <= 0) { -1133 poolingInterval = DEFAULT_POOLING_INTERVAL; -1134 poolingUnit = DEFAULT_POOLING_UNIT; -1135 } -1136 if (poolingUnit == null) { -1137 poolingUnit = DEFAULT_POOLING_UNIT; -1138 } -1139 -1140 RundeckExecution execution = triggerJob(jobRun); -1141 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { -1142 try { -1143 Thread.sleep(poolingUnit.toMillis(poolingInterval)); -1144 } catch (InterruptedException e) { -1145 break; -1146 } -1147 execution = getExecution(execution.getId()); -1148 } -1149 return execution; -1150 } -1151 -1152 /* -1153 * Ad-hoc commands -1154 */ -1155 -1156 -1157 /** -1158 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). -1159 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. -1160 * -1161 * @param command the RunAdhocCommand. Project and command are mandatory, see {@link RunAdhocCommandBuilder} -1162 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1163 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1164 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1165 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1166 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1167 * @see #triggerAdhocCommand(String, String) -1168 * @see #runAdhocCommand(String, String, Properties) -1169 */ -1170 public RundeckExecution triggerAdhocCommand(RunAdhocCommand command) throws RundeckApiException, RundeckApiLoginException, -1171 RundeckApiTokenException, IllegalArgumentException { -1172 AssertUtil.notBlank(command.getProject(), "project is mandatory to trigger an ad-hoc command !"); -1173 AssertUtil.notBlank(command.getCommand(), "command is mandatory to trigger an ad-hoc command !"); -1174 ApiPathBuilder apiPath = new ApiPathBuilder("/run/command").param("project", command.getProject()) -1175 .param("exec", command.getCommand()) -1176 .param("nodeThreadcount", -1177 command.getNodeThreadcount()) -1178 .param("nodeKeepgoing", -1179 command.getNodeKeepgoing()) -1180 .nodeFilters(command.getNodeFilters()); -1181 if(null!= command.getAsUser()) { -1182 apiPath.param("asUser", command.getAsUser()); -1183 } -1184 RundeckExecution execution = new ApiCall(this).get(apiPath, new ExecutionParser(rootXpath()+"/execution")); -1185 // the first call just returns the ID of the execution, so we need another call to get a "real" execution -1186 return getExecution(execution.getId()); -1187 } -1188 -1189 -1190 /** -1191 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1192 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1193 * running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter. -1194 * -1195 * @param command the RunAdhocCommand, see {@link RunAdhocCommandBuilder} -1196 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1197 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1198 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1199 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1200 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1201 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) -1202 * @see #triggerAdhocCommand(RunAdhocCommand) -1203 */ -1204 public RundeckExecution runAdhocCommand(RunAdhocCommand command) throws RundeckApiException, RundeckApiLoginException, -1205 RundeckApiTokenException, IllegalArgumentException { -1206 return runAdhocCommand(command, -1207 DEFAULT_POOLING_INTERVAL, -1208 DEFAULT_POOLING_UNIT); -1209 } -1210 -1211 /** -1212 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1213 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1214 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the -1215 * nodeFilters parameter. -1216 * -1217 * @param command the RunAdhocCommand, see {@link RunAdhocCommandBuilder} -1218 * @param poolingInterval for checking the status of the execution. Must be > 0. -1219 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1220 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1221 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1222 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1223 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1224 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) -1225 * @see #triggerAdhocCommand(RunAdhocCommand) -1226 */ -1227 public RundeckExecution runAdhocCommand(RunAdhocCommand command, long poolingInterval, TimeUnit poolingUnit) -1228 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1229 if (poolingInterval <= 0) { -1230 poolingInterval = DEFAULT_POOLING_INTERVAL; -1231 poolingUnit = DEFAULT_POOLING_UNIT; -1232 } -1233 if (poolingUnit == null) { -1234 poolingUnit = DEFAULT_POOLING_UNIT; -1235 } -1236 -1237 RundeckExecution execution = triggerAdhocCommand(command); -1238 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { -1239 try { -1240 Thread.sleep(poolingUnit.toMillis(poolingInterval)); -1241 } catch (InterruptedException e) { -1242 break; -1243 } -1244 execution = getExecution(execution.getId()); -1245 } -1246 return execution; -1247 } -1248 -1249 /* -1250 * Ad-hoc scripts -1251 */ -1252 -1253 -1254 /** -1255 * Trigger the execution of an ad-hoc script read from a file, and return immediately (without waiting the end of -1256 * the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1257 * -1258 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} -1259 * @param scriptFilename a file to read as the input script stream -1260 * -1261 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1262 * -1263 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1264 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1265 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1266 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1267 * @throws IOException if an error occurs reading the script file -1268 * @see #triggerAdhocScript(RunAdhocScript) -1269 * @see #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit) -1270 */ -1271 public RundeckExecution triggerAdhocScript(final RunAdhocScript script, final String scriptFilename) throws -1272 RundeckApiException, -1273 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1274 AssertUtil.notBlank(scriptFilename, "scriptFilename is mandatory to trigger an ad-hoc script !"); -1275 FileInputStream stream = null; -1276 try { -1277 stream = FileUtils.openInputStream(new File(scriptFilename)); -1278 return triggerAdhocScript(RunAdhocScriptBuilder.builder(script) -1279 .setScript(stream) -1280 .build()); -1281 } finally { -1282 IOUtils.closeQuietly(stream); -1283 } -1284 } -1285 /** -1286 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The -1287 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1288 * -1289 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} -1290 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null -1291 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1292 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1293 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1294 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1295 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) -1296 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) -1297 */ -1298 public RundeckExecution triggerAdhocScript(RunAdhocScript script) throws RundeckApiException, -1299 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1300 AssertUtil.notBlank(script.getProject(), "project is mandatory to trigger an ad-hoc script !"); -1301 AssertUtil.notNull(script.getScript(), "script is mandatory to trigger an ad-hoc script !"); -1302 ApiPathBuilder apiPath = new ApiPathBuilder("/run/script").param("project", script.getProject()) -1303 .attach("scriptFile", -1304 script.getScript()) -1305 .param("argString",script.getArgString()) -1306 .param("nodeThreadcount", -1307 script.getNodeThreadcount()) -1308 .param("nodeKeepgoing", -1309 script.getNodeKeepgoing()) -1310 .param("scriptInterpreter", -1311 script.getScriptInterpreter()) -1312 .param("interpreterArgsQuoted", -1313 script.getInterpreterArgsQuoted()) -1314 .nodeFilters(script.getNodeFilters()); -1315 if(null!=script.getAsUser()) { -1316 apiPath.param("asUser", script.getAsUser()); -1317 } -1318 RundeckExecution execution = new ApiCall(this).post(apiPath, new ExecutionParser(rootXpath()+"/execution")); -1319 // the first call just returns the ID of the execution, so we need another call to get a "real" execution -1320 return getExecution(execution.getId()); -1321 } -1322 -1323 -1324 /** -1325 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1326 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still -1327 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. -1328 * -1329 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} -1330 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1331 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1332 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1333 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1334 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1335 * @throws IOException if we failed to read the file -1336 * @see #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit) -1337 * @see #triggerAdhocScript(RunAdhocScript) -1338 */ -1339 public RundeckExecution runAdhocScript(RunAdhocScript script) throws RundeckApiException, -1340 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { -1341 return runAdhocScript(script, -1342 DEFAULT_POOLING_INTERVAL, -1343 DEFAULT_POOLING_UNIT); -1344 } -1345 -1346 /** -1347 * Run an ad-hoc script read from a file, and wait until its execution is finished (or aborted) to return. We will -1348 * poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the -1349 * execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to -1350 * the nodeFilters parameter. -1351 * -1352 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} -1353 * @param scriptFilename filename of a script to read -1354 * @param poolingInterval for checking the status of the execution. Must be > 0. -1355 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1356 * -1357 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1358 * -1359 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1360 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1361 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1362 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1363 * @throws IOException if we failed to read the file -1364 * @see #runAdhocScript(RunAdhocScript) -1365 * @see #triggerAdhocScript(RunAdhocScript, String) -1366 */ -1367 public RundeckExecution runAdhocScript(final RunAdhocScript script, final String scriptFilename, -1368 final long poolingInterval, final TimeUnit poolingUnit) throws RundeckApiException, -1369 RundeckApiLoginException, RundeckApiTokenException, -1370 IllegalArgumentException, IOException { -1371 FileInputStream stream = null; -1372 try { -1373 stream = FileUtils.openInputStream(new File(scriptFilename)); -1374 return runAdhocScript(RunAdhocScriptBuilder.builder(script) -1375 .setScript(stream) -1376 .build(), poolingInterval, poolingUnit); -1377 } finally { -1378 IOUtils.closeQuietly(stream); -1379 } -1380 } -1381 /** -1382 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck -1383 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is -1384 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters -1385 * parameter. -1386 * -1387 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} -1388 * @param poolingInterval for checking the status of the execution. Must be > 0. -1389 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. -1390 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null -1391 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1392 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1393 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1394 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null -1395 * @throws IOException if we failed to read the file -1396 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) -1397 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) -1398 */ -1399 public RundeckExecution runAdhocScript(final RunAdhocScript script, long poolingInterval, -1400 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, -1401 IllegalArgumentException { -1402 if (poolingInterval <= 0) { -1403 poolingInterval = DEFAULT_POOLING_INTERVAL; -1404 poolingUnit = DEFAULT_POOLING_UNIT; -1405 } -1406 if (poolingUnit == null) { -1407 poolingUnit = DEFAULT_POOLING_UNIT; -1408 } -1409 -1410 RundeckExecution execution = triggerAdhocScript(script); -1411 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { -1412 try { -1413 Thread.sleep(poolingUnit.toMillis(poolingInterval)); -1414 } catch (InterruptedException e) { -1415 break; -1416 } -1417 execution = getExecution(execution.getId()); -1418 } -1419 return execution; -1420 } -1421 -1422 /* -1423 * Executions -1424 */ -1425 -1426 /** -1427 * Get all running executions (for all projects) -1428 * -1429 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1430 * @throws RundeckApiException in case of error when calling the API -1431 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1432 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1433 * @see #getRunningExecutions(String) -1434 */ -1435 public List<RundeckExecution> getRunningExecutions() throws RundeckApiException, RundeckApiLoginException, -1436 RundeckApiTokenException { -1437 if (this.getApiVersion() >= Version.V9.getVersionNumber()) { -1438 //simply query using '*' -1439 return getRunningExecutions("*"); -1440 } else { -1441 List<RundeckExecution> executions = new ArrayList<RundeckExecution>(); -1442 for (RundeckProject project : getProjects()) { -1443 executions.addAll(getRunningExecutions(project.getName())); -1444 } -1445 return executions; -1446 } -1447 } -1448 -1449 /** -1450 * Get the running executions for the given project -1451 * -1452 * @param project name of the project - mandatory -1453 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1454 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1455 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1456 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1457 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1458 * @see #getRunningExecutions() -1459 */ -1460 public List<RundeckExecution> getRunningExecutions(String project) throws RundeckApiException, -1461 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1462 AssertUtil.notBlank(project, "project is mandatory get all running executions !"); -1463 return new ApiCall(this).get(new ApiPathBuilder("/executions/running").param("project", project), -1464 new ListParser<RundeckExecution>(new ExecutionParser(), -1465 rootXpath()+"/executions/execution")); -1466 } -1467 -1468 /** -1469 * Get the executions of the given job -1470 * -1471 * @param jobId identifier of the job - mandatory -1472 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1473 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1474 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1475 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1476 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1477 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) -1478 */ -1479 public List<RundeckExecution> getJobExecutions(String jobId) throws RundeckApiException, RundeckApiLoginException, -1480 RundeckApiTokenException, IllegalArgumentException { -1481 return getJobExecutions(jobId, (ExecutionStatus) null); -1482 } -1483 -1484 /** -1485 * Get the executions of the given job -1486 * -1487 * @param jobId identifier of the job - mandatory -1488 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -1489 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1490 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1491 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1492 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1493 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is -1494 * invalid -1495 * @see #getJobExecutions(String, String, Long, Long) -1496 */ -1497 public List<RundeckExecution> getJobExecutions(String jobId, String status) throws RundeckApiException, -1498 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1499 return getJobExecutions(jobId, -1500 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status))); -1501 } -1502 -1503 /** -1504 * Get the executions of the given job -1505 * -1506 * @param jobId identifier of the job - mandatory -1507 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -1508 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1509 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1510 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1511 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1512 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1513 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) -1514 */ -1515 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status) throws RundeckApiException, -1516 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1517 return getJobExecutions(jobId, status, null, null); -1518 } -1519 -1520 /** -1521 * Get the executions of the given job -1522 * -1523 * @param jobId identifier of the job - mandatory -1524 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -1525 * @param max number of results to return - optional (null for all) -1526 * @param offset the 0-indexed offset for the first result to return - optional -1527 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1528 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1529 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1530 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1531 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is -1532 * invalid -1533 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) -1534 */ -1535 public List<RundeckExecution> getJobExecutions(String jobId, String status, Long max, Long offset) -1536 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1537 return getJobExecutions(jobId, -1538 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status)), -1539 max, -1540 offset); -1541 } -1542 -1543 /** -1544 * Get the executions of the given job -1545 * -1546 * @param jobId identifier of the job - mandatory -1547 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) -1548 * @param max number of results to return - optional (null for all) -1549 * @param offset the 0-indexed offset for the first result to return - optional -1550 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1551 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1552 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1553 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1554 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1555 */ -1556 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status, Long max, Long offset) -1557 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1558 AssertUtil.notBlank(jobId, "jobId is mandatory to get the executions of a job !"); -1559 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId, "/executions").param("status", status) -1560 .param("max", max) -1561 .param("offset", offset), -1562 new ListParser<RundeckExecution>(new ExecutionParser(), -1563 rootXpath()+"/executions/execution")); -1564 } -1565 -1566 /** -1567 * Get executions based on query parameters -1568 * -1569 * @param query query parameters for the request -1570 * @param max number of results to return - optional (null for all) -1571 * @param offset the 0-indexed offset for the first result to return - optional -1572 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null -1573 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -1574 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1575 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1576 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -1577 */ -1578 public PagedResults<RundeckExecution> getExecutions(ExecutionQuery query, Long max, Long offset) -1579 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1580 if (!query.notBlank()) { -1581 throw new IllegalArgumentException("Some execution query parameter must be set"); -1582 } -1583 AssertUtil.notBlank(query.getProject(), "project is required for execution query"); -1584 return new ApiCall(this).get(new ApiPathBuilder("/executions") -1585 .param(new ExecutionQueryParameters(query)) -1586 .param("max", max) -1587 .param("offset", offset), -1588 new PagedResultParser<RundeckExecution>( -1589 new ListParser<RundeckExecution>(new ExecutionParser(), "execution"), -1590 rootXpath()+"/executions" -1591 ) -1592 ); -1593 } -1594 -1595 /** -1596 * Get a single execution, identified by the given ID -1597 * -1598 * @param executionId identifier of the execution - mandatory -1599 * @return a {@link RundeckExecution} instance - won't be null -1600 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) -1601 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1602 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1603 * @throws IllegalArgumentException if the executionId is null -1604 */ -1605 public RundeckExecution getExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, -1606 RundeckApiTokenException, IllegalArgumentException { -1607 AssertUtil.notNull(executionId, "executionId is mandatory to get the details of an execution !"); -1608 return new ApiCall(this).get(new ApiPathBuilder("/execution/", executionId.toString()), -1609 new ExecutionParser(rootXpath()+"/executions/execution")); +962 * @return a {@link RundeckJobsImportResult} instance - won't be null +963 * +964 * @throws RundeckApiException in case of error when calling the API +965 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +966 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +967 * @throws IllegalArgumentException if the stream or fileType is null +968 * @see #importJobs(String, FileType, RundeckJobsImportMethod) +969 */ +970 public RundeckJobsImportResult importJobs(final RundeckJobsImport rundeckJobsImport) throws RundeckApiException, +971 RundeckApiLoginException, +972 RundeckApiTokenException, IllegalArgumentException { +973 +974 AssertUtil.notNull(rundeckJobsImport.getStream(), "inputStream of jobs is mandatory to import jobs !"); +975 AssertUtil.notNull(rundeckJobsImport.getFileType(), "fileType is mandatory to import jobs !"); +976 final ApiPathBuilder request = new ApiPathBuilder(JOBS_IMPORT) +977 .param("format", rundeckJobsImport.getFileType()) +978 .param("dupeOption", rundeckJobsImport.getImportMethod()) +979 .attach("xmlBatch", rundeckJobsImport.getStream()); +980 if(null!=rundeckJobsImport.getUuidImportBehavior()) { +981 //API v9 +982 request.param("uuidOption", rundeckJobsImport.getUuidImportBehavior()); +983 } +984 if(null!=rundeckJobsImport.getProject()) { +985 //API v8 +986 request.param("project", rundeckJobsImport.getProject()); +987 } +988 return new ApiCall(this).post(request, new JobsImportResultParser(rootXpath())); +989 } +990 +991 /** +992 * Find a job, identified by its project, group and name. Note that the groupPath is optional, as a job does not +993 * need to belong to a group (either pass null, or an empty string). +994 * +995 * @param project name of the project - mandatory +996 * @param groupPath group to which the job belongs (if it belongs to a group) - optional +997 * @param name of the job to find - mandatory +998 * @return a {@link RundeckJob} instance - null if not found +999 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1000 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1001 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1002 * @throws IllegalArgumentException if the project or the name is blank (null, empty or whitespace) +1003 * @see #getJob(String) +1004 */ +1005 public RundeckJob findJob(String project, String groupPath, String name) throws RundeckApiException, +1006 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1007 AssertUtil.notBlank(project, "project is mandatory to find a job !"); +1008 AssertUtil.notBlank(name, "job name is mandatory to find a job !"); +1009 List<RundeckJob> jobs = getJobs(project, name, groupPath, new String[0]); +1010 return jobs.isEmpty() ? null : jobs.get(0); +1011 } +1012 +1013 /** +1014 * Get the definition of a single job, identified by the given ID +1015 * +1016 * @param jobId identifier of the job - mandatory +1017 * @return a {@link RundeckJob} instance - won't be null +1018 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1019 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1020 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1021 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1022 * @see #findJob(String, String, String) +1023 * @see #exportJob(String, String) +1024 */ +1025 public RundeckJob getJob(String jobId) throws RundeckApiException, RundeckApiLoginException, +1026 RundeckApiTokenException, IllegalArgumentException { +1027 AssertUtil.notBlank(jobId, "jobId is mandatory to get the details of a job !"); +1028 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId), new JobParser("joblist/job")); +1029 } +1030 +1031 /** +1032 * Delete a single job, identified by the given ID +1033 * +1034 * @param jobId identifier of the job - mandatory +1035 * @return the success message (note that in case of error, you'll get an exception) +1036 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1037 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1038 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1039 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1040 */ +1041 public String deleteJob(String jobId) throws RundeckApiException, RundeckApiLoginException, +1042 RundeckApiTokenException, IllegalArgumentException { +1043 AssertUtil.notBlank(jobId, "jobId is mandatory to delete a job !"); +1044 new ApiCall(this).delete(new ApiPathBuilder("/job/", jobId)); +1045 return "Job " + jobId + " was deleted successfully"; +1046 } +1047 /** +1048 * Delete multiple jobs, identified by the given IDs +1049 * +1050 * @param jobIds List of job IDS +1051 * @return the bulk delete result +1052 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1053 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1054 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1055 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1056 */ +1057 public RundeckJobDeleteBulk deleteJobs(final List<String> jobIds) throws RundeckApiException, RundeckApiLoginException, +1058 RundeckApiTokenException, IllegalArgumentException { +1059 if (null == jobIds || 0 == jobIds.size()) { +1060 throw new IllegalArgumentException("jobIds are mandatory to delete a job"); +1061 } +1062 return new ApiCall(this).post(new ApiPathBuilder("/jobs/delete").field("ids",jobIds), +1063 new BulkDeleteParser(rootXpath()+"/deleteJobs")); +1064 } +1065 +1066 /** +1067 * Trigger the execution of a RunDeck job (identified by the given ID), and return immediately (without waiting the +1068 * end of the job execution) +1069 * +1070 * @param jobRun the RunJob, see {@link RunJobBuilder} +1071 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1072 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1073 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1074 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1075 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1076 * @see #triggerJob(String) +1077 * @see #runJob(String, Properties, Properties) +1078 */ +1079 public RundeckExecution triggerJob(final RunJob jobRun) +1080 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1081 AssertUtil.notBlank(jobRun.getJobId(), "jobId is mandatory to trigger a job !"); +1082 ApiPathBuilder apiPath = new ApiPathBuilder("/job/", jobRun.getJobId(), "/run").param("argString", +1083 ParametersUtil.generateArgString(jobRun.getOptions())) +1084 .nodeFilters(jobRun.getNodeFilters()); +1085 if(null!=jobRun.getAsUser()) { +1086 apiPath.param("asUser", jobRun.getAsUser()); +1087 } +1088 return new ApiCall(this).get(apiPath, +1089 APIV11Helper.unwrapIfNeeded( +1090 new ExecutionParser( +1091 rootXpath() + +1092 "/executions/execution" +1093 ), rootXpath() + +1094 "/executions/execution" +1095 ) +1096 +1097 ); +1098 } +1099 +1100 +1101 /** +1102 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1103 * We will poll the RunDeck server at regular interval (every 5 seconds) to know if the execution is finished (or +1104 * aborted) or is still running. +1105 * +1106 * @param runJob the RunJob, see {@link RunJobBuilder} +1107 * +1108 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1109 * +1110 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1111 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1112 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1113 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1114 * @see #triggerJob(RunJob) +1115 * @see #runJob(RunJob, long, TimeUnit) +1116 */ +1117 public RundeckExecution runJob(final RunJob runJob) throws RundeckApiException, RundeckApiLoginException, +1118 RundeckApiTokenException, IllegalArgumentException { +1119 return runJob(runJob, DEFAULT_POOLING_INTERVAL, DEFAULT_POOLING_UNIT); +1120 } +1121 +1122 /** +1123 * Run a RunDeck job (identified by the given ID), and wait until its execution is finished (or aborted) to return. +1124 * We will poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to +1125 * know if the execution is finished (or aborted) or is still running. +1126 * +1127 * @param jobRun the RunJob, see {@link RunJobBuilder} +1128 * @param poolingInterval for checking the status of the execution. Must be > 0. +1129 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1130 * +1131 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1132 * +1133 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1134 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1135 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1136 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1137 * @see #triggerJob(RunJob) +1138 */ +1139 public RundeckExecution runJob(final RunJob jobRun, long poolingInterval, +1140 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +1141 IllegalArgumentException { +1142 +1143 if (poolingInterval <= 0) { +1144 poolingInterval = DEFAULT_POOLING_INTERVAL; +1145 poolingUnit = DEFAULT_POOLING_UNIT; +1146 } +1147 if (poolingUnit == null) { +1148 poolingUnit = DEFAULT_POOLING_UNIT; +1149 } +1150 +1151 RundeckExecution execution = triggerJob(jobRun); +1152 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { +1153 try { +1154 Thread.sleep(poolingUnit.toMillis(poolingInterval)); +1155 } catch (InterruptedException e) { +1156 break; +1157 } +1158 execution = getExecution(execution.getId()); +1159 } +1160 return execution; +1161 } +1162 +1163 /* +1164 * Ad-hoc commands +1165 */ +1166 +1167 +1168 /** +1169 * Trigger the execution of an ad-hoc command, and return immediately (without waiting the end of the execution). +1170 * The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1171 * +1172 * @param command the RunAdhocCommand. Project and command are mandatory, see {@link RunAdhocCommandBuilder} +1173 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1174 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1175 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1176 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1177 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1178 * @see #triggerAdhocCommand(String, String) +1179 * @see #runAdhocCommand(String, String, Properties) +1180 */ +1181 public RundeckExecution triggerAdhocCommand(RunAdhocCommand command) throws RundeckApiException, RundeckApiLoginException, +1182 RundeckApiTokenException, IllegalArgumentException { +1183 AssertUtil.notBlank(command.getProject(), "project is mandatory to trigger an ad-hoc command !"); +1184 AssertUtil.notBlank(command.getCommand(), "command is mandatory to trigger an ad-hoc command !"); +1185 ApiPathBuilder apiPath = new ApiPathBuilder("/run/command").param("project", command.getProject()) +1186 .param("exec", command.getCommand()) +1187 .param("nodeThreadcount", +1188 command.getNodeThreadcount()) +1189 .param("nodeKeepgoing", +1190 command.getNodeKeepgoing()) +1191 .nodeFilters(command.getNodeFilters()); +1192 if(null!= command.getAsUser()) { +1193 apiPath.param("asUser", command.getAsUser()); +1194 } +1195 RundeckExecution execution = new ApiCall(this).get(apiPath, new ExecutionParser(rootXpath()+"/execution")); +1196 // the first call just returns the ID of the execution, so we need another call to get a "real" execution +1197 return getExecution(execution.getId()); +1198 } +1199 +1200 +1201 /** +1202 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1203 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +1204 * running. The command will be dispatched to nodes, accordingly to the nodeFilters parameter. +1205 * +1206 * @param command the RunAdhocCommand, see {@link RunAdhocCommandBuilder} +1207 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1208 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1209 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1210 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1211 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1212 * @see #runAdhocCommand(String, String, Properties, Integer, Boolean, long, TimeUnit) +1213 * @see #triggerAdhocCommand(RunAdhocCommand) +1214 */ +1215 public RundeckExecution runAdhocCommand(RunAdhocCommand command) throws RundeckApiException, RundeckApiLoginException, +1216 RundeckApiTokenException, IllegalArgumentException { +1217 return runAdhocCommand(command, +1218 DEFAULT_POOLING_INTERVAL, +1219 DEFAULT_POOLING_UNIT); +1220 } +1221 +1222 /** +1223 * Run an ad-hoc command, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1224 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +1225 * finished (or aborted) or is still running. The command will be dispatched to nodes, accordingly to the +1226 * nodeFilters parameter. +1227 * +1228 * @param command the RunAdhocCommand, see {@link RunAdhocCommandBuilder} +1229 * @param poolingInterval for checking the status of the execution. Must be > 0. +1230 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1231 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1232 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1233 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1234 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1235 * @throws IllegalArgumentException if the project or command is blank (null, empty or whitespace) +1236 * @see #triggerAdhocCommand(RunAdhocCommand) +1237 */ +1238 public RundeckExecution runAdhocCommand(RunAdhocCommand command, long poolingInterval, TimeUnit poolingUnit) +1239 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1240 if (poolingInterval <= 0) { +1241 poolingInterval = DEFAULT_POOLING_INTERVAL; +1242 poolingUnit = DEFAULT_POOLING_UNIT; +1243 } +1244 if (poolingUnit == null) { +1245 poolingUnit = DEFAULT_POOLING_UNIT; +1246 } +1247 +1248 RundeckExecution execution = triggerAdhocCommand(command); +1249 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { +1250 try { +1251 Thread.sleep(poolingUnit.toMillis(poolingInterval)); +1252 } catch (InterruptedException e) { +1253 break; +1254 } +1255 execution = getExecution(execution.getId()); +1256 } +1257 return execution; +1258 } +1259 +1260 /* +1261 * Ad-hoc scripts +1262 */ +1263 +1264 +1265 /** +1266 * Trigger the execution of an ad-hoc script read from a file, and return immediately (without waiting the end of +1267 * the execution). The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1268 * +1269 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +1270 * @param scriptFilename a file to read as the input script stream +1271 * +1272 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1273 * +1274 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1275 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1276 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1277 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1278 * @throws IOException if an error occurs reading the script file +1279 * @see #triggerAdhocScript(RunAdhocScript) +1280 * @see #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit) +1281 */ +1282 public RundeckExecution triggerAdhocScript(final RunAdhocScript script, final String scriptFilename) throws +1283 RundeckApiException, +1284 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +1285 AssertUtil.notBlank(scriptFilename, "scriptFilename is mandatory to trigger an ad-hoc script !"); +1286 FileInputStream stream = null; +1287 try { +1288 stream = FileUtils.openInputStream(new File(scriptFilename)); +1289 return triggerAdhocScript(RunAdhocScriptBuilder.builder(script) +1290 .setScript(stream) +1291 .build()); +1292 } finally { +1293 IOUtils.closeQuietly(stream); +1294 } +1295 } +1296 /** +1297 * Trigger the execution of an ad-hoc script, and return immediately (without waiting the end of the execution). The +1298 * script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1299 * +1300 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +1301 * @return a {@link RundeckExecution} instance for the newly created (and running) execution - won't be null +1302 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1303 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1304 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1305 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1306 * @see #triggerAdhocScript(String, String, Properties, Properties, Integer, Boolean) +1307 * @see #runAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean, long, TimeUnit) +1308 */ +1309 public RundeckExecution triggerAdhocScript(RunAdhocScript script) throws RundeckApiException, +1310 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1311 AssertUtil.notBlank(script.getProject(), "project is mandatory to trigger an ad-hoc script !"); +1312 AssertUtil.notNull(script.getScript(), "script is mandatory to trigger an ad-hoc script !"); +1313 ApiPathBuilder apiPath = new ApiPathBuilder("/run/script").param("project", script.getProject()) +1314 .attach("scriptFile", +1315 script.getScript()) +1316 .param("argString",script.getArgString()) +1317 .param("nodeThreadcount", +1318 script.getNodeThreadcount()) +1319 .param("nodeKeepgoing", +1320 script.getNodeKeepgoing()) +1321 .param("scriptInterpreter", +1322 script.getScriptInterpreter()) +1323 .param("interpreterArgsQuoted", +1324 script.getInterpreterArgsQuoted()) +1325 .nodeFilters(script.getNodeFilters()); +1326 if(null!=script.getAsUser()) { +1327 apiPath.param("asUser", script.getAsUser()); +1328 } +1329 RundeckExecution execution = new ApiCall(this).post(apiPath, new ExecutionParser(rootXpath()+"/execution")); +1330 // the first call just returns the ID of the execution, so we need another call to get a "real" execution +1331 return getExecution(execution.getId()); +1332 } +1333 +1334 +1335 /** +1336 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1337 * server at regular interval (every 5 seconds) to know if the execution is finished (or aborted) or is still +1338 * running. The script will be dispatched to nodes, accordingly to the nodeFilters parameter. +1339 * +1340 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +1341 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1342 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1343 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1344 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1345 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1346 * @throws IOException if we failed to read the file +1347 * @see #runAdhocScript(RunAdhocScript, long, java.util.concurrent.TimeUnit) +1348 * @see #triggerAdhocScript(RunAdhocScript) +1349 */ +1350 public RundeckExecution runAdhocScript(RunAdhocScript script) throws RundeckApiException, +1351 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException, IOException { +1352 return runAdhocScript(script, +1353 DEFAULT_POOLING_INTERVAL, +1354 DEFAULT_POOLING_UNIT); +1355 } +1356 +1357 /** +1358 * Run an ad-hoc script read from a file, and wait until its execution is finished (or aborted) to return. We will +1359 * poll the RunDeck server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the +1360 * execution is finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to +1361 * the nodeFilters parameter. +1362 * +1363 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +1364 * @param scriptFilename filename of a script to read +1365 * @param poolingInterval for checking the status of the execution. Must be > 0. +1366 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1367 * +1368 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1369 * +1370 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1371 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1372 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1373 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1374 * @throws IOException if we failed to read the file +1375 * @see #runAdhocScript(RunAdhocScript) +1376 * @see #triggerAdhocScript(RunAdhocScript, String) +1377 */ +1378 public RundeckExecution runAdhocScript(final RunAdhocScript script, final String scriptFilename, +1379 final long poolingInterval, final TimeUnit poolingUnit) throws RundeckApiException, +1380 RundeckApiLoginException, RundeckApiTokenException, +1381 IllegalArgumentException, IOException { +1382 FileInputStream stream = null; +1383 try { +1384 stream = FileUtils.openInputStream(new File(scriptFilename)); +1385 return runAdhocScript(RunAdhocScriptBuilder.builder(script) +1386 .setScript(stream) +1387 .build(), poolingInterval, poolingUnit); +1388 } finally { +1389 IOUtils.closeQuietly(stream); +1390 } +1391 } +1392 /** +1393 * Run an ad-hoc script, and wait until its execution is finished (or aborted) to return. We will poll the RunDeck +1394 * server at regular interval (configured by the poolingInterval/poolingUnit couple) to know if the execution is +1395 * finished (or aborted) or is still running. The script will be dispatched to nodes, accordingly to the nodeFilters +1396 * parameter. +1397 * +1398 * @param script the RunAdhocScript, see {@link RunAdhocScriptBuilder} +1399 * @param poolingInterval for checking the status of the execution. Must be > 0. +1400 * @param poolingUnit unit (seconds, milli-seconds, ...) of the interval. Default to seconds. +1401 * @return a {@link RundeckExecution} instance for the (finished/aborted) execution - won't be null +1402 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1403 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1404 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1405 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) or the script is null +1406 * @throws IOException if we failed to read the file +1407 * @see #runAdhocScript(String, String, Properties, Properties, Integer, Boolean, long, TimeUnit) +1408 * @see #triggerAdhocScript(String, InputStream, Properties, Properties, Integer, Boolean) +1409 */ +1410 public RundeckExecution runAdhocScript(final RunAdhocScript script, long poolingInterval, +1411 TimeUnit poolingUnit) throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, +1412 IllegalArgumentException { +1413 if (poolingInterval <= 0) { +1414 poolingInterval = DEFAULT_POOLING_INTERVAL; +1415 poolingUnit = DEFAULT_POOLING_UNIT; +1416 } +1417 if (poolingUnit == null) { +1418 poolingUnit = DEFAULT_POOLING_UNIT; +1419 } +1420 +1421 RundeckExecution execution = triggerAdhocScript(script); +1422 while (ExecutionStatus.RUNNING.equals(execution.getStatus())) { +1423 try { +1424 Thread.sleep(poolingUnit.toMillis(poolingInterval)); +1425 } catch (InterruptedException e) { +1426 break; +1427 } +1428 execution = getExecution(execution.getId()); +1429 } +1430 return execution; +1431 } +1432 +1433 /* +1434 * Executions +1435 */ +1436 +1437 /** +1438 * Get all running executions (for all projects) +1439 * +1440 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1441 * @throws RundeckApiException in case of error when calling the API +1442 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1443 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1444 * @see #getRunningExecutions(String) +1445 */ +1446 public List<RundeckExecution> getRunningExecutions() throws RundeckApiException, RundeckApiLoginException, +1447 RundeckApiTokenException { +1448 if (this.getApiVersion() >= Version.V9.getVersionNumber()) { +1449 //simply query using '*' +1450 return getRunningExecutions("*"); +1451 } else { +1452 List<RundeckExecution> executions = new ArrayList<RundeckExecution>(); +1453 for (RundeckProject project : getProjects()) { +1454 executions.addAll(getRunningExecutions(project.getName())); +1455 } +1456 return executions; +1457 } +1458 } +1459 +1460 /** +1461 * Get the running executions for the given project +1462 * +1463 * @param project name of the project - mandatory +1464 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1465 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1466 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1467 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1468 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1469 * @see #getRunningExecutions() +1470 */ +1471 public List<RundeckExecution> getRunningExecutions(String project) throws RundeckApiException, +1472 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1473 AssertUtil.notBlank(project, "project is mandatory get all running executions !"); +1474 return new ApiCall(this).get(new ApiPathBuilder("/executions/running").param("project", project), +1475 new ListParser<RundeckExecution>(new ExecutionParser(), +1476 rootXpath()+"/executions/execution")); +1477 } +1478 +1479 /** +1480 * Get the executions of the given job +1481 * +1482 * @param jobId identifier of the job - mandatory +1483 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1484 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1485 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1486 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1487 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1488 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) +1489 */ +1490 public List<RundeckExecution> getJobExecutions(String jobId) throws RundeckApiException, RundeckApiLoginException, +1491 RundeckApiTokenException, IllegalArgumentException { +1492 return getJobExecutions(jobId, (ExecutionStatus) null); +1493 } +1494 +1495 /** +1496 * Get the executions of the given job +1497 * +1498 * @param jobId identifier of the job - mandatory +1499 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +1500 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1501 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1502 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1503 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1504 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is +1505 * invalid +1506 * @see #getJobExecutions(String, String, Long, Long) +1507 */ +1508 public List<RundeckExecution> getJobExecutions(String jobId, String status) throws RundeckApiException, +1509 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1510 return getJobExecutions(jobId, +1511 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status))); +1512 } +1513 +1514 /** +1515 * Get the executions of the given job +1516 * +1517 * @param jobId identifier of the job - mandatory +1518 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +1519 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1520 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1521 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1522 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1523 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1524 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) +1525 */ +1526 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status) throws RundeckApiException, +1527 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1528 return getJobExecutions(jobId, status, null, null); +1529 } +1530 +1531 /** +1532 * Get the executions of the given job +1533 * +1534 * @param jobId identifier of the job - mandatory +1535 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +1536 * @param max number of results to return - optional (null for all) +1537 * @param offset the 0-indexed offset for the first result to return - optional +1538 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1539 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1540 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1541 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1542 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace), or the executionStatus is +1543 * invalid +1544 * @see #getJobExecutions(String, RundeckExecution.ExecutionStatus, Long, Long) +1545 */ +1546 public List<RundeckExecution> getJobExecutions(String jobId, String status, Long max, Long offset) +1547 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1548 return getJobExecutions(jobId, +1549 StringUtils.isBlank(status) ? null : ExecutionStatus.valueOf(StringUtils.upperCase(status)), +1550 max, +1551 offset); +1552 } +1553 +1554 /** +1555 * Get the executions of the given job +1556 * +1557 * @param jobId identifier of the job - mandatory +1558 * @param status of the executions, see {@link ExecutionStatus} - optional (null for all) +1559 * @param max number of results to return - optional (null for all) +1560 * @param offset the 0-indexed offset for the first result to return - optional +1561 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1562 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1563 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1564 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1565 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1566 */ +1567 public List<RundeckExecution> getJobExecutions(String jobId, ExecutionStatus status, Long max, Long offset) +1568 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1569 AssertUtil.notBlank(jobId, "jobId is mandatory to get the executions of a job !"); +1570 return new ApiCall(this).get(new ApiPathBuilder("/job/", jobId, "/executions").param("status", status) +1571 .param("max", max) +1572 .param("offset", offset), +1573 new ListParser<RundeckExecution>(new ExecutionParser(), +1574 rootXpath()+"/executions/execution")); +1575 } +1576 +1577 /** +1578 * Get executions based on query parameters +1579 * +1580 * @param query query parameters for the request +1581 * @param max number of results to return - optional (null for all) +1582 * @param offset the 0-indexed offset for the first result to return - optional +1583 * @return a {@link List} of {@link RundeckExecution} : might be empty, but won't be null +1584 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +1585 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1586 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1587 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +1588 */ +1589 public PagedResults<RundeckExecution> getExecutions(ExecutionQuery query, Long max, Long offset) +1590 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1591 if (!query.notBlank()) { +1592 throw new IllegalArgumentException("Some execution query parameter must be set"); +1593 } +1594 AssertUtil.notBlank(query.getProject(), "project is required for execution query"); +1595 return new ApiCall(this).get(new ApiPathBuilder("/executions") +1596 .param(new ExecutionQueryParameters(query)) +1597 .param("max", max) +1598 .param("offset", offset), +1599 APIV11Helper.unwrapIfNeeded( +1600 new PagedResultParser<RundeckExecution>( +1601 new ListParser<RundeckExecution>( +1602 new ExecutionParser(), +1603 "execution" +1604 ), +1605 rootXpath() + "/executions" +1606 ), +1607 rootXpath() + "/executions" +1608 ) +1609 ); 1610 } 1611 1612 /** -1613 * Abort an execution (identified by the given ID). The execution should be running... +1613 * Get a single execution, identified by the given ID 1614 * 1615 * @param executionId identifier of the execution - mandatory -1616 * @return a {@link RundeckAbort} instance - won't be null +1616 * @return a {@link RundeckExecution} instance - won't be null 1617 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) 1618 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 1619 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) 1620 * @throws IllegalArgumentException if the executionId is null 1621 */ -1622 public RundeckAbort abortExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, +1622 public RundeckExecution getExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, 1623 RundeckApiTokenException, IllegalArgumentException { -1624 return abortExecution(executionId, null); -1625 } -1626 /** -1627 * Abort an execution (identified by the given ID). The execution should be running... -1628 * -1629 * @param executionId identifier of the execution - mandatory -1630 * @param asUser specify a user name to abort the job as, must have 'killAs' permission -1631 * @return a {@link RundeckAbort} instance - won't be null -1632 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) -1633 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1634 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1635 * @throws IllegalArgumentException if the executionId is null -1636 */ -1637 public RundeckAbort abortExecution(Long executionId, final String asUser) throws RundeckApiException, RundeckApiLoginException, -1638 RundeckApiTokenException, IllegalArgumentException { -1639 AssertUtil.notNull(executionId, "executionId is mandatory to abort an execution !"); -1640 ApiPathBuilder apiPath = new ApiPathBuilder("/execution/", executionId.toString(), "/abort"); -1641 if(null!=asUser) { -1642 apiPath.param("asUser", asUser); -1643 } -1644 return new ApiCall(this).get(apiPath, new AbortParser(rootXpath()+"/abort")); -1645 } -1646 -1647 /* -1648 * History -1649 */ -1650 -1651 /** -1652 * Get the (events) history for the given project -1653 * -1654 * @param project name of the project - mandatory -1655 * @return a {@link RundeckHistory} instance - won't be null -1656 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1624 AssertUtil.notNull(executionId, "executionId is mandatory to get the details of an execution !"); +1625 return new ApiCall(this).get( +1626 new ApiPathBuilder("/execution/", executionId.toString()), +1627 APIV11Helper.unwrapIfNeeded( +1628 new ExecutionParser( +1629 rootXpath() + "/executions/execution" +1630 ), +1631 rootXpath() + "/executions/execution" +1632 ) +1633 ); +1634 } +1635 +1636 /** +1637 * Abort an execution (identified by the given ID). The execution should be running... +1638 * +1639 * @param executionId identifier of the execution - mandatory +1640 * @return a {@link RundeckAbort} instance - won't be null +1641 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) +1642 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1643 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1644 * @throws IllegalArgumentException if the executionId is null +1645 */ +1646 public RundeckAbort abortExecution(Long executionId) throws RundeckApiException, RundeckApiLoginException, +1647 RundeckApiTokenException, IllegalArgumentException { +1648 return abortExecution(executionId, null); +1649 } +1650 /** +1651 * Abort an execution (identified by the given ID). The execution should be running... +1652 * +1653 * @param executionId identifier of the execution - mandatory +1654 * @param asUser specify a user name to abort the job as, must have 'killAs' permission +1655 * @return a {@link RundeckAbort} instance - won't be null +1656 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) 1657 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 1658 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1659 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1660 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1661 */ -1662 public RundeckHistory getHistory(String project) throws RundeckApiException, RundeckApiLoginException, -1663 RundeckApiTokenException, IllegalArgumentException { -1664 return getHistory(project, null, null,(String) null, (String) null, null, null, null, null); -1665 } -1666 -1667 /** -1668 * Get the (events) history for the given project -1669 * -1670 * @param project name of the project - mandatory -1671 * @param max number of results to return - optional (default to 20) -1672 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -1673 * @return a {@link RundeckHistory} instance - won't be null -1674 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1675 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1676 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1677 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1678 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1679 */ -1680 public RundeckHistory getHistory(String project, Long max, Long offset) throws RundeckApiException, -1681 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1682 return getHistory(project, null, null, (String)null, (String)null, null, null, max, offset); -1683 } -1684 -1685 /** -1686 * Get the (events) history for the given project -1687 * -1688 * @param project name of the project - mandatory -1689 * @param jobId include only events matching the given job ID - optional -1690 * @param reportId include only events matching the given report ID - optional -1691 * @param user include only events created by the given user - optional -1692 * @return a {@link RundeckHistory} instance - won't be null -1693 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1694 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1695 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1696 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1697 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1698 */ -1699 public RundeckHistory getHistory(String project, String jobId, String reportId, String user) -1700 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1701 return getHistory(project, jobId, reportId, user, null, null, null, null, null); -1702 } -1703 -1704 /** -1705 * Get the (events) history for the given project -1706 * -1707 * @param project name of the project - mandatory -1708 * @param jobId include only events matching the given job ID - optional -1709 * @param reportId include only events matching the given report ID - optional -1710 * @param user include only events created by the given user - optional -1711 * @param max number of results to return - optional (default to 20) -1712 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -1713 * @return a {@link RundeckHistory} instance - won't be null -1714 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1715 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1716 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1717 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1718 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1719 */ -1720 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, Long max, Long offset) -1721 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1722 return getHistory(project, jobId, reportId, user, null, null, null, max, offset); -1723 } -1724 -1725 /** -1726 * Get the (events) history for the given project -1727 * -1728 * @param project name of the project - mandatory -1729 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y -1730 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 -1731 * weeks), "5d" (= last 5 days), etc. Optional. -1732 * @return a {@link RundeckHistory} instance - won't be null -1733 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1734 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1735 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1736 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1737 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1738 */ -1739 public RundeckHistory getHistory(String project, String recent) throws RundeckApiException, -1740 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1741 return getHistory(project, null, null, null, recent, null, null, null, null); -1742 } +1659 * @throws IllegalArgumentException if the executionId is null +1660 */ +1661 public RundeckAbort abortExecution(Long executionId, final String asUser) throws RundeckApiException, RundeckApiLoginException, +1662 RundeckApiTokenException, IllegalArgumentException { +1663 AssertUtil.notNull(executionId, "executionId is mandatory to abort an execution !"); +1664 ApiPathBuilder apiPath = new ApiPathBuilder("/execution/", executionId.toString(), "/abort"); +1665 if(null!=asUser) { +1666 apiPath.param("asUser", asUser); +1667 } +1668 return new ApiCall(this).get(apiPath, new AbortParser(rootXpath() + "/abort")); +1669 } +1670 +1671 /** +1672 * Delete all executions for a job specified by a job ID +1673 * +1674 * @param jobId Identifier for the job +1675 * +1676 * @return a {@link DeleteExecutionsResponse} instance - won't be null +1677 * +1678 * @throws RundeckApiException in case of error when calling the API (non-existent +1679 * execution with this ID) +1680 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1681 * @throws RundeckApiTokenException if the token is invalid (in case of token-based +1682 * authentication) +1683 * @throws IllegalArgumentException if the executionIds is null +1684 */ +1685 public DeleteExecutionsResponse deleteAllJobExecutions(final String jobId) +1686 throws RundeckApiException, RundeckApiLoginException, +1687 RundeckApiTokenException, IllegalArgumentException +1688 { +1689 AssertUtil.notNull(jobId, "jobId is mandatory to delete executions!"); +1690 return new ApiCall(this).delete( +1691 new ApiPathBuilder("/job/",jobId,"/executions"), +1692 new DeleteExecutionsResponseParser(rootXpath() + "/deleteExecutions") +1693 ); +1694 } +1695 +1696 /** +1697 * Delete a set of executions, identified by the given IDs +1698 * +1699 * @param executionIds set of identifiers for the executions - mandatory +1700 * @return a {@link DeleteExecutionsResponse} instance - won't be null +1701 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) +1702 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1703 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1704 * @throws IllegalArgumentException if the executionIds is null +1705 */ +1706 public DeleteExecutionsResponse deleteExecutions(final Set<Long> executionIds) +1707 throws RundeckApiException, RundeckApiLoginException, +1708 RundeckApiTokenException, IllegalArgumentException +1709 { +1710 AssertUtil.notNull(executionIds, "executionIds is mandatory to delete executions!"); +1711 if (executionIds.size() < 1) { +1712 throw new IllegalArgumentException("executionIds cannot be empty"); +1713 } +1714 final ApiPathBuilder apiPath = new ApiPathBuilder("/executions/delete").xml( +1715 new DeleteExecutionsGenerator(executionIds) +1716 ); +1717 return new ApiCall(this).post( +1718 apiPath, +1719 new DeleteExecutionsResponseParser( rootXpath() + "/deleteExecutions") +1720 ); +1721 } +1722 +1723 /** +1724 * Delete a single execution, identified by the given ID +1725 * +1726 * @param executionId identifier for the execution - mandatory +1727 * @throws RundeckApiException in case of error when calling the API (non-existent execution with this ID) +1728 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1729 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1730 * @throws IllegalArgumentException if the executionId is null +1731 */ +1732 public void deleteExecution(final Long executionId) +1733 throws RundeckApiException, RundeckApiLoginException, +1734 RundeckApiTokenException, IllegalArgumentException +1735 { +1736 AssertUtil.notNull(executionId, "executionId is mandatory to delete an execution!"); +1737 new ApiCall(this).delete(new ApiPathBuilder("/execution/", executionId.toString())); +1738 } +1739 +1740 /* +1741 * History +1742 */ 1743 1744 /** 1745 * Get the (events) history for the given project 1746 * 1747 * @param project name of the project - mandatory -1748 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y -1749 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 -1750 * weeks), "5d" (= last 5 days), etc. Optional. -1751 * @param max number of results to return - optional (default to 20) -1752 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -1753 * @return a {@link RundeckHistory} instance - won't be null -1754 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1755 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1756 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1757 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1758 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1759 */ -1760 public RundeckHistory getHistory(String project, String recent, Long max, Long offset) throws RundeckApiException, -1761 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1762 return getHistory(project, null, null, null, recent, null, null, max, offset); -1763 } -1764 -1765 /** -1766 * Get the (events) history for the given project -1767 * -1768 * @param project name of the project - mandatory -1769 * @param begin date for the earlier events to retrieve - optional -1770 * @param end date for the latest events to retrieve - optional -1771 * @return a {@link RundeckHistory} instance - won't be null -1772 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1773 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1774 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1775 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1776 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1777 */ -1778 public RundeckHistory getHistory(String project, Date begin, Date end) throws RundeckApiException, -1779 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1780 return getHistory(project, null, null, (String)null, (String)null, begin, end, null, null); -1781 } -1782 -1783 /** -1784 * Get the (events) history for the given project -1785 * -1786 * @param project name of the project - mandatory -1787 * @param begin date for the earlier events to retrieve - optional -1788 * @param end date for the latest events to retrieve - optional -1789 * @param max number of results to return - optional (default to 20) -1790 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -1791 * @return a {@link RundeckHistory} instance - won't be null -1792 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1793 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1794 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1795 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1796 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) -1797 */ -1798 public RundeckHistory getHistory(String project, Date begin, Date end, Long max, Long offset) -1799 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1800 return getHistory(project, null, null, (String)null, (String) null, begin, end, max, offset); -1801 } -1802 -1803 /** -1804 * Get the (events) history for the given project -1805 * -1806 * @param project name of the project - mandatory -1807 * @param jobId include only events matching the given job ID - optional -1808 * @param reportId include only events matching the given report ID - optional -1809 * @param user include only events created by the given user - optional -1810 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y -1811 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 -1812 * weeks), "5d" (= last 5 days), etc. Optional. -1813 * @param begin date for the earlier events to retrieve - optional -1814 * @param end date for the latest events to retrieve - optional -1815 * @param max number of results to return - optional (default to 20) -1816 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -1817 * @return a {@link RundeckHistory} instance - won't be null -1818 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1819 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1820 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1821 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1822 */ -1823 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, String recent, -1824 Date begin, Date end, Long max, Long offset) throws RundeckApiException, RundeckApiLoginException, -1825 RundeckApiTokenException, IllegalArgumentException { -1826 AssertUtil.notBlank(project, "project is mandatory to get the history !"); -1827 return new ApiCall(this).get(new ApiPathBuilder("/history").param("project", project) -1828 .param("jobIdFilter", jobId) -1829 .param("reportIdFilter", reportId) -1830 .param("userFilter", user) -1831 .param("recentFilter", recent) -1832 .param("begin", begin) -1833 .param("end", end) -1834 .param("max", max) -1835 .param("offset", offset), -1836 new HistoryParser(rootXpath()+"/events")); -1837 } -1838 -1839 /** -1840 * Get the (events) history for the given project -1841 * -1842 * @param project name of the project - mandatory -1843 * @param includeJobNames list of job names ("group/name") to include results for -1844 * @param excludeJobNames list of job names ("group/name") to exclude results for -1845 * @param user include only events created by the given user - optional -1846 * @param recent include only events matching the given period of time. Format : "XY", where X is an -1847 * integer, and Y is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). -1848 * Example : "2w" (= last 2 weeks), "5d" (= last 5 days), etc. Optional. -1849 * @param begin date for the earlier events to retrieve - optional -1850 * @param end date for the latest events to retrieve - optional -1851 * @param max number of results to return - optional (default to 20) -1852 * @param offset the 0-indexed offset for the first result to return - optional (default to O) -1853 * -1854 * @return a {@link RundeckHistory} instance - won't be null -1855 * -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) -1860 */ -1861 public RundeckHistory getHistory(String project, -1862 String user, -1863 String recent, -1864 List<String> includeJobNames, -1865 List<String> excludeJobNames, -1866 Date begin, -1867 Date end, -1868 Long max, -1869 Long offset) -1870 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1871 -1872 AssertUtil.notBlank(project, "project is mandatory to get the history !"); -1873 final ApiPathBuilder builder = new ApiPathBuilder("/history").param("project", project) -1874 .field("jobListFilter", includeJobNames) -1875 .field("excludeJobListFilter", excludeJobNames) -1876 .param("userFilter", user) -1877 .param("recentFilter", recent) -1878 .param("begin", begin) -1879 .param("end", end) -1880 .param("max", max) -1881 .param("offset", offset); -1882 -1883 return new ApiCall(this).postOrGet(builder, new HistoryParser(rootXpath()+"/events")); -1884 } -1885 -1886 /* -1887 * Nodes -1888 */ -1889 -1890 /** -1891 * List all nodes (for all projects) -1892 * -1893 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null -1894 * @throws RundeckApiException in case of error when calling the API -1895 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1896 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1897 */ -1898 public List<RundeckNode> getNodes() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { -1899 List<RundeckNode> nodes = new ArrayList<RundeckNode>(); -1900 for (RundeckProject project : getProjects()) { -1901 nodes.addAll(getNodes(project.getName())); -1902 } -1903 return nodes; -1904 } -1905 -1906 /** -1907 * List all nodes that belongs to the given project -1908 * -1909 * @param project name of the project - mandatory -1910 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null +1748 * @return a {@link RundeckHistory} instance - won't be null +1749 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1750 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1751 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1752 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1753 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1754 */ +1755 public RundeckHistory getHistory(String project) throws RundeckApiException, RundeckApiLoginException, +1756 RundeckApiTokenException, IllegalArgumentException { +1757 return getHistory(project, null, null,(String) null, (String) null, null, null, null, null); +1758 } +1759 +1760 /** +1761 * Get the (events) history for the given project +1762 * +1763 * @param project name of the project - mandatory +1764 * @param max number of results to return - optional (default to 20) +1765 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +1766 * @return a {@link RundeckHistory} instance - 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) +1771 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1772 */ +1773 public RundeckHistory getHistory(String project, Long max, Long offset) throws RundeckApiException, +1774 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1775 return getHistory(project, null, null, (String)null, (String)null, null, null, max, offset); +1776 } +1777 +1778 /** +1779 * Get the (events) history for the given project +1780 * +1781 * @param project name of the project - mandatory +1782 * @param jobId include only events matching the given job ID - optional +1783 * @param reportId include only events matching the given report ID - optional +1784 * @param user include only events created by the given user - optional +1785 * @return a {@link RundeckHistory} instance - won't be null +1786 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1787 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1788 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1789 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1790 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1791 */ +1792 public RundeckHistory getHistory(String project, String jobId, String reportId, String user) +1793 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1794 return getHistory(project, jobId, reportId, user, null, null, null, null, null); +1795 } +1796 +1797 /** +1798 * Get the (events) history for the given project +1799 * +1800 * @param project name of the project - mandatory +1801 * @param jobId include only events matching the given job ID - optional +1802 * @param reportId include only events matching the given report ID - optional +1803 * @param user include only events created by the given user - optional +1804 * @param max number of results to return - optional (default to 20) +1805 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +1806 * @return a {@link RundeckHistory} instance - won't be null +1807 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1808 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1809 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1810 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1811 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1812 */ +1813 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, Long max, Long offset) +1814 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1815 return getHistory(project, jobId, reportId, user, null, null, null, max, offset); +1816 } +1817 +1818 /** +1819 * Get the (events) history for the given project +1820 * +1821 * @param project name of the project - mandatory +1822 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y +1823 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 +1824 * weeks), "5d" (= last 5 days), etc. Optional. +1825 * @return a {@link RundeckHistory} instance - won't be null +1826 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1827 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1828 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1829 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1830 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1831 */ +1832 public RundeckHistory getHistory(String project, String recent) throws RundeckApiException, +1833 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1834 return getHistory(project, null, null, null, recent, null, null, null, null); +1835 } +1836 +1837 /** +1838 * Get the (events) history for the given project +1839 * +1840 * @param project name of the project - mandatory +1841 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y +1842 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 +1843 * weeks), "5d" (= last 5 days), etc. Optional. +1844 * @param max number of results to return - optional (default to 20) +1845 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +1846 * @return a {@link RundeckHistory} instance - won't be null +1847 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1848 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1849 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1850 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1851 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1852 */ +1853 public RundeckHistory getHistory(String project, String recent, Long max, Long offset) throws RundeckApiException, +1854 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1855 return getHistory(project, null, null, null, recent, null, null, max, offset); +1856 } +1857 +1858 /** +1859 * Get the (events) history for the given project +1860 * +1861 * @param project name of the project - mandatory +1862 * @param begin date for the earlier events to retrieve - optional +1863 * @param end date for the latest events to retrieve - optional +1864 * @return a {@link RundeckHistory} instance - won't be null +1865 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1866 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1867 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1868 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1869 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1870 */ +1871 public RundeckHistory getHistory(String project, Date begin, Date end) throws RundeckApiException, +1872 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1873 return getHistory(project, null, null, (String)null, (String)null, begin, end, null, null); +1874 } +1875 +1876 /** +1877 * Get the (events) history for the given project +1878 * +1879 * @param project name of the project - mandatory +1880 * @param begin date for the earlier events to retrieve - optional +1881 * @param end date for the latest events to retrieve - optional +1882 * @param max number of results to return - optional (default to 20) +1883 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +1884 * @return a {@link RundeckHistory} instance - won't be null +1885 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1886 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1887 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1888 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1889 * @see #getHistory(String, String, String, String, String, Date, Date, Long, Long) +1890 */ +1891 public RundeckHistory getHistory(String project, Date begin, Date end, Long max, Long offset) +1892 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1893 return getHistory(project, null, null, (String)null, (String) null, begin, end, max, offset); +1894 } +1895 +1896 /** +1897 * Get the (events) history for the given project +1898 * +1899 * @param project name of the project - mandatory +1900 * @param jobId include only events matching the given job ID - optional +1901 * @param reportId include only events matching the given report ID - optional +1902 * @param user include only events created by the given user - optional +1903 * @param recent include only events matching the given period of time. Format : "XY", where X is an integer, and Y +1904 * is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). Example : "2w" (= last 2 +1905 * weeks), "5d" (= last 5 days), etc. Optional. +1906 * @param begin date for the earlier events to retrieve - optional +1907 * @param end date for the latest events to retrieve - optional +1908 * @param max number of results to return - optional (default to 20) +1909 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +1910 * @return a {@link RundeckHistory} instance - won't be null 1911 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) 1912 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) 1913 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) 1914 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1915 * @see #getNodes(String, Properties) -1916 */ -1917 public List<RundeckNode> getNodes(String project) throws RundeckApiException, RundeckApiLoginException, +1915 */ +1916 public RundeckHistory getHistory(String project, String jobId, String reportId, String user, String recent, +1917 Date begin, Date end, Long max, Long offset) throws RundeckApiException, RundeckApiLoginException, 1918 RundeckApiTokenException, IllegalArgumentException { -1919 return getNodes(project, null); -1920 } -1921 -1922 /** -1923 * List nodes that belongs to the given project -1924 * -1925 * @param project name of the project - mandatory -1926 * @param nodeFilters for filtering the nodes - optional. See {@link NodeFiltersBuilder} -1927 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null -1928 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) -1929 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1930 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1931 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) -1932 */ -1933 public List<RundeckNode> getNodes(String project, Properties nodeFilters) throws RundeckApiException, -1934 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -1935 AssertUtil.notBlank(project, "project is mandatory to get all nodes !"); -1936 return new ApiCall(this).get(new ApiPathBuilder("/resources").param("project", project) -1937 .nodeFilters(nodeFilters), -1938 new ListParser<RundeckNode>(new NodeParser(), "project/node")); -1939 } -1940 -1941 /** -1942 * Get the definition of a single node -1943 * -1944 * @param name of the node - mandatory -1945 * @param project name of the project - mandatory -1946 * @return a {@link RundeckNode} instance - won't be null -1947 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -1948 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1949 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1950 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -1951 */ -1952 public RundeckNode getNode(String name, String project) throws RundeckApiException, RundeckApiLoginException, -1953 RundeckApiTokenException, IllegalArgumentException { -1954 AssertUtil.notBlank(name, "the name of the node is mandatory to get a node !"); -1955 AssertUtil.notBlank(project, "project is mandatory to get a node !"); -1956 return new ApiCall(this).get(new ApiPathBuilder("/resource/", name).param("project", project), -1957 new NodeParser("project/node")); -1958 } -1959 -1960 /** -1961 * Get the output of a job execution -1962 * -1963 * @param executionId id of the execution - mandatory -1964 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -1965 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -1966 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1967 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1968 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -1969 */ -1970 public InputStream getOutput(String executionId) throws RundeckApiException, RundeckApiLoginException, -1971 RundeckApiTokenException, IllegalArgumentException { -1972 AssertUtil.notBlank(executionId, "the execution id is mandatory to get execution output !"); -1973 return new ApiCall(this).getNonApi(new ApiPathBuilder("/execution/downloadOutput/", executionId)); -1974 } +1919 AssertUtil.notBlank(project, "project is mandatory to get the history !"); +1920 return new ApiCall(this).get(new ApiPathBuilder("/history").param("project", project) +1921 .param("jobIdFilter", jobId) +1922 .param("reportIdFilter", reportId) +1923 .param("userFilter", user) +1924 .param("recentFilter", recent) +1925 .param("begin", begin) +1926 .param("end", end) +1927 .param("max", max) +1928 .param("offset", offset), +1929 new HistoryParser(rootXpath()+"/events")); +1930 } +1931 +1932 /** +1933 * Get the (events) history for the given project +1934 * +1935 * @param project name of the project - mandatory +1936 * @param includeJobNames list of job names ("group/name") to include results for +1937 * @param excludeJobNames list of job names ("group/name") to exclude results for +1938 * @param user include only events created by the given user - optional +1939 * @param recent include only events matching the given period of time. Format : "XY", where X is an +1940 * integer, and Y is one of : "h" (hour), "d" (day), "w" (week), "m" (month), "y" (year). +1941 * Example : "2w" (= last 2 weeks), "5d" (= last 5 days), etc. Optional. +1942 * @param begin date for the earlier events to retrieve - optional +1943 * @param end date for the latest events to retrieve - optional +1944 * @param max number of results to return - optional (default to 20) +1945 * @param offset the 0-indexed offset for the first result to return - optional (default to O) +1946 * +1947 * @return a {@link RundeckHistory} instance - won't be null +1948 * +1949 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +1950 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1951 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1952 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +1953 */ +1954 public RundeckHistory getHistory(String project, +1955 String user, +1956 String recent, +1957 List<String> includeJobNames, +1958 List<String> excludeJobNames, +1959 Date begin, +1960 Date end, +1961 Long max, +1962 Long offset) +1963 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +1964 +1965 AssertUtil.notBlank(project, "project is mandatory to get the history !"); +1966 final ApiPathBuilder builder = new ApiPathBuilder("/history").param("project", project) +1967 .field("jobListFilter", includeJobNames) +1968 .field("excludeJobListFilter", excludeJobNames) +1969 .param("userFilter", user) +1970 .param("recentFilter", recent) +1971 .param("begin", begin) +1972 .param("end", end) +1973 .param("max", max) +1974 .param("offset", offset); 1975 -1976 /** -1977 * Get the html page of the user's profile -1978 * -1979 * @param username - mandatory -1980 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -1981 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -1982 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -1983 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -1984 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -1985 */ -1986 public InputStream getProfilePage(String username) throws RundeckApiException, RundeckApiLoginException, -1987 RundeckApiTokenException, IllegalArgumentException { -1988 AssertUtil.notBlank(username, "the username is mandatory to get profile page !"); -1989 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/profile?login=", username)); -1990 } -1991 -1992 -1993 /** -1994 * Generate a new token and get the result page (which is the html page of the user's profile) -1995 * -1996 * @param username - mandatory -1997 * @return an {@link InputStream} instance, not linked to any network resources - won't be null -1998 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) -1999 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2000 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2001 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) -2002 */ -2003 public InputStream generateToken(String username) throws RundeckApiException, RundeckApiLoginException, -2004 RundeckApiTokenException, IllegalArgumentException { -2005 AssertUtil.notBlank(username, "the username is mandatory to generate the token"); -2006 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/generateApiToken?login=", username)); -2007 } -2008 -2009 -2010 /** -2011 * Get the execution output of the given job -2012 * -2013 * @param executionId identifier of the execution - mandatory -2014 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2015 * @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. -2016 * @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 -2017 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2018 * @return {@link RundeckOutput} -2019 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2020 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2021 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2022 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2023 * @deprecated renamed for clarity use {@link #getExecutionOutput(Long, int, int, long, int)}, will be removed in -2024 * version 12 of this library +1976 return new ApiCall(this).postOrGet(builder, new HistoryParser(rootXpath()+"/events")); +1977 } +1978 +1979 /* +1980 * Nodes +1981 */ +1982 +1983 /** +1984 * List all nodes (for all projects) +1985 * +1986 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null +1987 * @throws RundeckApiException in case of error when calling the API +1988 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +1989 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +1990 */ +1991 public List<RundeckNode> getNodes() throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException { +1992 List<RundeckNode> nodes = new ArrayList<RundeckNode>(); +1993 for (RundeckProject project : getProjects()) { +1994 nodes.addAll(getNodes(project.getName())); +1995 } +1996 return nodes; +1997 } +1998 +1999 /** +2000 * List all nodes that belongs to the given project +2001 * +2002 * @param project name of the project - mandatory +2003 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null +2004 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2005 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2006 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2007 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) +2008 * @see #getNodes(String, Properties) +2009 */ +2010 public List<RundeckNode> getNodes(String project) throws RundeckApiException, RundeckApiLoginException, +2011 RundeckApiTokenException, IllegalArgumentException { +2012 return getNodes(project, null); +2013 } +2014 +2015 /** +2016 * List nodes that belongs to the given project +2017 * +2018 * @param project name of the project - mandatory +2019 * @param nodeFilters for filtering the nodes - optional. See {@link NodeFiltersBuilder} +2020 * @return a {@link List} of {@link RundeckNode} : might be empty, but won't be null +2021 * @throws RundeckApiException in case of error when calling the API (non-existent project with this name) +2022 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2023 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2024 * @throws IllegalArgumentException if the project is blank (null, empty or whitespace) 2025 */ -2026 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, int lastlines, long lastmod, int maxlines) -2027 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2028 return getExecutionOutput(executionId, offset, lastlines, lastmod, maxlines); -2029 } -2030 /** -2031 * Get the execution output of the given job -2032 * -2033 * @param executionId identifier of the execution - mandatory -2034 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2035 * @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. -2036 * @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 -2037 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2038 * @return {@link RundeckOutput} -2039 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2040 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2041 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2042 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2043 */ -2044 public RundeckOutput getExecutionOutput(Long executionId, int offset, int lastlines, long lastmod, int maxlines) -2045 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2046 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2047 ApiPathBuilder param = new ApiPathBuilder( -2048 "/execution/", executionId.toString(), -2049 "/output") -2050 .param("offset", offset); -2051 if (lastlines > 0) { -2052 param.param("lastlines", lastlines); -2053 } -2054 if (lastmod >= 0) { -2055 param.param("lastmod", lastmod); -2056 } -2057 if (maxlines > 0) { -2058 param.param("maxlines", maxlines); -2059 } -2060 return new ApiCall(this).get(param, -2061 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); -2062 } -2063 /** -2064 * Get the execution state of the given execution -2065 * -2066 * @param executionId identifier of the execution - mandatory -2067 * @return {@link RundeckExecutionState} the execution state -2068 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2069 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2070 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2071 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2072 */ -2073 public RundeckExecutionState getExecutionState(Long executionId) -2074 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2075 AssertUtil.notNull(executionId, "executionId is mandatory to get the state of an execution!"); -2076 ApiPathBuilder param = new ApiPathBuilder( -2077 "/execution/", executionId.toString(), -2078 "/state"); -2079 -2080 return new ApiCall(this).get(param, new ExecutionStateParser(rootXpath()+"/executionState")); -2081 } -2082 -2083 /** -2084 * Get the execution output of the given execution on the specified node -2085 * -2086 * @param executionId identifier of the execution - mandatory -2087 * @param nodeName name of the node -2088 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2089 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will -2090 * override the offset value and return only the specified number of lines at the end of the -2091 * log. -2092 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the -2093 * specified date OR if more data is available at the given offset -2094 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2095 * -2096 * @return {@link RundeckOutput} -2097 * -2098 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2099 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2100 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2101 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2102 */ -2103 public RundeckOutput getExecutionOutputForNode(Long executionId, String nodeName, int offset, int lastlines, -2104 long lastmod, int maxlines) -2105 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2106 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2107 AssertUtil.notNull(nodeName, "nodeName is mandatory to get the output of a job execution!"); -2108 ApiPathBuilder param = new ApiPathBuilder( -2109 "/execution/", executionId.toString(), -2110 "/output/node/", nodeName) -2111 .param("offset", offset); -2112 if(lastlines>0) { -2113 param.param("lastlines", lastlines); -2114 } -2115 if(lastmod>=0) { -2116 param.param("lastmod", lastmod); -2117 } -2118 if(maxlines>0) { -2119 param.param("maxlines", maxlines); -2120 } -2121 return new ApiCall(this).get(param, -2122 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); -2123 } -2124 /** -2125 * Get the execution output of the given execution for the specified step -2126 * -2127 * @param executionId identifier of the execution - mandatory -2128 * @param stepCtx identifier for the step -2129 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2130 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will -2131 * override the offset value and return only the specified number of lines at the end of the -2132 * log. -2133 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the -2134 * specified date OR if more data is available at the given offset -2135 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2136 * -2137 * @return {@link RundeckOutput} -2138 * -2139 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2140 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2141 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2142 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2143 */ -2144 public RundeckOutput getExecutionOutputForStep(Long executionId, String stepCtx, int offset, int lastlines, -2145 long lastmod, int maxlines) -2146 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2147 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2148 AssertUtil.notNull(stepCtx, "stepCtx is mandatory to get the output of a job execution!"); -2149 ApiPathBuilder param = new ApiPathBuilder( -2150 "/execution/", executionId.toString(), -2151 "/output/step/", stepCtx) -2152 .param("offset", offset); -2153 if (lastlines > 0) { -2154 param.param("lastlines", lastlines); -2155 } -2156 if (lastmod >= 0) { -2157 param.param("lastmod", lastmod); -2158 } -2159 if (maxlines > 0) { -2160 param.param("maxlines", maxlines); -2161 } -2162 return new ApiCall(this).get(param, -2163 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); -2164 } -2165 /** -2166 * Get the execution output of the given execution for the specified step -2167 * -2168 * @param executionId identifier of the execution - mandatory -2169 * @param stepCtx identifier for the step -2170 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2171 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will -2172 * override the offset value and return only the specified number of lines at the end of the -2173 * log. -2174 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the -2175 * specified date OR if more data is available at the given offset -2176 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2177 * -2178 * @return {@link RundeckOutput} -2179 * -2180 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2181 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2182 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2183 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2184 */ -2185 public RundeckOutput getExecutionOutputForNodeAndStep(Long executionId, String nodeName, String stepCtx, -2186 int offset, int lastlines, -2187 long lastmod, int maxlines) -2188 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2189 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2190 AssertUtil.notNull(nodeName, "nodeName is mandatory to get the output of a job execution!"); -2191 AssertUtil.notNull(stepCtx, "stepCtx is mandatory to get the output of a job execution!"); -2192 ApiPathBuilder param = new ApiPathBuilder( -2193 "/execution/", executionId.toString(), -2194 "/output/node/", nodeName, -2195 "/step/", stepCtx) -2196 .param("offset", offset); -2197 if (lastlines > 0) { -2198 param.param("lastlines", lastlines); -2199 } -2200 if (lastmod >= 0) { -2201 param.param("lastmod", lastmod); -2202 } -2203 if (maxlines > 0) { -2204 param.param("maxlines", maxlines); -2205 } -2206 return new ApiCall(this).get(param, -2207 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); -2208 } -2209 -2210 -2211 /** -2212 * Get the execution output of the given job -2213 * -2214 * @param executionId identifier of the execution - mandatory -2215 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2216 * @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 -2217 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2218 * @return {@link RundeckOutput} -2219 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2220 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2221 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2222 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2223 * @deprecated renamed for clarity use {@link #getExecutionOutput(Long, int, long, int)}, will be removed in -2224 * version 12 of this library -2225 */ -2226 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, long lastmod, int maxlines) -2227 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2228 return getExecutionOutput(executionId, offset, lastmod, maxlines); -2229 } -2230 /** -2231 * Get the execution output of the given job -2232 * -2233 * @param executionId identifier of the execution - mandatory -2234 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2235 * @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 -2236 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2237 * @return {@link RundeckOutput} -2238 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2239 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2240 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2241 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2242 */ -2243 public RundeckOutput getExecutionOutput(Long executionId, int offset, long lastmod, int maxlines) -2244 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2245 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2246 ApiPathBuilder param = new ApiPathBuilder("/execution/", executionId.toString(), "/output") -2247 .param("offset", offset); -2248 if (lastmod >= 0) { -2249 param.param("lastmod", lastmod); -2250 } -2251 if (maxlines > 0) { -2252 param.param("maxlines", maxlines); -2253 } -2254 return new ApiCall(this).get(param, new OutputParser(rootXpath()+"/output", createOutputEntryParser())); -2255 } -2256 /** -2257 * Get the execution state output sequence of the given job -2258 * -2259 * @param executionId identifier of the execution - mandatory -2260 * @param stateOnly if true, include only state change output entries, otherwise include state and log entries -2261 * @param offset byte offset to read from in the file. 0 indicates the beginning. -2262 * @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 -2263 * @param maxlines maximum number of lines to retrieve forward from the specified offset. -2264 * @return {@link RundeckOutput} -2265 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) -2266 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2267 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2268 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) -2269 */ -2270 public RundeckOutput getExecutionOutputState(Long executionId, boolean stateOnly, int offset, long lastmod, -2271 int maxlines) -2272 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { -2273 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); -2274 ApiPathBuilder param = new ApiPathBuilder("/execution/", executionId.toString(), "/output/state") -2275 .param("offset", offset); -2276 if (lastmod >= 0) { -2277 param.param("lastmod", lastmod); -2278 } -2279 if (maxlines > 0) { -2280 param.param("maxlines", maxlines); -2281 } -2282 if(stateOnly) { -2283 param.param("stateOnly", true); -2284 } -2285 return new ApiCall(this).get(param, new OutputParser(rootXpath()+"/output", createOutputEntryParser())); -2286 } -2287 -2288 private OutputEntryParser createOutputEntryParser() { -2289 if (getApiVersion() <= Version.V5.versionNumber) { -2290 return new OutputEntryParserV5(); -2291 }else{ -2292 return new OutputEntryParser(); -2293 } -2294 } -2295 -2296 -2297 /* -2298 * System Info -2299 */ -2300 -2301 /** -2302 * Get system informations about the RunDeck server -2303 * -2304 * @return a {@link RundeckSystemInfo} instance - won't be null -2305 * @throws RundeckApiException in case of error when calling the API -2306 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) -2307 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) -2308 */ -2309 public RundeckSystemInfo getSystemInfo() throws RundeckApiException, RundeckApiLoginException, -2310 RundeckApiTokenException { -2311 return new ApiCall(this).get(new ApiPathBuilder("/system/info"), new SystemInfoParser(rootXpath()+"/system")); -2312 } -2313 -2314 -2315 /* -2316 * API token -2317 */ -2318 -2319 /** -2320 * List API tokens for a user. -2321 * @param user username -2322 * @return list of tokens -2323 * @throws RundeckApiException -2324 */ -2325 public List<RundeckToken> listApiTokens(final String user) throws RundeckApiException { -2326 AssertUtil.notNull(user, "user is mandatory to list API tokens for a user."); -2327 return new ApiCall(this). -2328 get(new ApiPathBuilder("/tokens/", user), -2329 new ListParser<RundeckToken>(new RundeckTokenParser(), "/tokens/token")); -2330 } -2331 -2332 /** -2333 * List all API tokens -2334 * @return list of tokens -2335 * @throws RundeckApiException -2336 */ -2337 public List<RundeckToken> listApiTokens() throws RundeckApiException { -2338 return new ApiCall(this). -2339 get(new ApiPathBuilder("/tokens"), -2340 new ListParser<RundeckToken>(new RundeckTokenParser(), "/tokens/token")); -2341 } -2342 -2343 /** -2344 * Generate an API token for a user. -2345 * @param user -2346 * @return -2347 * @throws RundeckApiException -2348 */ -2349 public String generateApiToken(final String user) throws RundeckApiException{ -2350 AssertUtil.notNull(user, "user is mandatory to generate an API token for a user."); -2351 RundeckToken result = new ApiCall(this). -2352 post(new ApiPathBuilder("/tokens/", user).emptyContent(), -2353 new RundeckTokenParser("/token")); -2354 return result.getToken(); -2355 } -2356 /** -2357 * Delete an existing token -2358 * @param token -2359 * @return -2360 * @throws RundeckApiException -2361 */ -2362 public boolean deleteApiToken(final String token) throws RundeckApiException{ -2363 AssertUtil.notNull(token, "token is mandatory to delete an API token."); -2364 new ApiCall(this).delete(new ApiPathBuilder("/token/", token)); -2365 return true; -2366 } -2367 /** -2368 * Return user info for an existing token -2369 * @param token -2370 * @return token info -2371 * @throws RundeckApiException -2372 */ -2373 public RundeckToken getApiToken(final String token) throws RundeckApiException{ -2374 AssertUtil.notNull(token, "token is mandatory to get an API token."); -2375 return new ApiCall(this).get(new ApiPathBuilder("/token/", token), new RundeckTokenParser("/token")); -2376 } -2377 -2378 /** -2379 * Store an key file -2380 * @param path ssh key storage path, must start with "keys/" -2381 * @param keyfile key file -2382 * @param privateKey true to store private key, false to store public key -2383 * @return the key resource -2384 * @throws RundeckApiException -2385 */ -2386 public KeyResource storeKey(final String path, final File keyfile, boolean privateKey) throws RundeckApiException{ -2387 AssertUtil.notNull(path, "path is mandatory to store an key."); -2388 AssertUtil.notNull(keyfile, "keyfile is mandatory to store an key."); -2389 if (!path.startsWith(STORAGE_KEYS_PATH)) { -2390 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); -2391 } -2392 return new ApiCall(this).post( -2393 new ApiPathBuilder(STORAGE_ROOT_PATH, path).content( -2394 privateKey ? "application/octet-stream" : "application/pgp-keys", -2395 keyfile -2396 ), -2397 new SSHKeyResourceParser("/resource") -2398 ); -2399 } -2400 -2401 /** -2402 * Get metadata for an key file -2403 * -2404 * @param path ssh key storage path, must start with "keys/" -2405 * -2406 * @return the ssh key resource -2407 * -2408 * @throws RundeckApiException if there is an error, or if the path is a directory not a file -2409 */ -2410 public KeyResource getKey(final String path) throws RundeckApiException { -2411 AssertUtil.notNull(path, "path is mandatory to get an key."); -2412 if (!path.startsWith(STORAGE_KEYS_PATH)) { -2413 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); -2414 } -2415 KeyResource storageResource = new ApiCall(this).get( -2416 new ApiPathBuilder(STORAGE_ROOT_PATH, path), -2417 new SSHKeyResourceParser("/resource") -2418 ); -2419 if (storageResource.isDirectory()) { -2420 throw new RundeckApiException("Key Path is a directory: " + path); -2421 } -2422 return storageResource; +2026 public List<RundeckNode> getNodes(String project, Properties nodeFilters) throws RundeckApiException, +2027 RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2028 AssertUtil.notBlank(project, "project is mandatory to get all nodes !"); +2029 return new ApiCall(this).get(new ApiPathBuilder("/resources").param("project", project) +2030 .nodeFilters(nodeFilters), +2031 new ListParser<RundeckNode>(new NodeParser(), "project/node")); +2032 } +2033 +2034 /** +2035 * Get the definition of a single node +2036 * +2037 * @param name of the node - mandatory +2038 * @param project name of the project - mandatory +2039 * @return a {@link RundeckNode} instance - won't be null +2040 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +2041 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2042 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2043 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +2044 */ +2045 public RundeckNode getNode(String name, String project) throws RundeckApiException, RundeckApiLoginException, +2046 RundeckApiTokenException, IllegalArgumentException { +2047 AssertUtil.notBlank(name, "the name of the node is mandatory to get a node !"); +2048 AssertUtil.notBlank(project, "project is mandatory to get a node !"); +2049 return new ApiCall(this).get(new ApiPathBuilder("/resource/", name).param("project", project), +2050 new NodeParser("project/node")); +2051 } +2052 +2053 /** +2054 * Get the output of a job execution +2055 * +2056 * @param executionId id of the execution - mandatory +2057 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +2058 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +2059 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2060 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2061 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +2062 */ +2063 public InputStream getOutput(String executionId) throws RundeckApiException, RundeckApiLoginException, +2064 RundeckApiTokenException, IllegalArgumentException { +2065 AssertUtil.notBlank(executionId, "the execution id is mandatory to get execution output !"); +2066 return new ApiCall(this).getNonApi(new ApiPathBuilder("/execution/downloadOutput/", executionId)); +2067 } +2068 +2069 /** +2070 * Get the html page of the user's profile +2071 * +2072 * @param username - mandatory +2073 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +2074 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +2075 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2076 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2077 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +2078 */ +2079 public InputStream getProfilePage(String username) throws RundeckApiException, RundeckApiLoginException, +2080 RundeckApiTokenException, IllegalArgumentException { +2081 AssertUtil.notBlank(username, "the username is mandatory to get profile page !"); +2082 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/profile?login=", username)); +2083 } +2084 +2085 +2086 /** +2087 * Generate a new token and get the result page (which is the html page of the user's profile) +2088 * +2089 * @param username - mandatory +2090 * @return an {@link InputStream} instance, not linked to any network resources - won't be null +2091 * @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name) +2092 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2093 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2094 * @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace) +2095 */ +2096 public InputStream generateToken(String username) throws RundeckApiException, RundeckApiLoginException, +2097 RundeckApiTokenException, IllegalArgumentException { +2098 AssertUtil.notBlank(username, "the username is mandatory to generate the token"); +2099 return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/generateApiToken?login=", username)); +2100 } +2101 +2102 +2103 /** +2104 * Get the execution output of the given job +2105 * +2106 * @param executionId identifier of the execution - mandatory +2107 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2108 * @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. +2109 * @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 +2110 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2111 * @return {@link RundeckOutput} +2112 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2113 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2114 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2115 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2116 * @deprecated renamed for clarity use {@link #getExecutionOutput(Long, int, int, long, int)}, will be removed in +2117 * version 12 of this library +2118 */ +2119 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, int lastlines, long lastmod, int maxlines) +2120 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2121 return getExecutionOutput(executionId, offset, lastlines, lastmod, maxlines); +2122 } +2123 /** +2124 * Get the execution output of the given job +2125 * +2126 * @param executionId identifier of the execution - mandatory +2127 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2128 * @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. +2129 * @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 +2130 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2131 * @return {@link RundeckOutput} +2132 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2133 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2134 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2135 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2136 */ +2137 public RundeckOutput getExecutionOutput(Long executionId, int offset, int lastlines, long lastmod, int maxlines) +2138 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2139 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +2140 ApiPathBuilder param = new ApiPathBuilder( +2141 "/execution/", executionId.toString(), +2142 "/output") +2143 .param("offset", offset); +2144 if (lastlines > 0) { +2145 param.param("lastlines", lastlines); +2146 } +2147 if (lastmod >= 0) { +2148 param.param("lastmod", lastmod); +2149 } +2150 if (maxlines > 0) { +2151 param.param("maxlines", maxlines); +2152 } +2153 return new ApiCall(this).get(param, +2154 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); +2155 } +2156 /** +2157 * Get the execution state of the given execution +2158 * +2159 * @param executionId identifier of the execution - mandatory +2160 * @return {@link RundeckExecutionState} the execution state +2161 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +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 jobId is blank (null, empty or whitespace) +2165 */ +2166 public RundeckExecutionState getExecutionState(Long executionId) +2167 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2168 AssertUtil.notNull(executionId, "executionId is mandatory to get the state of an execution!"); +2169 ApiPathBuilder param = new ApiPathBuilder( +2170 "/execution/", executionId.toString(), +2171 "/state"); +2172 +2173 return new ApiCall(this).get(param, new ExecutionStateParser(rootXpath()+"/executionState")); +2174 } +2175 +2176 /** +2177 * Get the execution output of the given execution on the specified node +2178 * +2179 * @param executionId identifier of the execution - mandatory +2180 * @param nodeName name of the node +2181 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2182 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will +2183 * override the offset value and return only the specified number of lines at the end of the +2184 * log. +2185 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the +2186 * specified date OR if more data is available at the given offset +2187 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2188 * +2189 * @return {@link RundeckOutput} +2190 * +2191 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +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 jobId is blank (null, empty or whitespace) +2195 */ +2196 public RundeckOutput getExecutionOutputForNode(Long executionId, String nodeName, int offset, int lastlines, +2197 long lastmod, int maxlines) +2198 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2199 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +2200 AssertUtil.notNull(nodeName, "nodeName is mandatory to get the output of a job execution!"); +2201 ApiPathBuilder param = new ApiPathBuilder( +2202 "/execution/", executionId.toString(), +2203 "/output/node/", nodeName) +2204 .param("offset", offset); +2205 if(lastlines>0) { +2206 param.param("lastlines", lastlines); +2207 } +2208 if(lastmod>=0) { +2209 param.param("lastmod", lastmod); +2210 } +2211 if(maxlines>0) { +2212 param.param("maxlines", maxlines); +2213 } +2214 return new ApiCall(this).get(param, +2215 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); +2216 } +2217 /** +2218 * Get the execution output of the given execution for the specified step +2219 * +2220 * @param executionId identifier of the execution - mandatory +2221 * @param stepCtx identifier for the step +2222 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2223 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will +2224 * override the offset value and return only the specified number of lines at the end of the +2225 * log. +2226 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the +2227 * specified date OR if more data is available at the given offset +2228 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2229 * +2230 * @return {@link RundeckOutput} +2231 * +2232 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2233 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2234 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2235 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2236 */ +2237 public RundeckOutput getExecutionOutputForStep(Long executionId, String stepCtx, int offset, int lastlines, +2238 long lastmod, int maxlines) +2239 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2240 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +2241 AssertUtil.notNull(stepCtx, "stepCtx is mandatory to get the output of a job execution!"); +2242 ApiPathBuilder param = new ApiPathBuilder( +2243 "/execution/", executionId.toString(), +2244 "/output/step/", stepCtx) +2245 .param("offset", offset); +2246 if (lastlines > 0) { +2247 param.param("lastlines", lastlines); +2248 } +2249 if (lastmod >= 0) { +2250 param.param("lastmod", lastmod); +2251 } +2252 if (maxlines > 0) { +2253 param.param("maxlines", maxlines); +2254 } +2255 return new ApiCall(this).get(param, +2256 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); +2257 } +2258 /** +2259 * Get the execution output of the given execution for the specified step +2260 * +2261 * @param executionId identifier of the execution - mandatory +2262 * @param stepCtx identifier for the step +2263 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2264 * @param lastlines nnumber of lines to retrieve from the end of the available output. If specified it will +2265 * override the offset value and return only the specified number of lines at the end of the +2266 * log. +2267 * @param lastmod epoch datestamp in milliseconds, return results only if modification changed since the +2268 * specified date OR if more data is available at the given offset +2269 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2270 * +2271 * @return {@link RundeckOutput} +2272 * +2273 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2274 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2275 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2276 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2277 */ +2278 public RundeckOutput getExecutionOutputForNodeAndStep(Long executionId, String nodeName, String stepCtx, +2279 int offset, int lastlines, +2280 long lastmod, int maxlines) +2281 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2282 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +2283 AssertUtil.notNull(nodeName, "nodeName is mandatory to get the output of a job execution!"); +2284 AssertUtil.notNull(stepCtx, "stepCtx is mandatory to get the output of a job execution!"); +2285 ApiPathBuilder param = new ApiPathBuilder( +2286 "/execution/", executionId.toString(), +2287 "/output/node/", nodeName, +2288 "/step/", stepCtx) +2289 .param("offset", offset); +2290 if (lastlines > 0) { +2291 param.param("lastlines", lastlines); +2292 } +2293 if (lastmod >= 0) { +2294 param.param("lastmod", lastmod); +2295 } +2296 if (maxlines > 0) { +2297 param.param("maxlines", maxlines); +2298 } +2299 return new ApiCall(this).get(param, +2300 new OutputParser(rootXpath()+"/output", createOutputEntryParser())); +2301 } +2302 +2303 +2304 /** +2305 * Get the execution output of the given job +2306 * +2307 * @param executionId identifier of the execution - mandatory +2308 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2309 * @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 +2310 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2311 * @return {@link RundeckOutput} +2312 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2313 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2314 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2315 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2316 * @deprecated renamed for clarity use {@link #getExecutionOutput(Long, int, long, int)}, will be removed in +2317 * version 12 of this library +2318 */ +2319 public RundeckOutput getJobExecutionOutput(Long executionId, int offset, long lastmod, int maxlines) +2320 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2321 return getExecutionOutput(executionId, offset, lastmod, maxlines); +2322 } +2323 /** +2324 * Get the execution output of the given job +2325 * +2326 * @param executionId identifier of the execution - mandatory +2327 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2328 * @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 +2329 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2330 * @return {@link RundeckOutput} +2331 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2332 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2333 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2334 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2335 */ +2336 public RundeckOutput getExecutionOutput(Long executionId, int offset, long lastmod, int maxlines) +2337 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2338 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +2339 ApiPathBuilder param = new ApiPathBuilder("/execution/", executionId.toString(), "/output") +2340 .param("offset", offset); +2341 if (lastmod >= 0) { +2342 param.param("lastmod", lastmod); +2343 } +2344 if (maxlines > 0) { +2345 param.param("maxlines", maxlines); +2346 } +2347 return new ApiCall(this).get(param, new OutputParser(rootXpath()+"/output", createOutputEntryParser())); +2348 } +2349 /** +2350 * Get the execution state output sequence of the given job +2351 * +2352 * @param executionId identifier of the execution - mandatory +2353 * @param stateOnly if true, include only state change output entries, otherwise include state and log entries +2354 * @param offset byte offset to read from in the file. 0 indicates the beginning. +2355 * @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 +2356 * @param maxlines maximum number of lines to retrieve forward from the specified offset. +2357 * @return {@link RundeckOutput} +2358 * @throws RundeckApiException in case of error when calling the API (non-existent job with this ID) +2359 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2360 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2361 * @throws IllegalArgumentException if the jobId is blank (null, empty or whitespace) +2362 */ +2363 public RundeckOutput getExecutionOutputState(Long executionId, boolean stateOnly, int offset, long lastmod, +2364 int maxlines) +2365 throws RundeckApiException, RundeckApiLoginException, RundeckApiTokenException, IllegalArgumentException { +2366 AssertUtil.notNull(executionId, "executionId is mandatory to get the output of a job execution!"); +2367 ApiPathBuilder param = new ApiPathBuilder("/execution/", executionId.toString(), "/output/state") +2368 .param("offset", offset); +2369 if (lastmod >= 0) { +2370 param.param("lastmod", lastmod); +2371 } +2372 if (maxlines > 0) { +2373 param.param("maxlines", maxlines); +2374 } +2375 if(stateOnly) { +2376 param.param("stateOnly", true); +2377 } +2378 return new ApiCall(this).get(param, new OutputParser(rootXpath()+"/output", createOutputEntryParser())); +2379 } +2380 +2381 private OutputEntryParser createOutputEntryParser() { +2382 if (getApiVersion() <= Version.V5.versionNumber) { +2383 return new OutputEntryParserV5(); +2384 }else{ +2385 return new OutputEntryParser(); +2386 } +2387 } +2388 +2389 +2390 /* +2391 * System Info +2392 */ +2393 +2394 /** +2395 * Get system informations about the RunDeck server +2396 * +2397 * @return a {@link RundeckSystemInfo} instance - won't be null +2398 * @throws RundeckApiException in case of error when calling the API +2399 * @throws RundeckApiLoginException if the login fails (in case of login-based authentication) +2400 * @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication) +2401 */ +2402 public RundeckSystemInfo getSystemInfo() throws RundeckApiException, RundeckApiLoginException, +2403 RundeckApiTokenException { +2404 return new ApiCall(this).get(new ApiPathBuilder("/system/info"), new SystemInfoParser(rootXpath()+"/system")); +2405 } +2406 +2407 +2408 /* +2409 * API token +2410 */ +2411 +2412 /** +2413 * List API tokens for a user. +2414 * @param user username +2415 * @return list of tokens +2416 * @throws RundeckApiException +2417 */ +2418 public List<RundeckToken> listApiTokens(final String user) throws RundeckApiException { +2419 AssertUtil.notNull(user, "user is mandatory to list API tokens for a user."); +2420 return new ApiCall(this). +2421 get(new ApiPathBuilder("/tokens/", user), +2422 new ListParser<RundeckToken>(new RundeckTokenParser(), "/tokens/token")); 2423 } 2424 2425 /** -2426 * Get content for a public key file -2427 * @param path ssh key storage path, must start with "keys/" -2428 * @param out outputstream to write data to -2429 * -2430 * @return length of written data -2431 * @throws RundeckApiException -2432 */ -2433 public int getPublicKeyContent(final String path, final OutputStream out) throws -2434 RundeckApiException, IOException { -2435 AssertUtil.notNull(path, "path is mandatory to get an key."); -2436 if (!path.startsWith(STORAGE_KEYS_PATH)) { -2437 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); -2438 } -2439 try { -2440 return new ApiCall(this).get( -2441 new ApiPathBuilder(STORAGE_ROOT_PATH, path) -2442 .accept("application/pgp-keys") -2443 .requireContentType("application/pgp-keys"), -2444 out -2445 ); -2446 } catch (RundeckApiException.RundeckApiHttpContentTypeException e) { -2447 throw new RundeckApiException("Requested Key path was not a Public key: " + path, e); -2448 } -2449 } -2450 -2451 /** -2452 * Get content for a public key file -2453 * @param path ssh key storage path, must start with "keys/" -2454 * @param out file to write data to -2455 * @return length of written data -2456 * @throws RundeckApiException -2457 */ -2458 public int getPublicKeyContent(final String path, final File out) throws -2459 RundeckApiException, IOException { -2460 final FileOutputStream fileOutputStream = new FileOutputStream(out); -2461 try { -2462 return getPublicKeyContent(path, fileOutputStream); -2463 }finally { -2464 fileOutputStream.close(); -2465 } -2466 } -2467 -2468 /** -2469 * List contents of root key directory -2470 * -2471 * @return list of key resources -2472 * @throws RundeckApiException -2473 */ -2474 public List<KeyResource> listKeyDirectoryRoot() throws RundeckApiException { -2475 return listKeyDirectory(STORAGE_KEYS_PATH); -2476 } -2477 /** -2478 * List contents of key directory -2479 * -2480 * @param path ssh key storage path, must start with "keys/" -2481 * -2482 * @throws RundeckApiException if there is an error, or if the path is a file not a directory -2483 */ -2484 public List<KeyResource> listKeyDirectory(final String path) throws RundeckApiException { -2485 AssertUtil.notNull(path, "path is mandatory to get an key."); -2486 if (!path.startsWith(STORAGE_KEYS_PATH)) { -2487 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); -2488 } -2489 KeyResource storageResource = new ApiCall(this).get( -2490 new ApiPathBuilder(STORAGE_ROOT_PATH, path), -2491 new SSHKeyResourceParser("/resource") -2492 ); -2493 if(!storageResource.isDirectory()) { -2494 throw new RundeckApiException("key path is not a directory path: " + path); -2495 } -2496 return storageResource.getDirectoryContents(); -2497 } -2498 -2499 /** -2500 * Delete an key file -2501 * @param path a path to a key file, must start with "keys/" +2426 * List all API tokens +2427 * @return list of tokens +2428 * @throws RundeckApiException +2429 */ +2430 public List<RundeckToken> listApiTokens() throws RundeckApiException { +2431 return new ApiCall(this). +2432 get(new ApiPathBuilder("/tokens"), +2433 new ListParser<RundeckToken>(new RundeckTokenParser(), "/tokens/token")); +2434 } +2435 +2436 /** +2437 * Generate an API token for a user. +2438 * @param user +2439 * @return +2440 * @throws RundeckApiException +2441 */ +2442 public String generateApiToken(final String user) throws RundeckApiException{ +2443 AssertUtil.notNull(user, "user is mandatory to generate an API token for a user."); +2444 RundeckToken result = new ApiCall(this). +2445 post(new ApiPathBuilder("/tokens/", user).emptyContent(), +2446 new RundeckTokenParser("/token")); +2447 return result.getToken(); +2448 } +2449 /** +2450 * Delete an existing token +2451 * @param token +2452 * @return +2453 * @throws RundeckApiException +2454 */ +2455 public boolean deleteApiToken(final String token) throws RundeckApiException{ +2456 AssertUtil.notNull(token, "token is mandatory to delete an API token."); +2457 new ApiCall(this).delete(new ApiPathBuilder("/token/", token)); +2458 return true; +2459 } +2460 /** +2461 * Return user info for an existing token +2462 * @param token +2463 * @return token info +2464 * @throws RundeckApiException +2465 */ +2466 public RundeckToken getApiToken(final String token) throws RundeckApiException{ +2467 AssertUtil.notNull(token, "token is mandatory to get an API token."); +2468 return new ApiCall(this).get(new ApiPathBuilder("/token/", token), new RundeckTokenParser("/token")); +2469 } +2470 +2471 /** +2472 * Store an key file +2473 * @param path ssh key storage path, must start with "keys/" +2474 * @param keyfile key file +2475 * @param privateKey true to store private key, false to store public key +2476 * @return the key resource +2477 * @throws RundeckApiException +2478 */ +2479 public KeyResource storeKey(final String path, final File keyfile, boolean privateKey) throws RundeckApiException{ +2480 AssertUtil.notNull(path, "path is mandatory to store an key."); +2481 AssertUtil.notNull(keyfile, "keyfile is mandatory to store an key."); +2482 if (!path.startsWith(STORAGE_KEYS_PATH)) { +2483 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); +2484 } +2485 return new ApiCall(this).post( +2486 new ApiPathBuilder(STORAGE_ROOT_PATH, path).content( +2487 privateKey ? "application/octet-stream" : "application/pgp-keys", +2488 keyfile +2489 ), +2490 new SSHKeyResourceParser("/resource") +2491 ); +2492 } +2493 +2494 /** +2495 * Get metadata for an key file +2496 * +2497 * @param path ssh key storage path, must start with "keys/" +2498 * +2499 * @return the ssh key resource +2500 * +2501 * @throws RundeckApiException if there is an error, or if the path is a directory not a file 2502 */ -2503 public void deleteKey(final String path){ -2504 AssertUtil.notNull(path, "path is mandatory to delete an key."); +2503 public KeyResource getKey(final String path) throws RundeckApiException { +2504 AssertUtil.notNull(path, "path is mandatory to get an key."); 2505 if (!path.startsWith(STORAGE_KEYS_PATH)) { 2506 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); 2507 } -2508 new ApiCall(this).delete(new ApiPathBuilder(STORAGE_ROOT_PATH, path)); -2509 } -2510 -2511 /** -2512 * @return the URL of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) -2513 */ -2514 public String getUrl() { -2515 return url; +2508 KeyResource storageResource = new ApiCall(this).get( +2509 new ApiPathBuilder(STORAGE_ROOT_PATH, path), +2510 new SSHKeyResourceParser("/resource") +2511 ); +2512 if (storageResource.isDirectory()) { +2513 throw new RundeckApiException("Key Path is a directory: " + path); +2514 } +2515 return storageResource; 2516 } 2517 2518 /** -2519 * @return the auth-token used for authentication on the RunDeck instance (null if using login-based or session-based auth) -2520 */ -2521 public String getToken() { -2522 return token; -2523 } -2524 -2525 /** -2526 * @return the login used for authentication on the RunDeck instance (null if using token-based or session-based auth) -2527 */ -2528 public String getLogin() { -2529 return login; -2530 } -2531 -2532 /** -2533 * @return the password used for authentication on the RunDeck instance (null if using token-based or session-based auth) -2534 */ -2535 public String getPassword() { -2536 return password; -2537 } -2538 -2539 /** -2540 * @return the sessionID used for authentication on the RunDeck instance (null if using login-based or token-based auth) -2541 */ -2542 public String getSessionID() { -2543 return sessionID; -2544 } -2545 -2546 @Override -2547 public String toString() { -2548 StringBuilder str = new StringBuilder(); -2549 str.append("RundeckClient ").append(API_VERSION); -2550 str.append(" [").append(url).append("] "); -2551 if (token != null) { -2552 str.append("(token=").append(token).append(")"); -2553 } else { -2554 str.append("(credentials=").append(login).append("|").append(password).append(")"); -2555 } -2556 return str.toString(); -2557 } -2558 -2559 @Override -2560 public int hashCode() { -2561 final int prime = 31; -2562 int result = 1; -2563 result = prime * result + ((login == null) ? 0 : login.hashCode()); -2564 result = prime * result + ((password == null) ? 0 : password.hashCode()); -2565 result = prime * result + ((token == null) ? 0 : token.hashCode()); -2566 result = prime * result + ((url == null) ? 0 : url.hashCode()); -2567 return result; -2568 } -2569 -2570 @Override -2571 public boolean equals(Object obj) { -2572 if (this == obj) -2573 return true; -2574 if (obj == null) -2575 return false; -2576 if (getClass() != obj.getClass()) -2577 return false; -2578 RundeckClient other = (RundeckClient) obj; -2579 if (login == null) { -2580 if (other.login != null) -2581 return false; -2582 } else if (!login.equals(other.login)) -2583 return false; -2584 if (password == null) { -2585 if (other.password != null) -2586 return false; -2587 } else if (!password.equals(other.password)) -2588 return false; -2589 if (token == null) { -2590 if (other.token != null) -2591 return false; -2592 } else if (!token.equals(other.token)) -2593 return false; -2594 if (url == null) { -2595 if (other.url != null) -2596 return false; -2597 } else if (!url.equals(other.url)) -2598 return false; -2599 return true; -2600 } -2601 -2602 } +2519 * Get content for a public key file +2520 * @param path ssh key storage path, must start with "keys/" +2521 * @param out outputstream to write data to +2522 * +2523 * @return length of written data +2524 * @throws RundeckApiException +2525 */ +2526 public int getPublicKeyContent(final String path, final OutputStream out) throws +2527 RundeckApiException, IOException { +2528 AssertUtil.notNull(path, "path is mandatory to get an key."); +2529 if (!path.startsWith(STORAGE_KEYS_PATH)) { +2530 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); +2531 } +2532 try { +2533 return new ApiCall(this).get( +2534 new ApiPathBuilder(STORAGE_ROOT_PATH, path) +2535 .accept("application/pgp-keys") +2536 .requireContentType("application/pgp-keys"), +2537 out +2538 ); +2539 } catch (RundeckApiException.RundeckApiHttpContentTypeException e) { +2540 throw new RundeckApiException("Requested Key path was not a Public key: " + path, e); +2541 } +2542 } +2543 +2544 /** +2545 * Get content for a public key file +2546 * @param path ssh key storage path, must start with "keys/" +2547 * @param out file to write data to +2548 * @return length of written data +2549 * @throws RundeckApiException +2550 */ +2551 public int getPublicKeyContent(final String path, final File out) throws +2552 RundeckApiException, IOException { +2553 final FileOutputStream fileOutputStream = new FileOutputStream(out); +2554 try { +2555 return getPublicKeyContent(path, fileOutputStream); +2556 }finally { +2557 fileOutputStream.close(); +2558 } +2559 } +2560 +2561 /** +2562 * List contents of root key directory +2563 * +2564 * @return list of key resources +2565 * @throws RundeckApiException +2566 */ +2567 public List<KeyResource> listKeyDirectoryRoot() throws RundeckApiException { +2568 return listKeyDirectory(STORAGE_KEYS_PATH); +2569 } +2570 /** +2571 * List contents of key directory +2572 * +2573 * @param path ssh key storage path, must start with "keys/" +2574 * +2575 * @throws RundeckApiException if there is an error, or if the path is a file not a directory +2576 */ +2577 public List<KeyResource> listKeyDirectory(final String path) throws RundeckApiException { +2578 AssertUtil.notNull(path, "path is mandatory to get an key."); +2579 if (!path.startsWith(STORAGE_KEYS_PATH)) { +2580 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); +2581 } +2582 KeyResource storageResource = new ApiCall(this).get( +2583 new ApiPathBuilder(STORAGE_ROOT_PATH, path), +2584 new SSHKeyResourceParser("/resource") +2585 ); +2586 if(!storageResource.isDirectory()) { +2587 throw new RundeckApiException("key path is not a directory path: " + path); +2588 } +2589 return storageResource.getDirectoryContents(); +2590 } +2591 +2592 /** +2593 * Delete an key file +2594 * @param path a path to a key file, must start with "keys/" +2595 */ +2596 public void deleteKey(final String path){ +2597 AssertUtil.notNull(path, "path is mandatory to delete an key."); +2598 if (!path.startsWith(STORAGE_KEYS_PATH)) { +2599 throw new IllegalArgumentException("key storage path must start with: " + STORAGE_KEYS_PATH); +2600 } +2601 new ApiCall(this).delete(new ApiPathBuilder(STORAGE_ROOT_PATH, path)); +2602 } +2603 +2604 /** +2605 * @return the URL of the RunDeck instance ("http://localhost:4440", "http://rundeck.your-compagny.com/", etc) +2606 */ +2607 public String getUrl() { +2608 return url; +2609 } +2610 +2611 /** +2612 * @return the auth-token used for authentication on the RunDeck instance (null if using login-based or session-based auth) +2613 */ +2614 public String getToken() { +2615 return token; +2616 } +2617 +2618 /** +2619 * @return the login used for authentication on the RunDeck instance (null if using token-based or session-based auth) +2620 */ +2621 public String getLogin() { +2622 return login; +2623 } +2624 +2625 /** +2626 * @return the password used for authentication on the RunDeck instance (null if using token-based or session-based auth) +2627 */ +2628 public String getPassword() { +2629 return password; +2630 } +2631 +2632 /** +2633 * @return the sessionID used for authentication on the RunDeck instance (null if using login-based or token-based auth) +2634 */ +2635 public String getSessionID() { +2636 return sessionID; +2637 } +2638 +2639 @Override +2640 public String toString() { +2641 StringBuilder str = new StringBuilder(); +2642 str.append("RundeckClient ").append(API_VERSION); +2643 str.append(" [").append(url).append("] "); +2644 if (token != null) { +2645 str.append("(token=").append(token).append(")"); +2646 } else { +2647 str.append("(credentials=").append(login).append("|").append(password).append(")"); +2648 } +2649 return str.toString(); +2650 } +2651 +2652 @Override +2653 public int hashCode() { +2654 final int prime = 31; +2655 int result = 1; +2656 result = prime * result + ((login == null) ? 0 : login.hashCode()); +2657 result = prime * result + ((password == null) ? 0 : password.hashCode()); +2658 result = prime * result + ((token == null) ? 0 : token.hashCode()); +2659 result = prime * result + ((url == null) ? 0 : url.hashCode()); +2660 return result; +2661 } +2662 +2663 @Override +2664 public boolean equals(Object obj) { +2665 if (this == obj) +2666 return true; +2667 if (obj == null) +2668 return false; +2669 if (getClass() != obj.getClass()) +2670 return false; +2671 RundeckClient other = (RundeckClient) obj; +2672 if (login == null) { +2673 if (other.login != null) +2674 return false; +2675 } else if (!login.equals(other.login)) +2676 return false; +2677 if (password == null) { +2678 if (other.password != null) +2679 return false; +2680 } else if (!password.equals(other.password)) +2681 return false; +2682 if (token == null) { +2683 if (other.token != null) +2684 return false; +2685 } else if (!token.equals(other.token)) +2686 return false; +2687 if (url == null) { +2688 if (other.url != null) +2689 return false; +2690 } else if (!url.equals(other.url)) +2691 return false; +2692 return true; +2693 } +2694 +2695 }
      diff --git a/xref/org/rundeck/api/domain/DeleteExecutionsResponse.html b/xref/org/rundeck/api/domain/DeleteExecutionsResponse.html new file mode 100644 index 0000000..c1015b9 --- /dev/null +++ b/xref/org/rundeck/api/domain/DeleteExecutionsResponse.html @@ -0,0 +1,98 @@ + + + + +DeleteExecutionsResponse xref + + + +
      +
      +1   package org.rundeck.api.domain;
      +2   
      +3   import java.io.Serializable;
      +4   import java.util.List;
      +5   
      +6   /**
      +7    * DeleteExecutionsResponse is ...
      +8    *
      +9    * @author Greg Schueler <greg@simplifyops.com>
      +10   * @since 2014-11-06
      +11   */
      +12  public class DeleteExecutionsResponse implements Serializable {
      +13  
      +14      private static final long serialVersionUID = 1L;
      +15  
      +16      private int                 failedCount;
      +17      private int                 successCount;
      +18      private boolean             allsuccessful;
      +19      private int                 requestCount;
      +20      private List<DeleteFailure> failures;
      +21  
      +22      public int getFailedCount() {
      +23          return failedCount;
      +24      }
      +25  
      +26      public void setFailedCount(final int failedCount) {
      +27          this.failedCount = failedCount;
      +28      }
      +29  
      +30      public int getSuccessCount() {
      +31          return successCount;
      +32      }
      +33  
      +34      public void setSuccessCount(final int successCount) {
      +35          this.successCount = successCount;
      +36      }
      +37  
      +38      public boolean isAllsuccessful() {
      +39          return allsuccessful;
      +40      }
      +41  
      +42      public void setAllsuccessful(final boolean allsuccessful) {
      +43          this.allsuccessful = allsuccessful;
      +44      }
      +45  
      +46      public int getRequestCount() {
      +47          return requestCount;
      +48      }
      +49  
      +50      public void setRequestCount(final int requestCount) {
      +51          this.requestCount = requestCount;
      +52      }
      +53  
      +54      public List<DeleteFailure> getFailures() {
      +55          return failures;
      +56      }
      +57  
      +58      public void setFailures(final List<DeleteFailure> failures) {
      +59          this.failures = failures;
      +60      }
      +61  
      +62      public static class DeleteFailure implements Serializable{
      +63  
      +64          private static final long serialVersionUID = 1L;
      +65          private Long executionId;
      +66          private String message;
      +67  
      +68          public Long getExecutionId() {
      +69              return executionId;
      +70          }
      +71  
      +72          public void setExecutionId(final Long executionId) {
      +73              this.executionId = executionId;
      +74          }
      +75  
      +76          public String getMessage() {
      +77              return message;
      +78          }
      +79  
      +80          public void setMessage(final String message) {
      +81              this.message = message;
      +82          }
      +83      }
      +84  }
      +
      +
      + + diff --git a/xref/org/rundeck/api/domain/package-frame.html b/xref/org/rundeck/api/domain/package-frame.html index 44bf75b..13c6d59 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 11.1 Reference Package org.rundeck.api.domain + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.domain @@ -32,6 +32,12 @@
    • ConfigProperty +
    • +
    • + DeleteExecutionsResponse +
    • +
    • + DeleteFailure
    • EventStatus diff --git a/xref/org/rundeck/api/domain/package-summary.html b/xref/org/rundeck/api/domain/package-summary.html index 023fe39..bcf7448 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 11.1 Reference Package org.rundeck.api.domain + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.domain @@ -64,6 +64,16 @@
    + + + + + + + + + + + + @@ -59,6 +64,11 @@ + + + + + +
    ConfigProperty
    + DeleteExecutionsResponse +
    + DeleteFailure +
    diff --git a/xref/org/rundeck/api/generator/DeleteExecutionsGenerator.html b/xref/org/rundeck/api/generator/DeleteExecutionsGenerator.html new file mode 100644 index 0000000..3c97419 --- /dev/null +++ b/xref/org/rundeck/api/generator/DeleteExecutionsGenerator.html @@ -0,0 +1,52 @@ + + + + +DeleteExecutionsGenerator xref + + + +
    +
    +1   package org.rundeck.api.generator;
    +2   
    +3   import org.dom4j.DocumentFactory;
    +4   import org.dom4j.Element;
    +5   import org.rundeck.api.domain.ProjectConfig;
    +6   
    +7   import java.util.List;
    +8   import java.util.Set;
    +9   
    +10  /**
    +11   * DeleteExecutionsGenerator is ...
    +12   *
    +13   * @author Greg Schueler <greg@simplifyops.com>
    +14   * @since 2014-11-06
    +15   */
    +16  public class DeleteExecutionsGenerator extends BaseDocGenerator {
    +17      private Set<Long> executionIds;
    +18  
    +19      public DeleteExecutionsGenerator(final Set<Long> executionIds) {
    +20          this.executionIds = executionIds;
    +21      }
    +22  
    +23      @Override public Element generateXmlElement() {
    +24          Element rootElem = DocumentFactory.getInstance().createElement("executions");
    +25          for (Long executionId : executionIds) {
    +26              rootElem.addElement("execution").addAttribute("id", Long.toString(executionId));
    +27          }
    +28          return rootElem;
    +29      }
    +30  
    +31      public Set<Long> getExecutionIds() {
    +32          return executionIds;
    +33      }
    +34  
    +35      public void setExecutionIds(final Set<Long> executionIds) {
    +36          this.executionIds = executionIds;
    +37      }
    +38  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/generator/package-frame.html b/xref/org/rundeck/api/generator/package-frame.html index b994b1b..ab825d0 100644 --- a/xref/org/rundeck/api/generator/package-frame.html +++ b/xref/org/rundeck/api/generator/package-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference Package org.rundeck.api.generator + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.generator @@ -17,6 +17,9 @@
    • BaseDocGenerator +
    • +
    • + DeleteExecutionsGenerator
    • ProjectConfigGenerator diff --git a/xref/org/rundeck/api/generator/package-summary.html b/xref/org/rundeck/api/generator/package-summary.html index 0ae56a1..3b2a487 100644 --- a/xref/org/rundeck/api/generator/package-summary.html +++ b/xref/org/rundeck/api/generator/package-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference Package org.rundeck.api.generator + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.generator @@ -39,6 +39,11 @@
    BaseDocGenerator
    + DeleteExecutionsGenerator +
    diff --git a/xref/org/rundeck/api/package-frame.html b/xref/org/rundeck/api/package-frame.html index fd52a18..bdc6db4 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 11.1 Reference Package org.rundeck.api + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api diff --git a/xref/org/rundeck/api/package-summary.html b/xref/org/rundeck/api/package-summary.html index f22459a..d42bd89 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 11.1 Reference Package org.rundeck.api + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api diff --git a/xref/org/rundeck/api/parser/APIV11Helper.html b/xref/org/rundeck/api/parser/APIV11Helper.html new file mode 100644 index 0000000..28c62d8 --- /dev/null +++ b/xref/org/rundeck/api/parser/APIV11Helper.html @@ -0,0 +1,92 @@ + + + + +APIV11Helper xref + + + +
    +
    +1   package org.rundeck.api.parser;
    +2   
    +3   import org.dom4j.DocumentHelper;
    +4   import org.dom4j.Element;
    +5   import org.dom4j.Node;
    +6   
    +7   /**
    +8    * Utility to handle API v11 responses with &lt;result&gt; wrapper element.
    +9    *
    +10   * @author Greg Schueler <greg@simplifyops.com>
    +11   * @since 2014-11-10
    +12   */
    +13  public class APIV11Helper {
    +14  
    +15      /**
    +16       * Detect and remove extra &lt;result&gt; wrapper around xml response.
    +17       * @param parser
    +18       * @param xpath
    +19       * @param <T>
    +20       * @return
    +21       */
    +22      public static <T> XmlNodeParser<T> unwrapIfNeeded(
    +23              final XmlNodeParser<T> parser,
    +24              final String xpath
    +25      ) {
    +26          return new NodeParser_unwrap<T>(parser, xpath);
    +27      }
    +28  
    +29      static class NodeParser_unwrap<T> implements XmlNodeParser<T> {
    +30          XmlNodeParser<T> parser;
    +31          String           xpath;
    +32  
    +33          public NodeParser_unwrap(final XmlNodeParser<T> parser, final String xpath) {
    +34              this.parser = parser;
    +35              this.xpath = xpath;
    +36          }
    +37  
    +38          @Override public T parseXmlNode(final Node node) {
    +39  
    +40              Node sourceNode = unwrapResultElement(node, xpath);
    +41              return parser.parseXmlNode(sourceNode);
    +42          }
    +43      }
    +44  
    +45      /**
    +46       * Test the node for matching the xpath string, if it doesnt match, attempt to prefix it with
    +47       * "result" and match that. If that matches, return the first child of the 'result' element.
    +48       *
    +49       * @param node
    +50       * @param xpath
    +51       *
    +52       * @return
    +53       */
    +54      public static Node unwrapResultElement(final Node node, final String xpath) {
    +55          Node sourceNode = node;
    +56          final Node tested = sourceNode.selectSingleNode(xpath);
    +57          if (null == tested && !xpath.startsWith("result")) {
    +58              //prepend /result
    +59              if (null != sourceNode.selectSingleNode("result" + xpath)) {
    +60                  Node resultNode = sourceNode.selectSingleNode("result");
    +61                  if (resultNode instanceof Element) {
    +62                      Element result = (Element) resultNode;
    +63                      if (result.elements().size() == 1) {
    +64  
    +65                          Node node1 = (Node) result.elements().get(0);
    +66                          if (node1 instanceof Element) {
    +67                              sourceNode = node1;
    +68  
    +69                              sourceNode.getParent().remove(sourceNode);
    +70                              DocumentHelper.createDocument((Element) sourceNode);
    +71                          }
    +72                      }
    +73                  }
    +74              }
    +75          }
    +76          return sourceNode;
    +77      }
    +78  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/parser/DeleteExecutionsResponseParser.html b/xref/org/rundeck/api/parser/DeleteExecutionsResponseParser.html new file mode 100644 index 0000000..38d789b --- /dev/null +++ b/xref/org/rundeck/api/parser/DeleteExecutionsResponseParser.html @@ -0,0 +1,66 @@ + + + + +DeleteExecutionsResponseParser xref + + + +
    +
    +1   package org.rundeck.api.parser;
    +2   
    +3   import org.dom4j.Node;
    +4   import org.rundeck.api.domain.DeleteExecutionsResponse;
    +5   
    +6   import java.util.ArrayList;
    +7   import java.util.List;
    +8   
    +9   /**
    +10   * DeleteExecutionsResponseParser is ...
    +11   *
    +12   * @author Greg Schueler <greg@simplifyops.com>
    +13   * @since 2014-11-06
    +14   */
    +15  public class DeleteExecutionsResponseParser implements XmlNodeParser<DeleteExecutionsResponse> {
    +16      private String xpath;
    +17  
    +18      public DeleteExecutionsResponseParser(final String xpath) {
    +19          this.xpath = xpath;
    +20      }
    +21  
    +22      @Override public DeleteExecutionsResponse parseXmlNode(final Node node) {
    +23          final Node baseNode = xpath != null ? node.selectSingleNode(xpath) : node;
    +24  
    +25          final DeleteExecutionsResponse response = new DeleteExecutionsResponse();
    +26          response.setAllsuccessful(Boolean.parseBoolean(baseNode.valueOf("@allsuccessful")));
    +27          response.setRequestCount(Integer.parseInt(baseNode.valueOf("@requestCount")));
    +28          response.setSuccessCount(Integer.parseInt(baseNode.valueOf("successful/@count")));
    +29  
    +30          final Node failedNode = baseNode.selectSingleNode("failed");
    +31          //parse failures
    +32          final List<DeleteExecutionsResponse.DeleteFailure> failures = new ArrayList
    +33                  <DeleteExecutionsResponse.DeleteFailure>();
    +34          int failedCount = 0;
    +35          if (null != failedNode) {
    +36              failedCount = Integer.parseInt(baseNode.valueOf("failed/@count"));
    +37              final List list = baseNode.selectNodes("failed/execution");
    +38  
    +39              for (final Object o : list) {
    +40                  final Node execNode = (Node) o;
    +41                  final DeleteExecutionsResponse.DeleteFailure deleteFailure =
    +42                          new DeleteExecutionsResponse.DeleteFailure();
    +43                  deleteFailure.setExecutionId(Long.parseLong(execNode.valueOf("@id")));
    +44                  deleteFailure.setMessage(execNode.valueOf("@message"));
    +45                  failures.add(deleteFailure);
    +46              }
    +47          }
    +48          response.setFailedCount(failedCount);
    +49          response.setFailures(failures);
    +50          return response;
    +51      }
    +52  }
    +
    +
    + + diff --git a/xref/org/rundeck/api/parser/PagedResultParser.html b/xref/org/rundeck/api/parser/PagedResultParser.html index 84c0db1..e684ffb 100644 --- a/xref/org/rundeck/api/parser/PagedResultParser.html +++ b/xref/org/rundeck/api/parser/PagedResultParser.html @@ -36,94 +36,101 @@ 26 27 import org.dom4j.Element; 28 import org.dom4j.Node; -29 import org.rundeck.api.util.PagedResults; -30 -31 import java.util.*; -32 +29 import org.rundeck.api.RundeckApiException; +30 import org.rundeck.api.util.PagedResults; +31 +32 import java.util.*; 33 -34 /** -35 * PagedResultParser extracts paging data from an xpath node, and includes the List result from a ListParser -36 * -37 * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a> -38 */ -39 public class PagedResultParser<T> implements XmlNodeParser<PagedResults<T>> { -40 ListParser<T> itemParser; -41 String xpath; -42 -43 /** -44 * Create a PagedResultParser -45 * -46 * @param itemParser the list parser -47 * @param xpath xpath for list container containing paging attributes -48 */ -49 public PagedResultParser(ListParser<T> itemParser, String xpath) { -50 this.itemParser = itemParser; -51 this.xpath = xpath; -52 } -53 -54 @Override -55 public PagedResults<T> parseXmlNode(Node node) { -56 Node pagedNodeContainer = node.selectSingleNode(xpath); -57 -58 Element el = (Element) pagedNodeContainer; -59 final int max = integerAttribute(el, "max", -1); -60 final int offset = integerAttribute(el, "offset", -1); -61 final int total = integerAttribute(el, "total", -1); -62 final int count = integerAttribute(el, "count", -1); -63 -64 final List<T> ts = itemParser.parseXmlNode(pagedNodeContainer); -65 +34 +35 /** +36 * PagedResultParser extracts paging data from an xpath node, and includes the List result from a ListParser +37 * +38 * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a> +39 */ +40 public class PagedResultParser<T> implements XmlNodeParser<PagedResults<T>> { +41 ListParser<T> itemParser; +42 private String xpath; +43 +44 /** +45 * Create a PagedResultParser +46 * +47 * @param itemParser the list parser +48 * @param xpath xpath for list container containing paging attributes +49 */ +50 public PagedResultParser(ListParser<T> itemParser, String xpath) { +51 this.itemParser = itemParser; +52 this.xpath = xpath; +53 } +54 +55 @Override +56 public PagedResults<T> parseXmlNode(Node node) { +57 Node pagedNodeContainer = node.selectSingleNode(xpath); +58 if(null==pagedNodeContainer) { +59 throw new RundeckApiException("XML content did not match XPATH expression: " + xpath); +60 } +61 Element el = (Element) pagedNodeContainer; +62 final int max = integerAttribute(el, "max", -1); +63 final int offset = integerAttribute(el, "offset", -1); +64 final int total = integerAttribute(el, "total", -1); +65 final int count = integerAttribute(el, "count", -1); 66 -67 return new PagedResults<T>() { -68 @Override -69 public int getMax() { -70 return max; -71 } -72 -73 @Override -74 public int getOffset() { -75 return offset; -76 } -77 -78 @Override -79 public int getTotal() { -80 return total; -81 } -82 -83 @Override -84 public List<T> getResults() { -85 return ts; -86 } -87 -88 @Override -89 public int getCount() { -90 return count; -91 } -92 -93 @Override -94 public Iterator<T> iterator() { -95 return ts.iterator(); -96 } -97 }; -98 } -99 -100 /** -101 * Return an integer value of an attribute of an element, or a default value if it is not found or not an integer. -102 * -103 * @param el the element -104 * @param attribute attribute name -105 * @param defValue default value to return -106 */ -107 private int integerAttribute(Element el, final String attribute, final int defValue) { -108 int parseMax = defValue; -109 try { -110 final String max1 = null != el.attribute(attribute) ? el.attribute(attribute).getStringValue() : null; -111 parseMax = null != max1 ? Integer.parseInt(max1) : defValue; -112 } catch (NumberFormatException e) { -113 } -114 return parseMax; -115 } -116 } +67 final List<T> ts = itemParser.parseXmlNode(pagedNodeContainer); +68 +69 +70 return new PagedResults<T>() { +71 @Override +72 public int getMax() { +73 return max; +74 } +75 +76 @Override +77 public int getOffset() { +78 return offset; +79 } +80 +81 @Override +82 public int getTotal() { +83 return total; +84 } +85 +86 @Override +87 public List<T> getResults() { +88 return ts; +89 } +90 +91 @Override +92 public int getCount() { +93 return count; +94 } +95 +96 @Override +97 public Iterator<T> iterator() { +98 return ts.iterator(); +99 } +100 }; +101 } +102 +103 /** +104 * Return an integer value of an attribute of an element, or a default value if it is not found or not an integer. +105 * +106 * @param el the element +107 * @param attribute attribute name +108 * @param defValue default value to return +109 */ +110 private int integerAttribute(Element el, final String attribute, final int defValue) { +111 int parseMax = defValue; +112 try { +113 final String max1 = null != el.attribute(attribute) ? el.attribute(attribute).getStringValue() : null; +114 parseMax = null != max1 ? Integer.parseInt(max1) : defValue; +115 } catch (NumberFormatException e) { +116 } +117 return parseMax; +118 } +119 +120 public String getXpath() { +121 return xpath; +122 } +123 }
    diff --git a/xref/org/rundeck/api/parser/package-frame.html b/xref/org/rundeck/api/parser/package-frame.html index 60c52ef..147a96d 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 11.1 Reference Package org.rundeck.api.parser + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.parser @@ -16,6 +16,9 @@
    + APIV11Helper +
    AbortParser BulkDeleteParser
    + DeleteExecutionsResponseParser +
    @@ -109,6 +119,11 @@ NodeParser
    + NodeParser_unwrap +
    diff --git a/xref/org/rundeck/api/query/package-frame.html b/xref/org/rundeck/api/query/package-frame.html index 481f2b9..c24741b 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 11.1 Reference Package org.rundeck.api.query + RunDeck API - Java Client 12.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 fc0f5f9..1386e34 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 11.1 Reference Package org.rundeck.api.query + RunDeck API - Java Client 12.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 a9d3919..3f565bc 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 11.1 Reference Package org.rundeck.api.util + RunDeck API - Java Client 12.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 81c4c13..d094cb0 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 11.1 Reference Package org.rundeck.api.util + RunDeck API - Java Client 12.0 Reference Package org.rundeck.api.util diff --git a/xref/overview-frame.html b/xref/overview-frame.html index b07b779..e75e10c 100644 --- a/xref/overview-frame.html +++ b/xref/overview-frame.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference + RunDeck API - Java Client 12.0 Reference diff --git a/xref/overview-summary.html b/xref/overview-summary.html index 3a624bd..c4c56d9 100644 --- a/xref/overview-summary.html +++ b/xref/overview-summary.html @@ -3,7 +3,7 @@ - RunDeck API - Java Client 11.1 Reference + RunDeck API - Java Client 12.0 Reference @@ -24,7 +24,7 @@ -

    RunDeck API - Java Client 11.1 Reference

    +

    RunDeck API - Java Client 12.0 Reference