postgres_snapshots
Creates, updates, deletes, gets or lists a postgres_snapshots resource.
Overview
| Name | postgres_snapshots |
| Type | Resource |
| Id | databricks_workspace.postgres.postgres_snapshots |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
name | string | The resource name of the snapshot. Format: projects/{project_id}/snapshots/{snapshot_id} |
snapshot_id | string | The user-chosen ID; the final segment of ``name``. |
create_time | string (date-time) | When the snapshot was created. |
spec | object | Client-provided configuration of the snapshot. |
status | object | Server-observed state of the snapshot. |
uid | string | Unique system-generated ID for the snapshot. |
update_time | string (date-time) | When the snapshot was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | parent, deployment_name | page_size, page_token | Returns a paginated list of snapshots in the project. |
create | insert | parent, deployment_name, snapshot | snapshot_id | Creates a snapshot, an immutable point-in-time copy of a branch's data, within the project. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
parent | string | The project in which to create the snapshot. Format: projects/{project_id} |
page_size | integer | Maximum number of snapshots to return per page. |
page_token | string | Page token from a previous response; omit for the first page. |
snapshot_id | string | Client-chosen ID for the snapshot. If omitted, the server generates one. |
SELECT examples
- list
Returns a paginated list of snapshots in the project.
SELECT
name,
snapshot_id,
create_time,
spec,
status,
uid,
update_time
FROM databricks_workspace.postgres.postgres_snapshots
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a snapshot, an immutable point-in-time copy of a branch's data, within the project.
INSERT INTO databricks_workspace.postgres.postgres_snapshots (
snapshot,
parent,
deployment_name,
snapshot_id
)
SELECT
'{{ snapshot }}' /* required */,
'{{ parent }}',
'{{ deployment_name }}',
'{{ snapshot_id }}'
;
# Description fields are for documentation purposes
- name: postgres_snapshots
props:
- name: parent
value: "{{ parent }}"
description: Required parameter for the postgres_snapshots resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the postgres_snapshots resource.
- name: snapshot
description: |
The snapshot to create.
value:
create_time: "{{ create_time }}"
name: "{{ name }}"
snapshot_id: "{{ snapshot_id }}"
spec:
source_branch: "{{ source_branch }}"
expire_time: "{{ expire_time }}"
no_expiry: {{ no_expiry }}
source_branch_lsn: "{{ source_branch_lsn }}"
source_branch_time: "{{ source_branch_time }}"
ttl: "{{ ttl }}"
status:
current_state: "{{ current_state }}"
diff_size_bytes: {{ diff_size_bytes }}
expire_time: "{{ expire_time }}"
full_size_bytes: {{ full_size_bytes }}
no_expiry: {{ no_expiry }}
source_branch: "{{ source_branch }}"
source_branch_lsn: "{{ source_branch_lsn }}"
source_branch_time: "{{ source_branch_time }}"
uid: "{{ uid }}"
update_time: "{{ update_time }}"
- name: snapshot_id
value: "{{ snapshot_id }}"
description: Client-chosen ID for the snapshot. If omitted, the server generates one.
description: Client-chosen ID for the snapshot. If omitted, the server generates one.