Skip to main content

streams

Creates, updates, deletes, gets or lists a streams resource.

Overview

Namestreams
TypeResource
Idgoogle.datastream.streams

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Identifier. The stream's name.
backfillAllobjectAutomatically backfill objects included in the stream source configuration. Specific objects can be excluded. (id: BackfillAllStrategy)
backfillNoneobjectDo not automatically backfill any objects. (id: BackfillNoneStrategy)
createTimestring (google-datetime)Output only. The creation time of the stream.
customerManagedEncryptionKeystringImmutable. A reference to a KMS encryption key. If provided, it will be used to encrypt the data. If left blank, data will be encrypted using an internal Stream-specific encryption key provisioned through KMS.
destinationConfigobjectRequired. Destination connection profile configuration. (id: DestinationConfig)
displayNamestringRequired. Display name.
errorsarrayOutput only. Errors on the Stream.
labelsobjectLabels.
lastRecoveryTimestring (google-datetime)Output only. If the stream was recovered, the time of the last recovery. Note: This field is currently experimental.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
sourceConfigobjectRequired. Source connection profile configuration. (id: SourceConfig)
statestringThe state of the stream.
updateTimestring (google-datetime)Output only. The last update time of the stream.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, streamsIdUse this method to get details about a stream.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByUse this method to list streams in a project and location.
createinsertprojectsId, locationsIdstreamId, requestId, validateOnly, forceUse this method to create a stream.
patchupdateprojectsId, locationsId, streamsIdupdateMask, requestId, validateOnly, forceUse this method to update the configuration of a stream.
deletedeleteprojectsId, locationsId, streamsIdrequestIdUse this method to delete a stream.
runexecprojectsId, locationsId, streamsIdUse this method to start, resume or recover a stream with a non default CDC strategy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
streamsIdstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
streamIdstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Use this method to get details about a stream.

SELECT
name,
backfillAll,
backfillNone,
createTime,
customerManagedEncryptionKey,
destinationConfig,
displayName,
errors,
labels,
lastRecoveryTime,
satisfiesPzi,
satisfiesPzs,
sourceConfig,
state,
updateTime
FROM google.datastream.streams
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND streamsId = '{{ streamsId }}' -- required;

INSERT examples

Use this method to create a stream.

INSERT INTO google.datastream.streams (
data__labels,
data__displayName,
data__sourceConfig,
data__destinationConfig,
data__state,
data__backfillAll,
data__backfillNone,
data__customerManagedEncryptionKey,
projectsId,
locationsId,
streamId,
requestId,
validateOnly,
force
)
SELECT
'{{ labels }}',
'{{ displayName }}',
'{{ sourceConfig }}',
'{{ destinationConfig }}',
'{{ state }}',
'{{ backfillAll }}',
'{{ backfillNone }}',
'{{ customerManagedEncryptionKey }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ streamId }}',
'{{ requestId }}',
'{{ validateOnly }}',
'{{ force }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Use this method to update the configuration of a stream.

UPDATE google.datastream.streams
SET
data__labels = '{{ labels }}',
data__displayName = '{{ displayName }}',
data__sourceConfig = '{{ sourceConfig }}',
data__destinationConfig = '{{ destinationConfig }}',
data__state = '{{ state }}',
data__backfillAll = '{{ backfillAll }}',
data__backfillNone = '{{ backfillNone }}',
data__customerManagedEncryptionKey = '{{ customerManagedEncryptionKey }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND streamsId = '{{ streamsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
AND validateOnly = {{ validateOnly}}
AND force = {{ force}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Use this method to delete a stream.

DELETE FROM google.datastream.streams
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND streamsId = '{{ streamsId }}' --required
AND requestId = '{{ requestId }}';

Lifecycle Methods

Use this method to start, resume or recover a stream with a non default CDC strategy.

EXEC google.datastream.streams.run 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@streamsId='{{ streamsId }}' --required
@@json=
'{
"cdcStrategy": "{{ cdcStrategy }}",
"force": {{ force }}
}';