Class StreamTemplate
java.lang.Object
org.springframework.cloud.dataflow.rest.client.StreamTemplate
- All Implemented Interfaces:
StreamOperations
Implementation for
StreamOperations.- Author:
- Ilayaperumal Gopinathan, Mark Fisher, Eric Bottard
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateStream(String name, String definition, String description, boolean deploy) Create a new stream, optionally deploying it.voidDeploy an already created stream.voidDestroy an existing stream.voidDestroy all streams known to the system.getManifest(String streamName, int version) Get manifest for the given stream deployed via Skipper.getStreamDefinition(String streamName) Queries the server for the stream definition.Collection<org.springframework.cloud.skipper.domain.Release>Get the history of releases for the given stream deployed via Skipper.list()Collection<org.springframework.cloud.skipper.domain.Deployer>voidrollbackStream(String streamName, int version) Rollback the stream to the previous or a specific release version.voidscaleApplicationInstances(String streamName, String appName, Integer count, Map<String, String> properties) Scales number of application instances in a stream.streamExecutionLog(String streamName) Retrieves all the applications' logs for the given stream namestreamExecutionLog(String streamName, String appName) Retrieve the logs of a specific application from the streamvoidUndeploy a deployed stream, retaining its definition.voidUndeploy all currently deployed streams.voidupdateStream(String streamName, String releaseName, org.springframework.cloud.skipper.domain.PackageIdentifier packageIdentifier, Map<String, String> updateProperties, boolean force, List<String> appNames) Update the stream given its corresponding releaseName in Skipper using the specified package and updated yaml config.validateStreamDefinition(String streamDefinitionName) Return the validation status for the apps in an stream.
-
Field Details
-
DEFINITIONS_REL
- See Also:
-
-
Method Details
-
list
- Specified by:
listin interfaceStreamOperations- Returns:
- the list streams known to the system.
-
info
- Specified by:
infoin interfaceStreamOperations- Parameters:
name- the name of the stream- Returns:
- retrieve the stream info.
-
createStream
public StreamDefinitionResource createStream(String name, String definition, String description, boolean deploy) Description copied from interface:StreamOperationsCreate a new stream, optionally deploying it.- Specified by:
createStreamin interfaceStreamOperations- Parameters:
name- the name of the streamdefinition- the stream definition DSLdescription- the description of the streamdeploy- whether to deploy the stream after creating its definition- Returns:
- the new stream definition
-
deploy
Description copied from interface:StreamOperationsDeploy an already created stream.- Specified by:
deployin interfaceStreamOperations- Parameters:
name- the name of the streamproperties- the deployment properties
-
undeploy
Description copied from interface:StreamOperationsUndeploy a deployed stream, retaining its definition.- Specified by:
undeployin interfaceStreamOperations- Parameters:
name- the name of the stream
-
undeployAll
public void undeployAll()Description copied from interface:StreamOperationsUndeploy all currently deployed streams.- Specified by:
undeployAllin interfaceStreamOperations
-
destroy
Description copied from interface:StreamOperationsDestroy an existing stream.- Specified by:
destroyin interfaceStreamOperations- Parameters:
name- the name of the stream
-
destroyAll
public void destroyAll()Description copied from interface:StreamOperationsDestroy all streams known to the system.- Specified by:
destroyAllin interfaceStreamOperations
-
scaleApplicationInstances
public void scaleApplicationInstances(String streamName, String appName, Integer count, Map<String, String> properties) Description copied from interface:StreamOperationsScales number of application instances in a stream.- Specified by:
scaleApplicationInstancesin interfaceStreamOperations- Parameters:
streamName- the stream(release) name.appName- name of application in the stream to scale.count- number of instances to scale to.properties- scale deployment properties.
-
streamExecutionLog
Description copied from interface:StreamOperationsRetrieves all the applications' logs for the given stream name- Specified by:
streamExecutionLogin interfaceStreamOperations- Parameters:
streamName- name of stream for which to get logs- Returns:
- logs of said stream
-
streamExecutionLog
Description copied from interface:StreamOperationsRetrieve the logs of a specific application from the stream- Specified by:
streamExecutionLogin interfaceStreamOperations- Parameters:
streamName- name of stream for which to get logsappName- app name for which to get logs- Returns:
- logs for said application within said stream
-
updateStream
public void updateStream(String streamName, String releaseName, org.springframework.cloud.skipper.domain.PackageIdentifier packageIdentifier, Map<String, String> updateProperties, boolean force, List<String> appNames) Description copied from interface:StreamOperationsUpdate the stream given its corresponding releaseName in Skipper using the specified package and updated yaml config.- Specified by:
updateStreamin interfaceStreamOperations- Parameters:
streamName- the name of the stream to updatereleaseName- the corresponding release name of the stream in skipperpackageIdentifier- the package that corresponds to this streamupdateProperties- a map of properties to use for updating the streamforce- boolean flag to indicate if the stream update is enforced irrespective of differences from the existing streamappNames- app names to use for the stream update when update is enforced
-
rollbackStream
Description copied from interface:StreamOperationsRollback the stream to the previous or a specific release version.- Specified by:
rollbackStreamin interfaceStreamOperations- Parameters:
streamName- the name of the stream to rollbackversion- the version to rollback to. If the version is 0, then rollback to the previous release. The version can not be less than zero.
-
getManifest
Description copied from interface:StreamOperationsGet manifest for the given stream deployed via Skipper. Optionally, the version can be used to retrieve the version for a specific version of the stream.- Specified by:
getManifestin interfaceStreamOperations- Parameters:
streamName- the stream(release) nameversion- the version of the release- Returns:
- the manifest for the given stream and version
-
history
Description copied from interface:StreamOperationsGet the history of releases for the given stream deployed via Skipper.- Specified by:
historyin interfaceStreamOperations- Parameters:
streamName- the stream(release) name- Returns:
- the history of releases for the stream
-
listPlatforms
- Specified by:
listPlatformsin interfaceStreamOperations- Returns:
- the list of all Skipper platforms
-
getStreamDefinition
Description copied from interface:StreamOperationsQueries the server for the stream definition.- Specified by:
getStreamDefinitionin interfaceStreamOperations- Parameters:
streamName- the name of the stream to get status- Returns:
- The current stream definition with updated status
-
validateStreamDefinition
public StreamAppStatusResource validateStreamDefinition(String streamDefinitionName) throws OperationNotSupportedException Description copied from interface:StreamOperationsReturn the validation status for the apps in an stream.- Specified by:
validateStreamDefinitionin interfaceStreamOperations- Parameters:
streamDefinitionName- The name of the stream definition to be validated.- Returns:
StreamAppStatusResourcecontaining the stream app statuses.- Throws:
OperationNotSupportedException- if the server does not support stream validation
-