Class TaskTemplate
java.lang.Object
org.springframework.cloud.dataflow.rest.client.TaskTemplate
- All Implemented Interfaces:
TaskOperations
Implementation for
TaskOperations.- Author:
- Glenn Renfro, Michael Minella, Gunnar Hillert, David Turanski, Corneil du Plessis
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup(long id) Cleanup any resources associated with the execution for the id specified.voidcleanup(long id, boolean removeData) Cleanup any resources associated with the execution for the id specified.voidcleanupAllTaskExecutions(boolean completed, String taskName) Cleanup any resources associated with the matching task executions.Create a new task definitionReturn information including the count of currently executing tasks and task execution limits.voidDestroy an existing task.voidDestroy an existing task with the flag to cleanup task resources.voidDestroy all existing tasks.executionListByTaskName(String taskName) List task executions known to the system filtered by task name.getAllTaskExecutionsCount(boolean completed, String taskName) Get the task executions count with the option to filter only the completed task executions.Launch an already created task.list()voidRequest the stop of a groupTaskExecutions.voidRequest the stop of a groupTaskExecutions.taskExecutionLog(String externalExecutionId) Return the task execution log.taskExecutionLog(String externalExecutionId, String platform) Return the task execution log.taskExecutionStatus(long id) Return theTaskExecutionResourcefor the id specified.org.springframework.hateoas.PagedModel<TaskExecutionThinResource>org.springframework.hateoas.PagedModel<TaskExecutionThinResource>thinExecutionListByTaskName(String taskName) List task executions filtered by task name.validateTaskDefinition(String taskDefinitionName) Return the validation status for the tasks in an definition.
-
Method Details
-
list
- Specified by:
listin interfaceTaskOperations- Returns:
- the list tasks known to the system.
-
listPlatforms
- Specified by:
listPlatformsin interfaceTaskOperations- Returns:
- the list of platform accounts for tasks.
-
create
Description copied from interface:TaskOperationsCreate a new task definition- Specified by:
createin interfaceTaskOperations- Parameters:
name- the name of the taskdefinition- the task definition DSLdescription- the description of the task definition- Returns:
- the task definition
-
launch
public LaunchResponseResource launch(String name, Map<String, String> properties, List<String> arguments) Description copied from interface:TaskOperationsLaunch an already created task.- Specified by:
launchin interfaceTaskOperations- Parameters:
name- the name of the taskproperties- the deployment propertiesarguments- the command line arguments- Returns:
- long containing the TaskExecutionId
-
stop
Description copied from interface:TaskOperationsRequest the stop of a groupTaskExecutions.- Specified by:
stopin interfaceTaskOperations- Parameters:
ids- comma delimited set ofTaskExecutionids to stop.
-
stop
Description copied from interface:TaskOperationsRequest the stop of a groupTaskExecutions.- Specified by:
stopin interfaceTaskOperations- Parameters:
ids- comma delimited set ofTaskExecutionids to stop.platform- the platform name where the task is executing.
-
destroy
Description copied from interface:TaskOperationsDestroy an existing task.- Specified by:
destroyin interfaceTaskOperations- Parameters:
name- the name of the task
-
destroy
Description copied from interface:TaskOperationsDestroy an existing task with the flag to cleanup task resources.- Specified by:
destroyin interfaceTaskOperations- Parameters:
name- the name of the taskcleanup- flag indicates task execution cleanup
-
destroyAll
public void destroyAll()Description copied from interface:TaskOperationsDestroy all existing tasks.- Specified by:
destroyAllin interfaceTaskOperations
-
executionList
- Specified by:
executionListin interfaceTaskOperations- Returns:
- the list task executions known to the system.
-
thinExecutionList
- Specified by:
thinExecutionListin interfaceTaskOperations- Returns:
- the list of thin task executions known to the system.
-
thinExecutionListByTaskName
public org.springframework.hateoas.PagedModel<TaskExecutionThinResource> thinExecutionListByTaskName(String taskName) Description copied from interface:TaskOperationsList task executions filtered by task name.- Specified by:
thinExecutionListByTaskNamein interfaceTaskOperations- Returns:
- the page of task executions for the given task name.
-
executionListByTaskName
Description copied from interface:TaskOperationsList task executions known to the system filtered by task name.- Specified by:
executionListByTaskNamein interfaceTaskOperations- Parameters:
taskName- of the executions.- Returns:
- the paged list of task executions for the given task name
-
taskExecutionStatus
Description copied from interface:TaskOperationsReturn theTaskExecutionResourcefor the id specified.- Specified by:
taskExecutionStatusin interfaceTaskOperations- Parameters:
id- identifier of the task execution- Returns:
TaskExecutionResource
-
taskExecutionLog
Description copied from interface:TaskOperationsReturn the task execution log. The platform from which to retrieve the log will be set todefault.- Specified by:
taskExecutionLogin interfaceTaskOperations- Parameters:
externalExecutionId- the external execution identifier of the task execution.- Returns:
Stringcontaining the log.
-
taskExecutionLog
Description copied from interface:TaskOperationsReturn the task execution log.- Specified by:
taskExecutionLogin interfaceTaskOperations- Parameters:
externalExecutionId- the external execution identifier of the task execution.platform- the platform from which to obtain the log.- Returns:
Stringcontaining the log.
-
currentTaskExecutions
Description copied from interface:TaskOperationsReturn information including the count of currently executing tasks and task execution limits.- Specified by:
currentTaskExecutionsin interfaceTaskOperations- Returns:
- Collection of
CurrentTaskExecutionsResource
-
cleanup
public void cleanup(long id) Description copied from interface:TaskOperationsCleanup any resources associated with the execution for the id specified.- Specified by:
cleanupin interfaceTaskOperations- Parameters:
id- identifier of the task execution
-
cleanup
public void cleanup(long id, boolean removeData) Description copied from interface:TaskOperationsCleanup any resources associated with the execution for the id specified.- Specified by:
cleanupin interfaceTaskOperations- Parameters:
id- identifier of the task executionremoveData- delete the history of the execution
-
cleanupAllTaskExecutions
Description copied from interface:TaskOperationsCleanup any resources associated with the matching task executions.- Specified by:
cleanupAllTaskExecutionsin interfaceTaskOperations- Parameters:
completed- cleanup only completed task executionstaskName- the name of the task to cleanup, if null then all the tasks are considered.
-
getAllTaskExecutionsCount
Description copied from interface:TaskOperationsGet the task executions count with the option to filter only the completed task executions.- Specified by:
getAllTaskExecutionsCountin interfaceTaskOperations- Parameters:
completed- cleanup only completed task executionstaskName- the name of the task to cleanup, if null then all the tasks are considered.- Returns:
- the number of task executions.
-
validateTaskDefinition
public TaskAppStatusResource validateTaskDefinition(String taskDefinitionName) throws OperationNotSupportedException Description copied from interface:TaskOperationsReturn the validation status for the tasks in an definition.- Specified by:
validateTaskDefinitionin interfaceTaskOperations- Parameters:
taskDefinitionName- The name of the task definition to be validated.- Returns:
TaskAppStatusResourcecontaining the task app statuses.- Throws:
OperationNotSupportedException- if the server does not support task validation
-