@RestController @RequestMapping(value="/streams") @ExposesResourceFor(value=org.springframework.cloud.dataflow.rest.resource.StreamDefinitionResource.class) public class StreamController extends Object
StreamDefinition
. This
includes CRUD and deployment operations.Constructor and Description |
---|
StreamController(StreamDefinitionRepository repository,
ModuleRegistry registry,
org.springframework.cloud.dataflow.module.deployer.ModuleDeployer deployer)
Create a
StreamController that delegates
CRUD operations to the provided StreamDefinitionRepository
deployment operations to the provided ModuleDeployer
module coordinate retrieval to the provided ModuleRegistry
|
Modifier and Type | Method and Description |
---|---|
void |
delete(String name)
Request removal of an existing stream definition.
|
void |
deleteAll()
Request removal of all stream definitions.
|
void |
deploy(String name,
String properties)
Request deployment of an existing stream definition.
|
org.springframework.hateoas.PagedResources<StreamDefinitionResource> |
list(org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.dataflow.core.StreamDefinition> assembler)
Return a page-able list of
StreamDefinitionResource defined streams. |
void |
save(String name,
String dsl,
boolean deploy)
Create a new stream.
|
void |
undeploy(String name)
Request un-deployment of an existing stream.
|
void |
undeployAll()
Request un-deployment of all streams.
|
@Autowired public StreamController(StreamDefinitionRepository repository, ModuleRegistry registry, @Qualifier(value="processModuleDeployer") org.springframework.cloud.dataflow.module.deployer.ModuleDeployer deployer)
StreamController
that delegates
StreamDefinitionRepository
ModuleDeployer
ModuleRegistry
repository
- the repository this controller will use for stream CRUD operationsregistry
- module registry this controller will use to look up modulesdeployer
- the deployer this controller will use to deploy stream modules@RequestMapping(value="/definitions", method=GET) @ResponseStatus(value=OK) public org.springframework.hateoas.PagedResources<StreamDefinitionResource> list(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<org.springframework.cloud.dataflow.core.StreamDefinition> assembler)
StreamDefinitionResource
defined streams.pageable
- page-able collection of StreamDefinitionResource
.assembler
- assembler for StreamDefinition
@RequestMapping(value="/definitions", method=POST) @ResponseStatus(value=CREATED) public void save(@RequestParam(value="name") String name, @RequestParam(value="definition") String dsl, @RequestParam(value="deploy",defaultValue="true") boolean deploy)
name
- stream namedsl
- DSL definition for streamdeploy
- if true
, the stream is deployed upon creation@RequestMapping(value="/definitions/{name}", method=DELETE) @ResponseStatus(value=OK) public void delete(@PathVariable(value="name") String name) throws Exception
name
- the name of an existing stream definition (required)Exception
@RequestMapping(value="/definitions", method=DELETE) @ResponseStatus(value=OK) public void deleteAll() throws Exception
Exception
@RequestMapping(value="/deployments/{name}", method=DELETE) @ResponseStatus(value=OK) public void undeploy(@PathVariable(value="name") String name) throws Exception
name
- the name of an existing stream (required)Exception
@RequestMapping(value="/deployments", method=DELETE) @ResponseStatus(value=OK) public void undeployAll() throws Exception
Exception
@RequestMapping(value="/deployments/{name}", method=POST) @ResponseStatus(value=CREATED) public void deploy(@PathVariable(value="name") String name, @RequestParam(required=false) String properties) throws Exception
name
- the name of an existing stream definition (required)properties
- the deployment properties for the stream as a comma-delimited list of key=value pairsException
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.