Interface StreamService
- All Known Implementing Classes:
DefaultStreamService
public interface StreamService
Provide deploy, undeploy, info and state operations on the stream.
Uses the support for operations provided by Skipper.
- Author:
- Mark Pollack, Ilayaperumal Gopinathan, Christian Tzolov
-
Method Summary
Modifier and TypeMethodDescriptioncreateStream(String streamName, String dsl, String description, boolean deploy, Map<String, String> deploymentProperties) Create a new stream.voidDelete all streams, including undeploying.voiddeleteStream(String name) Delete the stream, including undeloying.voiddeployStream(String name, Map<String, String> deploymentProperties) Deploys the stream with the user provided deployment properties.org.springframework.data.domain.Page<StreamDefinition>findDefinitionByNameContains(org.springframework.data.domain.Pageable pageable, String search) Find stream definitions where the findByTaskNameContains parameterFind a stream definition by name.findRelatedStreams(String name, boolean nested) Find streams related to the given stream name.Collection<org.springframework.cloud.skipper.domain.Release>Get stream's deployment historyGet stream information including the deployment properties etc.Return a manifest info of a release version.Collection<org.springframework.cloud.skipper.domain.Deployer>voidrollbackStream(String streamName, int releaseVersion) Rollback the stream to the previous or a specific version of the stream.voidscaleApplicationInstances(String streamName, String appName, int count, Map<String, String> properties) Scale application instances in a deployed stream.Map<StreamDefinition,org.springframework.cloud.deployer.spi.app.DeploymentState> state(List<StreamDefinition> streamDefinitions) Retrieve the deployment state for list of stream definitions.voidundeployStream(String name) Un-deploys the stream identified by the given stream name.voidupdateStream(String streamName, UpdateStreamRequest updateStreamRequest) Update the stream using the UpdateStreamRequest.validateStream(String name) Verifies that all apps in the stream are valid.
-
Method Details
-
scaleApplicationInstances
void scaleApplicationInstances(String streamName, String appName, int count, Map<String, String> properties) Scale application instances in a deployed stream.- Parameters:
streamName- the name of an existing stream definition (required)appName- in stream application name to scale (required)count- number of instances for the selected stream application (required)properties- scale deployment specific properties (optional)
-
updateStream
Update the stream using the UpdateStreamRequest.- Parameters:
streamName- the name of the stream to updateupdateStreamRequest- the UpdateStreamRequest to use during the update
-
rollbackStream
Rollback the stream to the previous or a specific version of the stream.- Parameters:
streamName- the name of the stream to rollbackreleaseVersion- the version to rollback to (if not specified, rollback to the previous deleted/deployed release version of the stream.
-
manifest
Return a manifest info of a release version. For packages with dependencies, the manifest includes the contents of those dependencies.- Parameters:
releaseName- the release namereleaseVersion- the release version- Returns:
- the manifest info of a release
-
history
Get stream's deployment history- Parameters:
releaseName- Stream release name- Returns:
- List or Releases for this release name
-
platformList
Collection<org.springframework.cloud.skipper.domain.Deployer> platformList()- Returns:
- list of supported deployment platforms
-
createStream
StreamDefinition createStream(String streamName, String dsl, String description, boolean deploy, Map<String, String> deploymentProperties) Create a new stream.- Parameters:
streamName- stream namedsl- DSL definition for streamdescription- description of the stream definitiondeploy- iftrue, the stream is deployed upon creation (default isfalse)deploymentProperties- the optional deployment properties to use when the stream is deployed upon creation- Returns:
- the created stream definition already exists
- Throws:
InvalidStreamDefinitionException- if there are errors in parsing the stream DSL, resolving the name, or type of applications in the stream
-
deployStream
Deploys the stream with the user provided deployment properties. Implementations are responsible for expanding deployment wildcard expressions.- Parameters:
name- the name of the streamdeploymentProperties- deployment properties to use as passed in from the client.
-
undeployStream
Un-deploys the stream identified by the given stream name.- Parameters:
name- the name of the stream to un-deploy
-
deleteStream
Delete the stream, including undeloying.- Parameters:
name- the name of the stream to delete
-
deleteAll
void deleteAll()Delete all streams, including undeploying. -
state
Map<StreamDefinition,org.springframework.cloud.deployer.spi.app.DeploymentState> state(List<StreamDefinition> streamDefinitions) Retrieve the deployment state for list of stream definitions.- Parameters:
streamDefinitions- the list of Stream definitions to calculate the deployment states.- Returns:
- the map containing the stream definitions and their deployment states.
-
info
Get stream information including the deployment properties etc.- Parameters:
streamName- the name of the stream- Returns:
- the stream deployment information
-
findRelatedStreams
Find streams related to the given stream name.- Parameters:
name- name of the streamnested- if should recursively findByTaskNameContains for related stream definitions- Returns:
- a list of related stream definitions
-
findDefinitionByNameContains
org.springframework.data.domain.Page<StreamDefinition> findDefinitionByNameContains(org.springframework.data.domain.Pageable pageable, String search) Find stream definitions where the findByTaskNameContains parameter- Parameters:
pageable- Pagination informationsearch- the findByTaskNameContains parameter to use- Returns:
- Page of stream definitions
-
findOne
Find a stream definition by name.- Parameters:
streamDefinitionName- the name of the stream definition- Returns:
- the stream definition
- Throws:
NoSuchStreamDefinitionException- if the definition can not be found.
-
validateStream
Verifies that all apps in the stream are valid.- Parameters:
name- the name of the definition- Returns:
ValidationStatusfor a stream.
-