> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GCP Datastream CLI

> Start, pause, or resume Google Cloud Datastream change data capture streams and list them from Paradime Bolt with the paradime run gcp-datastream CLI commands.

The Paradime SDK provides CLI commands to interact with GCP Datastream, allowing you to start, pause, or resume Datastream streams and list available streams with real-time monitoring capabilities.

<Warning>
  🔑 **API Access Required**

  You will need a GCP service account JSON key file with permissions to manage and list Datastream streams. The service account key file path, project ID, and location can be provided as flags or set via environment variables.

  **🔧 Stream Configuration**

  * Ensure the target Datastream streams exist in the specified project and region.
  * Confirm the service account has the necessary permissions to start, pause, resume, and list streams.
  * Verify that the location matches the region where your streams are configured.
</Warning>

## Start, Pause, or Resume Datastream Streams

Start, pause, or resume Datastream streams by display name.

### CLI Command

```bash theme={"system"}
paradime run gcp-datastream-trigger
```

#### Options

| Flag                         | Type              | Description                                                                                                                                                   |
| ---------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--service-account-key-file` | Required, TEXT    | Path to your GCP service account JSON key file. Can be set via `GCP_SERVICE_ACCOUNT_KEY_FILE` environment variable.                                           |
| `--project`                  | Required, TEXT    | Your GCP project ID. Can be set via `GCP_PROJECT_ID` environment variable.                                                                                    |
| `--location`                 | Required, TEXT    | GCP region (e.g. 'us-central1'). Can be set via `GCP_LOCATION` environment variable.                                                                          |
| `--stream-names`             | Required, TEXT    | Comma-separated Datastream stream display name(s) to manage.                                                                                                  |
| `--action`                   | Optional, CHOICE  | Action to perform on the stream(s). Choices: `start`, `pause`, `resume`. Default: `start`.                                                                    |
| `--wait` / `--no-wait`       | Optional, Flag    | Wait for the state change to complete before returning. Default: `--wait`. Can be set via `GCP_DATASTREAM_TRIGGER_WAIT` environment variable.                 |
| `--timeout`                  | Optional, INTEGER | Maximum time to wait for completion (in minutes). Only used with `--wait`. Default: 60. Can be set via `GCP_DATASTREAM_TRIGGER_TIMEOUT` environment variable. |
| `--help`                     | Optional, Flag    | Show the help message and exit.                                                                                                                               |

<Info>
  **Recommended Setup**

  For security and convenience, set your GCP credentials as environment variables:

  ```bash theme={"system"}
  GCP_SERVICE_ACCOUNT_KEY_FILE="/path/to/service-account-key.json"
  GCP_PROJECT_ID="your-gcp-project-id"
  GCP_LOCATION="us-central1"
  ```
</Info>

### Examples

```bash theme={"system"}
# Start a single stream (using environment variables)
paradime run gcp-datastream-trigger \
  --stream-names "orders-cdc-stream" \
  --action start

# Pause multiple streams (comma-separated)
paradime run gcp-datastream-trigger \
  --stream-names "orders-cdc-stream,customers-cdc-stream" \
  --action pause
```

## List Datastream Streams

List all Datastream streams in the specified project and region.

### CLI Command

```bash theme={"system"}
paradime run gcp-datastream-list
```

#### Options

| Flag                         | Type           | Description                                                                                                         |
| ---------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------- |
| `--service-account-key-file` | Required, TEXT | Path to your GCP service account JSON key file. Can be set via `GCP_SERVICE_ACCOUNT_KEY_FILE` environment variable. |
| `--project`                  | Required, TEXT | Your GCP project ID. Can be set via `GCP_PROJECT_ID` environment variable.                                          |
| `--location`                 | Required, TEXT | GCP region (e.g. 'us-central1'). Can be set via `GCP_LOCATION` environment variable.                                |
| `--help`                     | Optional, Flag | Show the help message and exit.                                                                                     |

### Usage Examples

```bash theme={"system"}
# List all streams (using environment variables)
paradime run gcp-datastream-list

# With explicit credentials
paradime run gcp-datastream-list \
  --service-account-key-file "/path/to/service-account-key.json" \
  --project "your-gcp-project-id" \
  --location "us-central1"
```

## Environment Variable Reference

| Environment Variable             | Description                                    |
| -------------------------------- | ---------------------------------------------- |
| `GCP_SERVICE_ACCOUNT_KEY_FILE`   | Path to your GCP service account JSON key file |
| `GCP_PROJECT_ID`                 | Your GCP project ID                            |
| `GCP_LOCATION`                   | GCP region (e.g. 'us-central1')                |
| `GCP_DATASTREAM_TRIGGER_WAIT`    | Whether to wait for the state change           |
| `GCP_DATASTREAM_TRIGGER_TIMEOUT` | Maximum time to wait for completion (minutes)  |

## Workflow Integration

These GCP Datastream CLI commands are designed to integrate seamlessly into your data pipeline workflows. For more information about integrating them into your Paradime workflows, see the [Bolt Schedules documentation.](/products/bolt/index)


## Related topics

- [GCP Dataproc CLI](/developers/paradime-cli/gcp-dataproc-cli.md)
- [GCP Dataflow CLI](/developers/paradime-cli/gcp-dataflow-cli.md)
- [GCP Cloud Function CLI](/developers/paradime-cli/gcp-cloud-function-cli.md)
- [GCP Cloud Run CLI](/developers/paradime-cli/gcp-cloud-run-cli.md)
- [GCP BigQuery Data Transfer CLI](/developers/paradime-cli/gcp-bigquery-transfer-cli.md)
