@RestController @RequestMapping(value="/tasks/executions") @ExposesResourceFor(value=TaskExecutionResource.class) public class TaskExecutionController extends Object
TaskExecution
. This includes
obtaining task execution information from the task explorer.Constructor and Description |
---|
TaskExecutionController(org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer explorer,
org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport,
TaskExecutionService taskExecutionService,
TaskDefinitionRepository taskDefinitionRepository,
org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeleteService taskDeleteService,
TaskJobService taskJobService)
Creates a
TaskExecutionController that retrieves Task Execution information
from a the TaskExplorer |
Modifier and Type | Method and Description |
---|---|
void |
cleanup(Set<Long> ids,
TaskExecutionControllerDeleteAction[] actions,
String schemaTarget)
Cleanup resources associated with one or more task executions, specified by id(s).
|
void |
cleanupAll(TaskExecutionControllerDeleteAction[] actions,
boolean completed,
String taskName,
Integer days)
Cleanup resources associated with one or more task executions.
|
Collection<CurrentTaskExecutionsResource> |
getCurrentTaskExecutionsInfo() |
long |
launch(String taskName,
String properties,
String arguments)
Request the launching of an existing task definition.
|
LaunchResponseResource |
launchBoot3(String taskName,
String properties,
String arguments) |
org.springframework.hateoas.PagedModel<TaskExecutionResource> |
list(org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<TaskJobExecutionRel> assembler)
Return a page-able list of
TaskExecutionResource defined tasks. |
org.springframework.hateoas.PagedModel<TaskExecutionResource> |
retrieveTasksByName(String taskName,
org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<TaskJobExecutionRel> assembler)
Retrieve all task executions with the task name specified
|
void |
stop(Set<Long> ids,
String platform,
String schemaTarget)
Stop a set of task executions.
|
TaskExecutionResource |
view(Long id,
String schemaTarget)
View the details of a single task execution, specified by id.
|
TaskExecutionResource |
viewByExternal(String externalExecutionId,
String platform) |
public TaskExecutionController(org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer explorer, org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport, TaskExecutionService taskExecutionService, TaskDefinitionRepository taskDefinitionRepository, org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader, TaskExecutionInfoService taskExecutionInfoService, TaskDeleteService taskDeleteService, TaskJobService taskJobService)
TaskExecutionController
that retrieves Task Execution information
from a the TaskExplorer
explorer
- the explorer this controller will use for retrieving task execution
information.aggregateExecutionSupport
- provides schemaTarget for a task by name.taskExecutionService
- used to launch taskstaskDefinitionRepository
- the task definition repositorytaskDefinitionReader
- uses task definition repository to provide Task Definition to aggregateExecutionSupporttaskExecutionInfoService
- the task execution information servicetaskDeleteService
- the task deletion servicetaskJobService
- the task job service@RequestMapping(value="", method=GET) @ResponseStatus(value=OK) public org.springframework.hateoas.PagedModel<TaskExecutionResource> list(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<TaskJobExecutionRel> assembler)
TaskExecutionResource
defined tasks.pageable
- page-able collection of TaskExecution
s.assembler
- for the TaskExecution
s@RequestMapping(value="", method=GET, params="name") @ResponseStatus(value=OK) public org.springframework.hateoas.PagedModel<TaskExecutionResource> retrieveTasksByName(@RequestParam(value="name") String taskName, org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<TaskJobExecutionRel> assembler)
taskName
- name of the taskpageable
- page-able collection of TaskExecution
s.assembler
- for the TaskExecution
s@RequestMapping(value="", method=POST, params="name") @ResponseStatus(value=CREATED) public long launch(@RequestParam(value="name") String taskName, @RequestParam(required=false) String properties, @RequestParam(required=false) String arguments)
taskName
- the name of the task to be executed (required)properties
- the runtime properties for the task, as a comma-delimited list of
key=value pairsarguments
- the runtime commandline arguments@RequestMapping(value="/launch", method=POST, params="name") @ResponseStatus(value=CREATED) public LaunchResponseResource launchBoot3(@RequestParam(value="name") String taskName, @RequestParam(required=false) String properties, @RequestParam(required=false) String arguments)
@RequestMapping(value="/{id}", method=GET) @ResponseStatus(value=OK) public TaskExecutionResource view(@PathVariable(name="id") Long id, @RequestParam(name="schemaTarget",required=false) String schemaTarget)
id
- the id of the requested TaskExecution
TaskExecution
@RequestMapping(value="/external/{externalExecutionId}", method=GET) @ResponseStatus(value=OK) public TaskExecutionResource viewByExternal(@PathVariable(name="externalExecutionId") String externalExecutionId, @RequestParam(name="platform",required=false) String platform)
@RequestMapping(value="/current", method=GET) @ResponseStatus(value=OK) public Collection<CurrentTaskExecutionsResource> getCurrentTaskExecutionsInfo()
@RequestMapping(value="/{id}", method=DELETE) @ResponseStatus(value=OK) public void cleanup(@PathVariable(value="id") Set<Long> ids, @RequestParam(defaultValue="CLEANUP",name="action") TaskExecutionControllerDeleteAction[] actions, @RequestParam(name="schemaTarget",required=false) String schemaTarget)
actions
parameter can be used to not only clean up task execution resources,
but can also trigger the deletion of task execution and job data in the persistence store.ids
- The id of the TaskExecution
s to clean upactions
- Defaults to "CLEANUP" if not specified@RequestMapping(method=DELETE) @ResponseStatus(value=OK) public void cleanupAll(@RequestParam(defaultValue="CLEANUP",name="action") TaskExecutionControllerDeleteAction[] actions, @RequestParam(defaultValue="false",name="completed") boolean completed, @RequestParam(defaultValue="",name="name") String taskName, @RequestParam(name="days",required=false) Integer days)
actions
and completed
parameters can be used to not only clean up task execution resources,
but can also trigger the deletion of task execution and job data in the persistence store.actions
- the actions to perform (default 'CLEANUP')completed
- whether to include only completed task executions (default false)taskName
- name of the task (default '')days
- only include tasks that have ended at least this many days ago (default null)@RequestMapping(value="/{id}", method=POST) @ResponseStatus(value=OK) public void stop(@PathVariable(value="id") Set<Long> ids, @RequestParam(defaultValue="",name="platform") String platform, @RequestParam(name="schemaTarget",required=false) String schemaTarget)
ids
- the ids of the TaskExecution
s to stopplatform
- the platform nameCopyright © 2023 Pivotal Software, Inc.. All rights reserved.