Share via


workspace-entity-tag-assignments command group

Note

This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.

Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.

The workspace-entity-tag-assignments command group within the Databricks CLI contains commands to manage tag assignments on workspace-scoped objects.

databricks workspace-entity-tag-assignments create-tag-assignment

Create a tag assignment for a workspace-scoped object.

databricks workspace-entity-tag-assignments create-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY [flags]

Arguments

ENTITY_TYPE

    The type of entity to which the tag is assigned. Allowed values are: dashboards, geniespaces.

ENTITY_ID

    The identifier of the entity to which the tag is assigned.

TAG_KEY

    The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body

--tag-value string

    The value of the tag.

Global flags

Examples

The following example creates a tag assignment for a dashboard:

databricks workspace-entity-tag-assignments create-tag-assignment dashboards abc123def456 environment --tag-value production

The following example creates a tag assignment for a Genie space:

databricks workspace-entity-tag-assignments create-tag-assignment geniespaces xyz789 department --tag-value engineering

The following example creates a tag assignment using JSON:

databricks workspace-entity-tag-assignments create-tag-assignment dashboards abc123def456 project --json '{"tag_value": "analytics"}'

databricks workspace-entity-tag-assignments delete-tag-assignment

Delete a tag assignment from a workspace-scoped object.

databricks workspace-entity-tag-assignments delete-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY [flags]

Arguments

ENTITY_TYPE

    The type of entity to which the tag is assigned. Allowed values are: dashboards, geniespaces.

ENTITY_ID

    The identifier of the entity to which the tag is assigned.

TAG_KEY

    The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed.

Options

Global flags

Examples

The following example deletes a tag assignment from a dashboard:

databricks workspace-entity-tag-assignments delete-tag-assignment dashboards abc123def456 environment

The following example deletes a tag assignment from a Genie space:

databricks workspace-entity-tag-assignments delete-tag-assignment geniespaces xyz789 department

databricks workspace-entity-tag-assignments get-tag-assignment

Retrieves a tag assignment for a workspace-scoped object.

databricks workspace-entity-tag-assignments get-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY [flags]

Arguments

ENTITY_TYPE

    The type of entity to which the tag is assigned. Allowed values are: dashboards, geniespaces.

ENTITY_ID

    The identifier of the entity to which the tag is assigned.

TAG_KEY

    The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed.

Options

Global flags

Examples

The following example gets a tag assignment for a dashboard:

databricks workspace-entity-tag-assignments get-tag-assignment dashboards abc123def456 environment

The following example gets a tag assignment for a Genie space:

databricks workspace-entity-tag-assignments get-tag-assignment geniespaces xyz789 department

databricks workspace-entity-tag-assignments list-tag-assignments

List all tag assignments for a workspace-scoped object.

databricks workspace-entity-tag-assignments list-tag-assignments ENTITY_TYPE ENTITY_ID [flags]

Arguments

ENTITY_TYPE

    The type of entity to which the tag is assigned. Allowed values are: dashboards, geniespaces.

ENTITY_ID

    The identifier of the entity to which the tag is assigned.

Options

--page-size int

    Maximum number of tag assignments to return per page.

--page-token string

    Token to retrieve the next page of results.

Global flags

Examples

The following example lists all tag assignments for a dashboard:

databricks workspace-entity-tag-assignments list-tag-assignments dashboards abc123def456

The following example lists tag assignments with pagination:

databricks workspace-entity-tag-assignments list-tag-assignments dashboards abc123def456 --page-size 10

databricks workspace-entity-tag-assignments update-tag-assignment

Update a tag assignment for a workspace-scoped object.

databricks workspace-entity-tag-assignments update-tag-assignment ENTITY_TYPE ENTITY_ID TAG_KEY UPDATE_MASK [flags]

Arguments

ENTITY_TYPE

    The type of entity to which the tag is assigned. Allowed values are: dashboards, geniespaces.

ENTITY_ID

    The identifier of the entity to which the tag is assigned.

TAG_KEY

    The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed.

UPDATE_MASK

    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.

    An asterisk (*) field mask 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.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body

--tag-value string

    The value of the tag.

Global flags

Examples

The following example updates a tag assignment for a dashboard:

databricks workspace-entity-tag-assignments update-tag-assignment dashboards abc123def456 environment "tag_value" --tag-value staging

The following example updates a tag assignment using JSON:

databricks workspace-entity-tag-assignments update-tag-assignment geniespaces xyz789 department "tag_value" --json '{"tag_value": "sales"}'

Global flags

--debug

  Whether to enable debug logging.

-h or --help

    Display help for the Databricks CLI or the related command group or the related command.

--log-file string

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

--log-format format

    The log format type, text or json. The default value is text.

--log-level string

    A string representing the log format level. If not specified then the log format level is disabled.

-o, --output type

    The command output type, text or json. The default value is text.

-p, --profile string

    The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.

--progress-format format

    The format to display progress logs: default, append, inplace, or json

-t, --target string

    If applicable, the bundle target to use