@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.task.repository.TaskExplorer explorer,
TaskExecutionService taskExecutionService,
TaskDefinitionRepository taskDefinitionRepository,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeleteService taskDeleteService)
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)
Cleanup resources associated with one or more task executions, specified by id(s).
|
Collection<CurrentTaskExecutionsResource> |
getCurrentTaskExecutionsInfo() |
long |
launch(String taskName,
String ctrname,
String properties,
String arguments)
Request the launching of an existing task definition.
|
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)
Stop a set of task executions.
|
TaskExecutionResource |
view(long id)
View the details of a single task execution, specified by id.
|
public TaskExecutionController(org.springframework.cloud.task.repository.TaskExplorer explorer,
TaskExecutionService taskExecutionService,
TaskDefinitionRepository taskDefinitionRepository,
TaskExecutionInfoService taskExecutionInfoService,
TaskDeleteService taskDeleteService)
TaskExecutionController that retrieves Task Execution information
from a the TaskExplorerexplorer - the explorer this controller will use for retrieving task execution
information.taskExecutionService - used to launch taskstaskDefinitionRepository - the task definition repositorytaskExecutionInfoService - the task execution information servicetaskDeleteService - the task deletion 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 TaskExecutions.assembler - for the TaskExecutions@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 TaskExecutions.assembler - for the TaskExecutions@RequestMapping(value="",
method=POST,
params="name")
@ResponseStatus(value=CREATED)
public long launch(@RequestParam(value="name")
String taskName,
@RequestParam(required=false)
String ctrname,
@RequestParam(required=false)
String properties,
@RequestParam(required=false)
String arguments)
taskName - the name of the task to be executed (required)ctrname - user specified name of a ctr app if different than the default.properties - the runtime properties for the task, as a comma-delimited list of
key=value pairsarguments - the runtime commandline arguments@RequestMapping(value="/{id}",
method=GET)
@ResponseStatus(value=OK)
public TaskExecutionResource view(@PathVariable(value="id")
long id)
id - the id of the requested TaskExecutionTaskExecution@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)
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 TaskExecutions to clean upactions - Defaults to "CLEANUP" if not specifiedCopyright © 2020 Pivotal Software, Inc.. All rights reserved.