@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,
AppRegistry appRegistry)
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. |
void |
save(String name,
String dsl)
Register a task for future deployment/execution.
|
public TaskDefinitionController(TaskDefinitionRepository repository, DeploymentIdRepository deploymentIdRepository, org.springframework.cloud.deployer.spi.task.TaskLauncher taskLauncher, AppRegistry appRegistry)
TaskDefinitionController that delegates
TaskDefinitionRepositoryTaskLauncherrepository - 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@RequestMapping(value="", method=POST) public void save(@RequestParam(value="name") String name, @RequestParam(value="definition") String dsl)
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 TaskDefinitionsearch - optional search 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 © 2017 Pivotal Software, Inc.. All rights reserved.