- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- CdcStrategy
- MostRecentStartPosition
- NextAvailableStartPosition
- SpecificStartPosition
- MysqlLogPosition
- OracleScnPosition
- SqlServerLsnPosition
- MysqlGtidPosition
- MongodbChangeStreamPosition
- Examples
- Try it!
Use this method to start, resume or recover a stream with a non default CDC strategy.
HTTP request
POST https://datastream.googleapis.com/v1/{name}:run
Path parameters
Parameters | |
---|---|
name
|
Required. Name of the stream resource to start, in the format: projects/{projectId}/locations/{location}/streams/{stream_name} |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"cdcStrategy"
:
{
object (
|
Fields | |
---|---|
cdcStrategy
|
Optional. The CDC strategy of the stream. If not set, the system's default value will be used. |
force
|
Optional. Update the stream without validating it. |
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
-
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview .
IAM Permissions
Requires the following IAM
permission on the name
resource:
-
datastream.streams.update
For more information, see the IAM documentation .
CdcStrategy
The strategy that the stream uses for CDC replication.
JSON representation |
---|
{ // Union field |
start_position
. The position to start reading from when starting, resuming, or recovering the stream. If not set, the system's default value will be used. start_position
can be only one of the following:mostRecentStartPosition
object (
MostRecentStartPosition
)
Optional. Start replicating from the most recent position in the source.
nextAvailableStartPosition
object (
NextAvailableStartPosition
)
Optional. Resume replication from the next available position in the source.
specificStartPosition
object (
SpecificStartPosition
)
Optional. Start replicating from a specific position in the source.
MostRecentStartPosition
This type has no fields.
CDC strategy to start replicating from the most recent position in the source.
NextAvailableStartPosition
This type has no fields.
CDC strategy to resume replication from the next available position in the source.
SpecificStartPosition
CDC strategy to start replicating from a specific position in the source.
JSON representation |
---|
{ // Union field |
Union field position
.
position
can be only one of the following:
mysqlLogPosition
object (
MysqlLogPosition
)
MySQL specific log position to start replicating from.
oracleScnPosition
object (
OracleScnPosition
)
Oracle SCN to start replicating from.
sqlServerLsnPosition
object (
SqlServerLsnPosition
)
SqlServer LSN to start replicating from.
mysqlGtidPosition
object (
MysqlGtidPosition
)
MySQL GTID set to start replicating from.
mongodbChangeStreamPosition
object (
MongodbChangeStreamPosition
)
MongoDB change stream position to start replicating from.
MysqlLogPosition
MySQL log position
JSON representation |
---|
{ "logFile" : string , "logPosition" : integer } |
Fields | |
---|---|
logFile
|
Required. The binary log file name. |
logPosition
|
Optional. The position within the binary log file. Default is head of file. |
OracleScnPosition
Oracle SCN position
JSON representation |
---|
{ "scn" : string } |
Fields | |
---|---|
scn
|
Required. SCN number from where Logs will be read |
SqlServerLsnPosition
SQL Server LSN position
JSON representation |
---|
{ "lsn" : string } |
Fields | |
---|---|
lsn
|
Required. Log sequence number (LSN) from where Logs will be read |
MysqlGtidPosition
MySQL GTID position
JSON representation |
---|
{ "gtidSet" : string } |
Fields | |
---|---|
gtidSet
|
Required. The gtid set to start replication from. |
MongodbChangeStreamPosition
MongoDB change stream position
JSON representation |
---|
{ "startTime" : string } |
Fields | |
---|---|
startTime
|
Required. The timestamp to start change stream from. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |