# Snapshot

- [JSON representation](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#SCHEMA_REPRESENTATION)
- [SnapshotState](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#SnapshotState)
- [PubsubSnapshotMetadata](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#PubsubSnapshotMetadata)
  - [JSON representation](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#PubsubSnapshotMetadata.SCHEMA_REPRESENTATION)

Represents a snapshot of a job.

| JSON representation |
|---|
| ``` { "id": string, "projectId": string, "sourceJobId": string, "creationTime": string, "ttl": string, "state": enum (`https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#SnapshotState`), "pubsubMetadata": [ { object (`https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#PubsubSnapshotMetadata`) } ], "description": string, "diskSizeBytes": string, "region": string } ``` |

| Fields ||
|---|---|
| `id` | `string` The unique ID of this snapshot. |
| `projectId` | `string` The project this snapshot belongs to. |
| `sourceJobId` | `string` The job this snapshot was created from. |
| `creationTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The time this snapshot was created. 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"`. |
| `ttl` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` The time after which this snapshot will be automatically deleted. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `state` | ``enum (`https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#SnapshotState`)`` State of the snapshot. |
| `pubsubMetadata[]` | ``object (`https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/Snapshot#PubsubSnapshotMetadata`)`` Pub/Sub snapshot metadata. |
| `description` | `string` User specified description of the snapshot. Maybe empty. |
| `diskSizeBytes` | `string (https://developers.google.com/discovery/v1/type-format format)` The disk byte size of the snapshot. Only available for snapshots in READY state. |
| `region` | `string` Cloud region where this snapshot lives in, e.g., "us-central1". |

## SnapshotState

Snapshot state.

| Enums ||
|---|---|
| `UNKNOWN_SNAPSHOT_STATE` | Unknown state. |
| `PENDING` | Snapshot intent to create has been persisted, snapshotting of state has not yet started. |
| `RUNNING` | Snapshotting is being performed. |
| `READY` | Snapshot has been created and is ready to be used. |
| `FAILED` | Snapshot failed to be created. |
| `DELETED` | Snapshot has been deleted. |

## PubsubSnapshotMetadata

Represents a Pubsub snapshot.

| JSON representation |
|---|
| ``` { "topicName": string, "snapshotName": string, "expireTime": string } ``` |

| Fields ||
|---|---|
| `topicName` | `string` The name of the Pubsub topic. |
| `snapshotName` | `string` The name of the Pubsub snapshot. |
| `expireTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The expire time of the Pubsub snapshot. 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"`. |