@RestController @RequestMapping(value="/tasks") @ExposesResourceFor(value=org.springframework.cloud.dataflow.rest.resource.TaskDefinitionResource.class) public class TaskController extends Object
TaskDefinition
. This includes CRUD and deployment
operations.Constructor and Description |
---|
TaskController(TaskDefinitionRepository repository,
ModuleRegistry registry,
org.springframework.cloud.dataflow.module.deployer.ModuleDeployer deployer)
Creates a
TaskController that delegates
CRUD operations to the provided TaskDefinitionRepository
module coordinate retrieval to the provided ModuleRegistry
deployment/launching operations to the provided ModuleDeployer
|
Modifier and Type | Method and Description |
---|---|
void |
deploy(String name,
String properties)
Request the launching of an existing task definition.
|
void |
destroyTask(String name)
Delete the task from the repository so that it can no longer be executed.
|
org.springframework.hateoas.PagedResources<TaskDefinitionResource> |
list(org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.dataflow.core.TaskDefinition> assembler)
Return a page-able list of
TaskDefinitionResource defined tasks. |
void |
save(String name,
String dsl)
Register a task for future deployment/execution.
|
@Autowired public TaskController(TaskDefinitionRepository repository, ModuleRegistry registry, @Qualifier(value="taskModuleDeployer") org.springframework.cloud.dataflow.module.deployer.ModuleDeployer deployer)
TaskController
that delegates
TaskDefinitionRepository
ModuleRegistry
ModuleDeployer
repository
- the repository this controller will use for task CRUD operations.registry
- module registry this controller will use to look up modules.deployer
- the deployer this controller will use to deploy/launch task modules.@RequestMapping(value="/definitions", 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="/definitions/{name}", method=DELETE) @ResponseStatus(value=OK) public void destroyTask(@PathVariable(value="name") String name)
name
- name of the task to be deleted@RequestMapping(value="/definitions", method=GET) @ResponseStatus(value=OK) public org.springframework.hateoas.PagedResources<TaskDefinitionResource> list(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.dataflow.core.TaskDefinition> assembler)
TaskDefinitionResource
defined tasks.pageable
- page-able collection of TaskDefinitionResource
.assembler
- assembler for the TaskDefinition
@RequestMapping(value="/deployments/{name}", method=POST) @ResponseStatus(value=CREATED) public void deploy(@PathVariable(value="name") String name, @RequestParam(required=false) String properties)
name
- the name of the existing task to be executed (required)properties
- the runtime properties for the task, as a comma-delimited list of
key=value pairsCopyright © 2015 Pivotal Software, Inc.. All rights reserved.