entity_tag_assignments
Creates, updates, deletes, gets or lists an entity_tag_assignments resource.
Overview
| Name | entity_tag_assignments |
| Type | Resource |
| Id | databricks_workspace.catalog.entity_tag_assignments |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
entity_name | string | The fully qualified name of the entity to which the tag is assigned |
entity_type | string | The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes. |
tag_key | string | The key of the tag |
tag_value | string | The value of the tag |
| Name | Datatype | Description |
|---|---|---|
entity_name | string | The fully qualified name of the entity to which the tag is assigned |
entity_type | string | The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes. |
tag_key | string | The key of the tag |
tag_value | string | The value of the tag |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | entity_type, entity_name, tag_key, deployment_name | Gets a tag assignment for an Unity Catalog entity by tag key. | |
list | select | entity_type, entity_name, deployment_name | max_results, page_token | List tag assignments for an Unity Catalog entity |
create | insert | deployment_name, tag_assignment | Creates a tag assignment for an Unity Catalog entity. | |
update | update | entity_type, entity_name, tag_key, update_mask, deployment_name, tag_assignment | Updates an existing tag assignment for an Unity Catalog entity. | |
delete | delete | entity_type, entity_name, tag_key, deployment_name | Deletes a tag assignment for an Unity Catalog entity by its key. |
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) |
entity_name | string | The fully qualified name of the entity to which the tag is assigned |
entity_type | string | The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables, columns, volumes. |
tag_key | string | Required. The key of the tag to delete |
update_mask | string | |
max_results | integer | Optional. Maximum number of tag assignments to return in a single page |
page_token | string | Optional. Pagination token to retrieve the next page of results |
SELECT examples
- get
- list
Gets a tag assignment for an Unity Catalog entity by tag key.
SELECT
entity_name,
entity_type,
tag_key,
tag_value
FROM databricks_workspace.catalog.entity_tag_assignments
WHERE entity_type = '{{ entity_type }}' -- required
AND entity_name = '{{ entity_name }}' -- required
AND tag_key = '{{ tag_key }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
List tag assignments for an Unity Catalog entity
SELECT
entity_name,
entity_type,
tag_key,
tag_value
FROM databricks_workspace.catalog.entity_tag_assignments
WHERE entity_type = '{{ entity_type }}' -- required
AND entity_name = '{{ entity_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a tag assignment for an Unity Catalog entity.
INSERT INTO databricks_workspace.catalog.entity_tag_assignments (
tag_assignment,
deployment_name
)
SELECT
'{{ tag_assignment }}' /* required */,
'{{ deployment_name }}'
RETURNING
entity_name,
entity_type,
tag_key,
tag_value
;
# Description fields are for documentation purposes
- name: entity_tag_assignments
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the entity_tag_assignments resource.
- name: tag_assignment
description: |
:returns: :class:`EntityTagAssignment`
value:
entity_name: "{{ entity_name }}"
tag_key: "{{ tag_key }}"
entity_type: "{{ entity_type }}"
tag_value: "{{ tag_value }}"
UPDATE examples
- update
Updates an existing tag assignment for an Unity Catalog entity.
UPDATE databricks_workspace.catalog.entity_tag_assignments
SET
tag_assignment = '{{ tag_assignment }}'
WHERE
entity_type = '{{ entity_type }}' --required
AND entity_name = '{{ entity_name }}' --required
AND tag_key = '{{ tag_key }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND tag_assignment = '{{ tag_assignment }}' --required
RETURNING
entity_name,
entity_type,
tag_key,
tag_value;
DELETE examples
- delete
Deletes a tag assignment for an Unity Catalog entity by its key.
DELETE FROM databricks_workspace.catalog.entity_tag_assignments
WHERE entity_type = '{{ entity_type }}' --required
AND entity_name = '{{ entity_name }}' --required
AND tag_key = '{{ tag_key }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;