workspace_bindings
Creates, updates, deletes, gets or lists a workspace_bindings resource.
Overview
| Name | workspace_bindings |
| Type | Resource |
| Id | databricks_workspace.catalog.workspace_bindings |
Fields
The following fields are returned by SELECT queries:
- get_bindings
- get
| Name | Datatype | Description |
|---|---|---|
workspace_id | integer | |
binding_type | string | One of READ_WRITE/READ_ONLY. Default is READ_WRITE. (BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE) |
| Name | Datatype | Description |
|---|---|---|
workspaces | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_bindings | select | securable_type, securable_name, deployment_name | max_results, page_token | Gets workspace bindings of the securable. The caller must be a metastore admin or an owner of the |
get | select | name, deployment_name | Gets workspace bindings of the catalog. The caller must be a metastore admin or an owner of the | |
update_bindings | update | securable_type, securable_name, deployment_name | Updates workspace bindings of the securable. The caller must be a metastore admin or an owner of the | |
update | update | name, deployment_name | Updates workspace bindings of the catalog. The caller must be a metastore admin or an owner of the |
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) |
name | string | The name of the catalog. |
securable_name | string | The name of the securable. |
securable_type | string | The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). |
max_results | integer | Maximum number of workspace bindings to return. - When set to 0, the page length is set to a server configured value (recommended); - When set to a value greater than 0, the page length is the minimum of this value and a server configured value; - When set to a value less than 0, an invalid parameter error is returned; - If not set, all the workspace bindings are returned (not recommended). |
page_token | string | Opaque pagination token to go to next page based on previous query. |
SELECT examples
- get_bindings
- get
Gets workspace bindings of the securable. The caller must be a metastore admin or an owner of the
SELECT
workspace_id,
binding_type
FROM databricks_workspace.catalog.workspace_bindings
WHERE securable_type = '{{ securable_type }}' -- required
AND securable_name = '{{ securable_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
;
Gets workspace bindings of the catalog. The caller must be a metastore admin or an owner of the
SELECT
workspaces
FROM databricks_workspace.catalog.workspace_bindings
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
UPDATE examples
- update_bindings
- update
Updates workspace bindings of the securable. The caller must be a metastore admin or an owner of the
UPDATE databricks_workspace.catalog.workspace_bindings
SET
add = '{{ add }}',
remove = '{{ remove }}'
WHERE
securable_type = '{{ securable_type }}' --required
AND securable_name = '{{ securable_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
bindings;
Updates workspace bindings of the catalog. The caller must be a metastore admin or an owner of the
UPDATE databricks_workspace.catalog.workspace_bindings
SET
assign_workspaces = '{{ assign_workspaces }}',
unassign_workspaces = '{{ unassign_workspaces }}'
WHERE
name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
workspaces;