@RestController @RequestMapping(value="/tasks/definitions") @ExposesResourceFor(value=TaskDefinitionResource.class) public class TaskDefinitionController extends Object
TaskDefinition
. This includes CRUD operations.Constructor and Description |
---|
TaskDefinitionController(TaskDefinitionRepository repository,
DeploymentIdRepository deploymentIdRepository,
org.springframework.cloud.deployer.spi.task.TaskLauncher taskLauncher,
AppRegistryCommon appRegistry,
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<TaskDefinition> 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(TaskDefinitionRepository repository, DeploymentIdRepository deploymentIdRepository, org.springframework.cloud.deployer.spi.task.TaskLauncher taskLauncher, AppRegistryCommon appRegistry, TaskService taskService)
TaskDefinitionController
that delegates
TaskDefinitionRepository
TaskLauncher
repository
- the repository this controller will use for task CRUD operations.deploymentIdRepository
- the repository this controller will use for
deployment IDstaskLauncher
- the TaskLauncher this controller will use to check task status.appRegistry
- the app registry to look up registered apps.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<TaskDefinition> 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.