public class RundeckAPICentralDispatcher extends java.lang.Object implements CentralDispatcher
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
logger
logger
|
static java.lang.String |
RUNDECK_API_BASE
RUNDECK API base path
|
static java.lang.String |
RUNDECK_API_BASE_v11 |
static java.lang.String |
RUNDECK_API_BASE_v4
RUNDECK API Base for v4
|
static java.lang.String |
RUNDECK_API_BASE_v5
RUNDECK API Base for v5
|
static java.lang.String |
RUNDECK_API_BASE_v8
RUNDECK API Base for v8
|
static java.lang.String |
RUNDECK_API_BASE_v9
RUNDECK API Base for v8
|
static java.lang.String |
RUNDECK_API_EXEC_OUTPUT_PATH
Webservice endpoint for execution output
|
static java.lang.String |
RUNDECK_API_EXECUTION_PATH
Webservice endpoint for getting execution information
|
static java.lang.String |
RUNDECK_API_EXECUTION_REPORT
API endpoint for execution report
|
static java.lang.String |
RUNDECK_API_JOBS_BULK_DELETE_PATH
Webservice endpoint for exporting stored jobs.
|
static java.lang.String |
RUNDECK_API_JOBS_EXPORT_PATH
Webservice endpoint for exporting stored jobs.
|
static java.lang.String |
RUNDECK_API_JOBS_LIST_PATH
Webservice endpoint for listing stored jobs.
|
static java.lang.String |
RUNDECK_API_JOBS_RUN
Webservice endpoint for running job by name or id
|
static java.lang.String |
RUNDECK_API_JOBS_UPLOAD
upload path
|
static java.lang.String |
RUNDECK_API_KILL_JOB_PATH
Webservice endpoint for killing job executions
|
static java.lang.String |
RUNDECK_API_LIST_EXECUTIONS_PATH
Webservice endpoint for queue list requests
|
static java.lang.String |
RUNDECK_API_PROJECT_NODES
Webservice endpoint for list project nodes
|
static java.lang.String |
RUNDECK_API_PROJECTS
API endpoint for projects
|
static java.lang.String |
RUNDECK_API_RUN_COMMAND
Webservice endpoint for running commands
|
static java.lang.String |
RUNDECK_API_RUN_SCRIPT
Webservice endpoint for running scripts
|
static java.lang.String |
RUNDECK_API_RUN_URL
Webservice endpoint for running a script from a URL
|
static java.lang.String |
RUNDECK_API_VERSION
RUNDECK API Version
|
static java.lang.String |
RUNDECK_API_VERSION_11 |
static java.lang.String |
RUNDECK_API_VERSION_4 |
static java.lang.String |
RUNDECK_API_VERSION_5 |
static java.lang.String |
RUNDECK_API_VERSION_8 |
static java.lang.String |
RUNDECK_API_VERSION_9 |
static java.lang.String |
RUNDECK_EXEC_LINK_PREFIX
Webservice link prefix for an execution
|
static java.lang.String |
RUNDECK_JOB_LINK_PREFIX
Webservice link prefix for a stored job.
|
FORMAT_XML, FORMAT_YAML
Constructor and Description |
---|
RundeckAPICentralDispatcher(DispatcherConfig config)
Create a RundeckCentralDispatcher
|
RundeckAPICentralDispatcher(Framework framework)
Deprecated.
|
RundeckAPICentralDispatcher(java.lang.String url,
java.lang.String username,
java.lang.String password)
Create a RundeckCentralDispatcher
|
Modifier and Type | Method and Description |
---|---|
static void |
addAPINodeSetParams(java.util.HashMap<java.lang.String,java.lang.String> params,
java.lang.Boolean isKeepgoing,
java.lang.String nodeFilter,
int threadcount,
java.lang.Boolean excludePrecedence)
Add entries to the Map for node filter parameters from the nodeset
|
void |
createProject(java.lang.String project,
java.util.Properties projectProperties)
Create a project
|
java.util.Collection<DeleteJobResult> |
deleteStoredJobs(java.util.Collection<java.lang.String> jobIds)
Delete the jobs specified by the IDs, and return a list of results
|
INodeSet |
filterProjectNodes(java.lang.String project,
java.lang.String filter) |
ExecutionFollowResult |
followDispatcherExecution(java.lang.String execId,
ExecutionFollowRequest request,
ExecutionFollowReceiver receiver)
Follow execution output for an Execution by synchronously emitting output to a receiver
|
ExecutionDetail |
getExecution(java.lang.String execId)
Return execution detail for a particular execution.
|
ServerService |
getServerService() |
DispatcherResult |
killDispatcherExecution(java.lang.String execId)
Attempt to kill the execution of an item currently on the dispatcher queue
|
java.util.Collection<QueuedItem> |
listDispatcherQueue()
List the items on the dispatcher queue for a project
|
java.util.Collection<QueuedItem> |
listDispatcherQueue(java.lang.String project)
List the items on the dispatcher queue for a project
|
PagedResult<QueuedItem> |
listDispatcherQueue(java.lang.String project,
Paging paging)
List the items on the dispatcher queue for a project, with paging
|
java.util.List<java.lang.String> |
listProjectNames() |
java.util.Collection<IStoredJob> |
listStoredJobs(IStoredJobsQuery iStoredJobsQuery,
java.io.OutputStream output,
JobDefinitionFileFormat fformat)
Return a list of stored jobs matching the query criteria
|
java.util.Collection<IStoredJobLoadResult> |
loadJobs(ILoadJobsRequest iLoadJobsRequest,
java.io.File input,
JobDefinitionFileFormat format)
Upload Jobs.xml content to the server
|
QueuedItemResult |
queueDispatcherJob(IDispatchedJob dispatchedJob)
Add a script dispatch to the dispatcher queue
|
QueuedItemResult |
queueDispatcherScript(IDispatchedScript iDispatchedScript)
Add a script dispatch to the dispatcher queue
|
java.util.Collection<IStoredJob> |
reallistStoredJobs(IStoredJobsQuery iStoredJobsQuery) |
void |
reportExecutionStatus(java.lang.String project,
java.lang.String title,
java.lang.String status,
int failedNodeCount,
int successNodeCount,
java.lang.String tags,
java.lang.String script,
java.lang.String summary,
java.util.Date start,
java.util.Date end)
Report execution status
|
void |
setServerService(ServerService serverService) |
static java.lang.String |
substitutePathVariable(java.lang.String path,
java.lang.String var,
java.lang.String value) |
public static final java.lang.String RUNDECK_JOB_LINK_PREFIX
public static final java.lang.String RUNDECK_EXEC_LINK_PREFIX
public static final java.lang.String RUNDECK_API_VERSION
public static final java.lang.String RUNDECK_API_VERSION_4
public static final java.lang.String RUNDECK_API_VERSION_5
public static final java.lang.String RUNDECK_API_VERSION_8
public static final java.lang.String RUNDECK_API_VERSION_9
public static final java.lang.String RUNDECK_API_VERSION_11
public static final java.lang.String RUNDECK_API_BASE
public static final java.lang.String RUNDECK_API_BASE_v4
public static final java.lang.String RUNDECK_API_BASE_v5
public static final java.lang.String RUNDECK_API_BASE_v8
public static final java.lang.String RUNDECK_API_BASE_v9
public static final java.lang.String RUNDECK_API_BASE_v11
public static final java.lang.String RUNDECK_API_EXECUTION_REPORT
public static final java.lang.String RUNDECK_API_PROJECTS
public static final java.lang.String RUNDECK_API_RUN_SCRIPT
public static final java.lang.String RUNDECK_API_RUN_COMMAND
public static final java.lang.String RUNDECK_API_RUN_URL
public static final java.lang.String RUNDECK_API_LIST_EXECUTIONS_PATH
public static final java.lang.String RUNDECK_API_EXECUTION_PATH
public static final java.lang.String RUNDECK_API_KILL_JOB_PATH
public static final java.lang.String RUNDECK_API_EXEC_OUTPUT_PATH
public static final java.lang.String RUNDECK_API_JOBS_EXPORT_PATH
public static final java.lang.String RUNDECK_API_JOBS_BULK_DELETE_PATH
public static final java.lang.String RUNDECK_API_JOBS_LIST_PATH
public static final java.lang.String RUNDECK_API_JOBS_UPLOAD
public static final java.lang.String RUNDECK_API_JOBS_RUN
public static final java.lang.String RUNDECK_API_PROJECT_NODES
public static final org.apache.log4j.Logger logger
public RundeckAPICentralDispatcher(Framework framework)
RundeckAPICentralDispatcher(DispatcherConfig)
framework
- the frameworkpublic RundeckAPICentralDispatcher(DispatcherConfig config)
config
- api client configpublic RundeckAPICentralDispatcher(java.lang.String url, java.lang.String username, java.lang.String password)
url
- connection urlusername
- connection usernamepassword
- connection passwordpublic void reportExecutionStatus(java.lang.String project, java.lang.String title, java.lang.String status, int failedNodeCount, int successNodeCount, java.lang.String tags, java.lang.String script, java.lang.String summary, java.util.Date start, java.util.Date end) throws CentralDispatcherException
reportExecutionStatus
in interface CentralDispatcher
project
- projecttitle
- execution titlestatus
- result status, either 'succeed','cancel','fail'failedNodeCount
- total node countsuccessNodeCount
- count of successful nodestags
- tagsscript
- script content (can be null if summary specified)summary
- summary of execution (can be null if script specified)start
- start date (can be null)end
- end date (can be null)CentralDispatcherException
- on errorpublic QueuedItemResult queueDispatcherScript(IDispatchedScript iDispatchedScript) throws CentralDispatcherException
CentralDispatcher
queueDispatcherScript
in interface CentralDispatcher
iDispatchedScript
- script dispatch descriptorCentralDispatcherException
- if an error occurspublic java.util.List<java.lang.String> listProjectNames() throws CentralDispatcherException
listProjectNames
in interface CentralDispatcher
CentralDispatcherException
public INodeSet filterProjectNodes(java.lang.String project, java.lang.String filter) throws CentralDispatcherException
filterProjectNodes
in interface CentralDispatcher
CentralDispatcherException
public java.util.Collection<QueuedItem> listDispatcherQueue() throws CentralDispatcherException
listDispatcherQueue
in interface CentralDispatcher
CentralDispatcherException
- if an error occurspublic java.util.Collection<QueuedItem> listDispatcherQueue(java.lang.String project) throws CentralDispatcherException
listDispatcherQueue
in interface CentralDispatcher
project
- Project nameCentralDispatcherException
- if an error occurspublic PagedResult<QueuedItem> listDispatcherQueue(java.lang.String project, Paging paging) throws CentralDispatcherException
listDispatcherQueue
in interface CentralDispatcher
project
- Project namepaging
- paging paramsCentralDispatcherException
- if an error occurspublic DispatcherResult killDispatcherExecution(java.lang.String execId) throws CentralDispatcherException
CentralDispatcher
killDispatcherExecution
in interface CentralDispatcher
execId
- the ID string of the itemCentralDispatcherException
- if an error occurspublic ExecutionDetail getExecution(java.lang.String execId) throws CentralDispatcherException
getExecution
in interface CentralDispatcher
execId
- ID of the executionCentralDispatcherException
- on errorpublic ExecutionFollowResult followDispatcherExecution(java.lang.String execId, ExecutionFollowRequest request, ExecutionFollowReceiver receiver) throws CentralDispatcherException
followDispatcherExecution
in interface CentralDispatcher
execId
- execution IDrequest
- requestreceiver
- output receiverCentralDispatcherException
- on errorpublic static java.lang.String substitutePathVariable(java.lang.String path, java.lang.String var, java.lang.String value) throws CentralDispatcherException
path
- the URL path to substitute the var withinvar
- the name of the var in the stringvalue
- the value to substituteCentralDispatcherException
- on URIExceptionpublic java.util.Collection<IStoredJob> listStoredJobs(IStoredJobsQuery iStoredJobsQuery, java.io.OutputStream output, JobDefinitionFileFormat fformat) throws CentralDispatcherException
CentralDispatcher
listStoredJobs
in interface CentralDispatcher
iStoredJobsQuery
- jobs queryoutput
- optional outputstream to store the XML contentfformat
- formatCentralDispatcherException
- if an error occurspublic java.util.Collection<DeleteJobResult> deleteStoredJobs(java.util.Collection<java.lang.String> jobIds) throws CentralDispatcherException
CentralDispatcher
deleteStoredJobs
in interface CentralDispatcher
jobIds
- the job IDsCentralDispatcherException
- if an error occurspublic java.util.Collection<IStoredJob> reallistStoredJobs(IStoredJobsQuery iStoredJobsQuery) throws CentralDispatcherException
CentralDispatcherException
public QueuedItemResult queueDispatcherJob(IDispatchedJob dispatchedJob) throws CentralDispatcherException
CentralDispatcher
queueDispatcherJob
in interface CentralDispatcher
dispatchedJob
- job execution reference definitionCentralDispatcherException
- if an error occurspublic static void addAPINodeSetParams(java.util.HashMap<java.lang.String,java.lang.String> params, java.lang.Boolean isKeepgoing, java.lang.String nodeFilter, int threadcount, java.lang.Boolean excludePrecedence)
params
- request paramsisKeepgoing
- true keepgoingnodeFilter
- node filter stringthreadcount
- thread countexcludePrecedence
- precedencepublic java.util.Collection<IStoredJobLoadResult> loadJobs(ILoadJobsRequest iLoadJobsRequest, java.io.File input, JobDefinitionFileFormat format) throws CentralDispatcherException
CentralDispatcher
loadJobs
in interface CentralDispatcher
iLoadJobsRequest
- load request parametersinput
- XML fileformat
- formatCentralDispatcherException
- if an error occurspublic void createProject(java.lang.String project, java.util.Properties projectProperties) throws CentralDispatcherException
CentralDispatcher
createProject
in interface CentralDispatcher
project
- project nameprojectProperties
- propertiesCentralDispatcherException
- on errorpublic ServerService getServerService()
public void setServerService(ServerService serverService)