@RestController @RequestMapping(value="/tasks/definitions") @ExposesResourceFor(value=TaskDefinitionResource.class) public class TaskDefinitionController extends Object
TaskDefinition
. This includes CRUD operations.Constructor and Description |
---|
TaskDefinitionController(org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
TaskDefinitionRepository repository,
TaskService taskService)
Creates a
TaskDefinitionController that delegates
CRUD operations to the provided TaskDefinitionRepository
task status checks to the provided TaskLauncher
|
Modifier and Type | Method and Description |
---|---|
void |
destroyTask(String name)
Delete the task from the repository so that it can no longer be executed.
|
TaskDefinitionResource |
display(String name)
Return a given task definition resource.
|
org.springframework.hateoas.PagedResources<TaskDefinitionResource> |
list(org.springframework.data.domain.Pageable pageable,
String search,
org.springframework.data.web.PagedResourcesAssembler<TaskExecutionAwareTaskDefinition> assembler)
Return a page-able list of
TaskDefinitionResource defined tasks. |
TaskDefinitionResource |
save(String name,
String dsl)
Register a task definition for future execution.
|
public TaskDefinitionController(org.springframework.cloud.task.repository.TaskExplorer taskExplorer, TaskDefinitionRepository repository, TaskService taskService)
TaskDefinitionController
that delegates
TaskDefinitionRepository
TaskLauncher
taskExplorer
- used to look up TaskExecutionsrepository
- the repository this controller will use for task CRUD operations.taskService
- handles specialized behavior needed for tasks.@RequestMapping(value="", method=POST) public TaskDefinitionResource save(@RequestParam(value="name") String name, @RequestParam(value="definition") String dsl)
name
- name the name of the taskdsl
- DSL definition for the task@RequestMapping(value="/{name}", method=DELETE) @ResponseStatus(value=OK) public void destroyTask(@PathVariable(value="name") String name)
name
- name of the task to be deleted@RequestMapping(value="", method=GET) @ResponseStatus(value=OK) public org.springframework.hateoas.PagedResources<TaskDefinitionResource> list(org.springframework.data.domain.Pageable pageable, @RequestParam(required=false) String search, org.springframework.data.web.PagedResourcesAssembler<TaskExecutionAwareTaskDefinition> assembler)
TaskDefinitionResource
defined tasks.pageable
- page-able collection of TaskDefinitionResource
.assembler
- assembler for the TaskDefinition
search
- optional findByNameLike parameter@RequestMapping(value="/{name}", method=GET) @ResponseStatus(value=OK) public TaskDefinitionResource display(@PathVariable(value="name") String name)
name
- the name of an existing task definition (required)Copyright © 2018 Pivotal Software, Inc.. All rights reserved.