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. |
source_type | string | The source type of the tag assignment, e.g., user-assigned or system-assigned (TAG_ASSIGNMENT_SOURCE_TYPE_SYSTEM_DATA_CLASSIFICATION) |
tag_key | string | The key of the tag |
tag_value | string | The value of the tag |
update_time | string (date-time) | The timestamp when the tag assignment was last updated |
updated_by | string | The user or principal who updated the tag assignment |
| 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. |
source_type | string | The source type of the tag assignment, e.g., user-assigned or system-assigned (TAG_ASSIGNMENT_SOURCE_TYPE_SYSTEM_DATA_CLASSIFICATION) |
tag_key | string | The key of the tag |
tag_value | string | The value of the tag |
update_time | string (date-time) | The timestamp when the tag assignment was last updated |
updated_by | string | The user or principal who updated the tag assignment |
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 | The field mask must be a single string, with multiple fields separated by commas (no spaces). The field path is relative to the resource object, using a dot (.) to navigate sub-fields (e.g., author.given_name). Specification of elements in sequence or map fields is not allowed, as only the entire collection field can be specified. Field names must exactly match the resource field names. A field mask of * indicates full replacement. It’s recommended to always explicitly list the fields being updated and avoid using * wildcards, as it can lead to unintended results if the API changes in the future. |
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,
source_type,
tag_key,
tag_value,
update_time,
updated_by
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,
source_type,
tag_key,
tag_value,
update_time,
updated_by
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,
source_type,
tag_key,
tag_value,
update_time,
updated_by
;
# 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: |
Represents a tag assignment to an entity
value:
entity_name: "{{ entity_name }}"
tag_key: "{{ tag_key }}"
entity_type: "{{ entity_type }}"
source_type: "{{ source_type }}"
tag_value: "{{ tag_value }}"
update_time: "{{ update_time }}"
updated_by: "{{ updated_by }}"
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,
source_type,
tag_key,
tag_value,
update_time,
updated_by;
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
;