projects
Creates, updates, deletes, gets or lists a projects resource.
Overview
| Name | projects |
| Type | Resource |
| Id | databricks_workspace.postgres.projects |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The full resource path of the project. Format: projects/{project_id} |
create_time | string (date-time) | |
initial_endpoint_spec | object | Configuration settings for the initial Read/Write endpoint created inside the default branch for a newly created project. If omitted, the initial endpoint created will have default settings, without high availability configured. This field does not apply to any endpoints created after project creation. Use spec.default_endpoint_settings to configure default settings for endpoints created after project creation. |
spec | object | The spec contains the project configuration, including display_name, pg_version (Postgres version), history_retention_duration, and default_endpoint_settings. |
status | object | The current status of a Project. |
uid | string | System-generated unique ID for the project. |
update_time | string (date-time) | A timestamp indicating when the project was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | deployment_name | page_size, page_token | Returns a paginated list of database projects in the workspace that the user has permission to access. |
create | insert | project_id, deployment_name, project | Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute | |
update | update | project_id, branch_id, role_id, update_mask, deployment_name, role | Update a role for a branch. |
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 |
|---|---|---|
branch_id | string | The unique identifier of the branch. Format: projects/{project_id}/branches/{branch_id} |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
project_id | string | The unique identifier of the Postgres project. Format: projects/{project_id} |
role_id | string | The unique identifier of the role to update. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} |
update_mask | object | The list of fields to update in Postgres Role. If unspecified, all fields will be updated when possible. |
page_size | integer | Upper bound for items returned. Cannot be negative. The maximum value is 100. |
page_token | string | Page token from a previous response. If not provided, returns the first page. |
SELECT examples
- list
Returns a paginated list of database projects in the workspace that the user has permission to access.
SELECT
name,
create_time,
initial_endpoint_spec,
spec,
status,
uid,
update_time
FROM databricks_workspace.postgres.projects
WHERE deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute
INSERT INTO databricks_workspace.postgres.projects (
project,
project_id,
deployment_name
)
SELECT
'{{ project }}' /* required */,
'{{ project_id }}',
'{{ deployment_name }}'
;
# Description fields are for documentation purposes
- name: projects
props:
- name: project_id
value: "{{ project_id }}"
description: Required parameter for the projects resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the projects resource.
- name: project
description: |
The Project to create.
value:
create_time: "{{ create_time }}"
initial_endpoint_spec:
group:
min: {{ min }}
max: {{ max }}
enable_readable_secondaries: {{ enable_readable_secondaries }}
name: "{{ name }}"
spec:
budget_policy_id: "{{ budget_policy_id }}"
custom_tags:
- key: "{{ key }}"
value: "{{ value }}"
default_endpoint_settings:
autoscaling_limit_max_cu: {{ autoscaling_limit_max_cu }}
autoscaling_limit_min_cu: {{ autoscaling_limit_min_cu }}
no_suspension: {{ no_suspension }}
pg_settings: "{{ pg_settings }}"
suspend_timeout_duration: "{{ suspend_timeout_duration }}"
display_name: "{{ display_name }}"
enable_pg_native_login: {{ enable_pg_native_login }}
history_retention_duration: "{{ history_retention_duration }}"
pg_version: {{ pg_version }}
status:
branch_logical_size_limit_bytes: {{ branch_logical_size_limit_bytes }}
budget_policy_id: "{{ budget_policy_id }}"
custom_tags:
- key: "{{ key }}"
value: "{{ value }}"
default_endpoint_settings:
autoscaling_limit_max_cu: {{ autoscaling_limit_max_cu }}
autoscaling_limit_min_cu: {{ autoscaling_limit_min_cu }}
no_suspension: {{ no_suspension }}
pg_settings: "{{ pg_settings }}"
suspend_timeout_duration: "{{ suspend_timeout_duration }}"
display_name: "{{ display_name }}"
enable_pg_native_login: {{ enable_pg_native_login }}
history_retention_duration: "{{ history_retention_duration }}"
owner: "{{ owner }}"
pg_version: {{ pg_version }}
synthetic_storage_size_bytes: {{ synthetic_storage_size_bytes }}
uid: "{{ uid }}"
update_time: "{{ update_time }}"
UPDATE examples
- update
Update a role for a branch.
UPDATE databricks_workspace.postgres.projects
SET
role = '{{ role }}'
WHERE
project_id = '{{ project_id }}' --required
AND branch_id = '{{ branch_id }}' --required
AND role_id = '{{ role_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND role = '{{ role }}' --required;