Skip to main content

streams

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

Overview

Namestreams
TypeResource
Idgoogle.datastream.streams

Fields

NameDatatypeDescription
namestringOutput only. The stream's name.
backfillAllobjectBackfill strategy to automatically backfill the Stream's objects. Specific objects can be excluded.
backfillNoneobjectBackfill strategy to disable automatic backfill for the Stream's objects.
createTimestringOutput 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.
destinationConfigobjectThe configuration of the stream destination.
displayNamestringRequired. Display name.
errorsarrayOutput only. Errors on the Stream.
labelsobjectLabels.
lastRecoveryTimestringOutput only. If the stream was recovered, the time of the last recovery. Note: This field is currently experimental.
sourceConfigobjectThe configuration of the stream source.
statestringThe state of the stream.
updateTimestringOutput only. The last update time of the stream.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, streamsIdUse this method to get details about a stream.
listSELECTlocationsId, projectsIdUse this method to list streams in a project and location.
createINSERTlocationsId, projectsIdUse this method to create a stream.
deleteDELETElocationsId, projectsId, streamsIdUse this method to delete a stream.
patchUPDATElocationsId, projectsId, streamsIdUse this method to update the configuration of a stream.
runEXEClocationsId, projectsId, streamsIdUse this method to start, resume or recover a stream with a non default CDC strategy.

SELECT examples

Use this method to list streams in a project and location.

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

INSERT example

Use the following StackQL query and manifest file to create a new streams resource.

/*+ create */
INSERT INTO google.datastream.streams (
locationsId,
projectsId,
labels,
displayName,
sourceConfig,
destinationConfig,
state,
backfillAll,
backfillNone,
customerManagedEncryptionKey
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ labels }}',
'{{ displayName }}',
'{{ sourceConfig }}',
'{{ destinationConfig }}',
'{{ state }}',
'{{ backfillAll }}',
'{{ backfillNone }}',
'{{ customerManagedEncryptionKey }}'
;

UPDATE example

Updates a streams resource.

/*+ update */
UPDATE google.datastream.streams
SET
labels = '{{ labels }}',
displayName = '{{ displayName }}',
sourceConfig = '{{ sourceConfig }}',
destinationConfig = '{{ destinationConfig }}',
state = '{{ state }}',
backfillAll = '{{ backfillAll }}',
backfillNone = '{{ backfillNone }}',
customerManagedEncryptionKey = '{{ customerManagedEncryptionKey }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND streamsId = '{{ streamsId }}';

DELETE example

Deletes the specified streams resource.

/*+ delete */
DELETE FROM google.datastream.streams
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND streamsId = '{{ streamsId }}';