- [HTTP request](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#body.aspect_1)
- [CdcStrategy](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#CdcStrategy)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#CdcStrategy.SCHEMA_REPRESENTATION)
- [MostRecentStartPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MostRecentStartPosition)
- [NextAvailableStartPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#NextAvailableStartPosition)
- [SpecificStartPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SpecificStartPosition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SpecificStartPosition.SCHEMA_REPRESENTATION)
- [MysqlLogPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlLogPosition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlLogPosition.SCHEMA_REPRESENTATION)
- [OracleScnPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#OracleScnPosition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#OracleScnPosition.SCHEMA_REPRESENTATION)
- [SqlServerLsnPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SqlServerLsnPosition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SqlServerLsnPosition.SCHEMA_REPRESENTATION)
- [MysqlGtidPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlGtidPosition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlGtidPosition.SCHEMA_REPRESENTATION)
- [MongodbChangeStreamPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MongodbChangeStreamPosition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MongodbChangeStreamPosition.SCHEMA_REPRESENTATION)
- [SpannerChangeStreamPosition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SpannerChangeStreamPosition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SpannerChangeStreamPosition.SCHEMA_REPRESENTATION)
- [Examples](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#examples)
- [Try it!](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#try-it)

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

### HTTP request

Choose a location:
<button value="global" default="">global</button> <button value="africa-south1">africa-south1</button> <button value="asia-east1">asia-east1</button> <button value="asia-east2">asia-east2</button> <button value="asia-northeast1">asia-northeast1</button> <button value="asia-northeast2">asia-northeast2</button> <button value="asia-northeast3">asia-northeast3</button> <button value="asia-south1">asia-south1</button> <button value="asia-south2">asia-south2</button> <button value="asia-southeast1">asia-southeast1</button> <button value="asia-southeast2">asia-southeast2</button> <button value="asia-southeast3">asia-southeast3</button> <button value="australia-southeast1">australia-southeast1</button> <button value="australia-southeast2">australia-southeast2</button> <button value="europe-central2">europe-central2</button> <button value="europe-north1">europe-north1</button> <button value="europe-north2">europe-north2</button> <button value="europe-southwest1">europe-southwest1</button> <button value="europe-west1">europe-west1</button> <button value="europe-west10">europe-west10</button> <button value="europe-west12">europe-west12</button> <button value="europe-west15">europe-west15</button> <button value="europe-west2">europe-west2</button> <button value="europe-west3">europe-west3</button> <button value="europe-west4">europe-west4</button> <button value="europe-west6">europe-west6</button> <button value="europe-west8">europe-west8</button> <button value="europe-west9">europe-west9</button> <button value="me-central1">me-central1</button> <button value="me-central2">me-central2</button> <button value="me-west1">me-west1</button> <button value="northamerica-northeast1">northamerica-northeast1</button> <button value="northamerica-northeast2">northamerica-northeast2</button> <button value="northamerica-south1">northamerica-south1</button> <button value="southamerica-east1">southamerica-east1</button> <button value="southamerica-west1">southamerica-west1</button> <button value="us-central1">us-central1</button> <button value="us-east1">us-east1</button> <button value="us-east4">us-east4</button> <button value="us-east5">us-east5</button> <button value="us-east7">us-east7</button> <button value="us-south1">us-south1</button> <button value="us-west1">us-west1</button> <button value="us-west2">us-west2</button> <button value="us-west3">us-west3</button> <button value="us-west4">us-west4</button>   
`POST https://datastream.googleapis.com/v1/{name}:run`

<br />

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` 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 (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#CdcStrategy`) }, "force": boolean } ``` |

| Fields ||
|---|---|
| `cdcStrategy` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#CdcStrategy`)`` Optional. The CDC strategy of the stream. If not set, the system's default value will be used. |
| `force` | `boolean` Optional. Update the stream without validating it. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/cloud-datastream
  `

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `datastream.streams.update`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## CdcStrategy

The strategy that the stream uses for CDC replication.

| JSON representation |
|---|
| ``` { // Union field `start_position` can be only one of the following: "mostRecentStartPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MostRecentStartPosition`) }, "nextAvailableStartPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#NextAvailableStartPosition`) }, "specificStartPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SpecificStartPosition`) } // End of list of possible types for union field `start_position`. } ``` |

| Fields ||
|---|---|
| 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 (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MostRecentStartPosition`)`` Optional. Start replicating from the most recent position in the source. |
| `nextAvailableStartPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#NextAvailableStartPosition`)`` Optional. Resume replication from the next available position in the source. |
| `specificStartPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#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 `position` can be only one of the following: "mysqlLogPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlLogPosition`) }, "oracleScnPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#OracleScnPosition`) }, "sqlServerLsnPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SqlServerLsnPosition`) }, "mysqlGtidPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlGtidPosition`) }, "mongodbChangeStreamPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MongodbChangeStreamPosition`) }, "spannerChangeStreamPosition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SpannerChangeStreamPosition`) } // End of list of possible types for union field `position`. } ``` |

| Fields ||
|---|---|
| Union field `position`. `position` can be only one of the following: ||
| `mysqlLogPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlLogPosition`)`` MySQL specific log position to start replicating from. |
| `oracleScnPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#OracleScnPosition`)`` Oracle SCN to start replicating from. |
| `sqlServerLsnPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SqlServerLsnPosition`)`` SqlServer LSN to start replicating from. |
| `mysqlGtidPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MysqlGtidPosition`)`` MySQL GTID set to start replicating from. |
| `mongodbChangeStreamPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#MongodbChangeStreamPosition`)`` MongoDB change stream position to start replicating from. |
| `spannerChangeStreamPosition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.streams/run#SpannerChangeStreamPosition`)`` Optional. Spanner change stream position to start replicating from. |

## MysqlLogPosition

MySQL log position

| JSON representation |
|---|
| ``` { "logFile": string, "logPosition": integer } ``` |

| Fields ||
|---|---|
| `logFile` | `string` Required. The binary log file name. |
| `logPosition` | `integer` Optional. The position within the binary log file. Default is head of file. |

## OracleScnPosition

Oracle SCN position

| JSON representation |
|---|
| ``` { "scn": string } ``` |

| Fields ||
|---|---|
| `scn` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. SCN number from where Logs will be read |

## SqlServerLsnPosition

SQL Server LSN position

| JSON representation |
|---|
| ``` { "lsn": string } ``` |

| Fields ||
|---|---|
| `lsn` | `string` Required. Log sequence number (LSN) from where Logs will be read |

## MysqlGtidPosition

MySQL GTID position

| JSON representation |
|---|
| ``` { "gtidSet": string } ``` |

| Fields ||
|---|---|
| `gtidSet` | `string` Required. The gtid set to start replication from. |

## MongodbChangeStreamPosition

MongoDB change stream position

| JSON representation |
|---|
| ``` { "startTime": string } ``` |

| Fields ||
|---|---|
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` 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: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## SpannerChangeStreamPosition

Represents a position in a Spanner change stream from which to start replicating.

| JSON representation |
|---|
| ``` { "startTime": string } ``` |

| Fields ||
|---|---|
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Required. The timestamp to start change stream queries from. The timestamp must be a positive value. 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: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |