@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,
TaskSaveService taskSaveService,
TaskDeleteService taskDeleteService)
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 |
destroyAll()
Delete all task from the repository.
|
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.PagedModel<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,
String description)
Register a task definition for future execution.
|
public TaskDefinitionController(org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
TaskDefinitionRepository repository,
TaskSaveService taskSaveService,
TaskDeleteService taskDeleteService)
TaskDefinitionController that delegates
TaskDefinitionRepositoryTaskLaunchertaskExplorer - used to look up TaskExecutions.repository - the repository this controller will use for task CRUD operations.taskSaveService - handles Task saving related operations.taskDeleteService - handles Task deletion related operations.@RequestMapping(value="",
method=POST)
public TaskDefinitionResource save(@RequestParam(value="name")
String name,
@RequestParam(value="definition")
String dsl,
@RequestParam(value="description",defaultValue="")
String description)
name - name the name of the taskdsl - DSL definition for the taskdescription - description of the task definition@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=DELETE)
@ResponseStatus(value=OK)
public void destroyAll()
@RequestMapping(value="",
method=GET)
@ResponseStatus(value=OK)
public org.springframework.hateoas.PagedModel<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 TaskDefinitionsearch - optional findByTaskNameContains 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 © 2020 Pivotal Software, Inc.. All rights reserved.