@RestController @RequestMapping(value="/streams/definitions") @ExposesResourceFor(value=StreamDefinitionResource.class) public class StreamDefinitionController extends Object
StreamDefinition
. This includes CRUD and optional
deployment operations.Constructor and Description |
---|
StreamDefinitionController(StreamService streamService,
StreamDefinitionService streamDefinitionService,
AppRegistryService appRegistryService,
StreamDefinitionAssemblerProvider<? extends StreamDefinitionResource> streamDefinitionAssemblerProvider,
AppRegistrationAssemblerProvider<? extends AppRegistrationResource> appRegistrationAssemblerProvider)
Create a
StreamDefinitionController that delegates to StreamService . |
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.
|
StreamDefinitionResource |
display(String name)
Return a given stream definition resource.
|
org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource> |
list(org.springframework.data.domain.Pageable pageable,
String search,
org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)
Return a page-able list of
StreamDefinitionResource defined streams. |
List<? extends AppRegistrationResource> |
listApplications(String name) |
org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource> |
listRelated(org.springframework.data.domain.Pageable pageable,
String name,
boolean nested,
org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)
Return a list of related stream definition resources based on the given stream name.
|
StreamDefinitionResource |
save(String name,
String dsl,
String description,
boolean deploy)
Create a new stream and optionally deploy it.
|
StreamDefinitionResource |
saveWithDeployProps(String name,
String dsl,
String description,
boolean deploy,
Map<String,String> deploymentProperties)
Create a new stream and optionally deploy it.
|
public StreamDefinitionController(StreamService streamService, StreamDefinitionService streamDefinitionService, AppRegistryService appRegistryService, StreamDefinitionAssemblerProvider<? extends StreamDefinitionResource> streamDefinitionAssemblerProvider, AppRegistrationAssemblerProvider<? extends AppRegistrationResource> appRegistrationAssemblerProvider)
StreamDefinitionController
that delegates to StreamService
.streamService
- the stream service to usestreamDefinitionService
- the stream definition service to useappRegistryService
- the app registry service to usestreamDefinitionAssemblerProvider
- the stream definition assembler provider to useappRegistrationAssemblerProvider
- the app registry assembler provider to use@RequestMapping(value="", method=GET) @ResponseStatus(value=OK) public org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource> list(org.springframework.data.domain.Pageable pageable, @RequestParam(required=false) String search, org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)
StreamDefinitionResource
defined streams.pageable
- Pagination informationassembler
- assembler for StreamDefinition
search
- optional findByTaskNameContains parameter@RequestMapping(value="", method=POST, consumes="application/x-www-form-urlencoded") @ResponseStatus(value=CREATED) public StreamDefinitionResource save(@RequestParam(value="name") String name, @RequestParam(value="definition") String dsl, @RequestParam(value="description",defaultValue="") String description, @RequestParam(value="deploy",defaultValue="false") boolean deploy)
Differs from saveWithDeployProps(java.lang.String, java.lang.String, java.lang.String, boolean, java.util.Map<java.lang.String, java.lang.String>)
by accepting deployment properties and consuming
MediaType.APPLICATION_FORM_URLENCODED
request content (required by the Dataflow Shell).
name
- stream namedsl
- DSL definition for streamdeploy
- if true
, the stream is deployed upon creation (default is
false
)description
- description of the stream definitionDuplicateStreamDefinitionException
- if a stream definition with the same name
already existsInvalidStreamDefinitionException
- if there are errors parsing the stream DSL,
resolving the name, or type of applications in the stream@RequestMapping(value="", method=POST, consumes="application/json") @ResponseStatus(value=CREATED) public StreamDefinitionResource saveWithDeployProps(@RequestParam(value="name") String name, @RequestParam(value="definition") String dsl, @RequestParam(value="description",defaultValue="") String description, @RequestParam(value="deploy",defaultValue="false") boolean deploy, @RequestBody(required=false) Map<String,String> deploymentProperties)
Differs from save(java.lang.String, java.lang.String, java.lang.String, boolean)
by accepting deployment properties and consuming
MediaType.APPLICATION_JSON
request content.
name
- stream namedsl
- DSL definition for streamdeploy
- if true
, the stream is deployed upon creation (default is
false
)deploymentProperties
- the optional deployment properties to use when the stream is deployed upon creationdescription
- description of the stream definitionDuplicateStreamDefinitionException
- if a stream definition with the same name
already existsInvalidStreamDefinitionException
- if there are errors parsing the stream DSL,
resolving the name, or type of applications in the stream@RequestMapping(value="/{name}", method=DELETE) @ResponseStatus(value=OK) public void delete(@PathVariable(value="name") String name)
name
- the name of an existing stream definition (required)@RequestMapping(value="/{name}/related", method=GET) @ResponseStatus(value=OK) public org.springframework.hateoas.PagedModel<? extends StreamDefinitionResource> listRelated(org.springframework.data.domain.Pageable pageable, @PathVariable(value="name") String name, @RequestParam(value="nested",required=false,defaultValue="false") boolean nested, org.springframework.data.web.PagedResourcesAssembler<StreamDefinition> assembler)
pageable
- Pagination informationname
- the name of an existing stream definition (required)nested
- if should recursively findByTaskNameContains for related stream definitionsassembler
- resource assembler for stream definition@RequestMapping(value="/{name}", method=GET) @ResponseStatus(value=OK) public StreamDefinitionResource display(@PathVariable(value="name") String name)
name
- the name of an existing stream definition (required)@RequestMapping(value="/{name}/applications", method=GET) @ResponseStatus(value=OK) public List<? extends AppRegistrationResource> listApplications(@PathVariable(value="name") String name)
@RequestMapping(value="", method=DELETE) @ResponseStatus(value=OK) public void deleteAll()
Copyright © 2024 Pivotal Software, Inc.. All rights reserved.