Share via


clean-room-assets 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 clean-room-assets command group within the Databricks CLI allows you to manage clean room assets. Clean room assets are data and objects such as tables, volumes, and notebooks, that are shared with the clean room. Supported asset types include FOREIGN_TABLE, NOTEBOOK_FILE, TABLE, VIEW, and VOLUME.

databricks clean-room-assets create

Create a clean room asset. For each Unity Catalog asset that is added through this method, the clean room owner must also have enough privilege on the asset to consume it. The privilege must be maintained indefinitely for the clean room to be able to access the asset. Typically, you should use a group as the clean room owner.

databricks clean-room-assets create CLEAN_ROOM_NAME [flags]

Arguments

CLEAN_ROOM_NAME

    Name of the clean room.

Options

--asset-type CleanRoomAssetAssetType

    The type of the asset. Supported values: FOREIGN_TABLE, NOTEBOOK_FILE, TABLE, VIEW, VOLUME

--json JSON

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

--name string

    A fully qualified name that uniquely identifies the asset within the clean room.

Global flags

Examples

The following example creates a table asset in a clean room:

databricks clean-room-assets create my-clean-room --asset-type TABLE --name "catalog.schema.table_name"

The following example creates a notebook asset in a clean room:

databricks clean-room-assets create my-clean-room --asset-type NOTEBOOK_FILE --name "my_notebook.py"

The following example creates a volume asset in a clean room:

databricks clean-room-assets create my-clean-room --asset-type VOLUME --name "catalog.schema.volume_name"

databricks clean-room-assets delete

Delete a clean room asset. Unshare and remove the asset from the clean room.

databricks clean-room-assets delete CLEAN_ROOM_NAME ASSET_TYPE NAME [flags]

Arguments

CLEAN_ROOM_NAME

    Name of the clean room.

ASSET_TYPE

    The type of the asset. Supported values: FOREIGN_TABLE, NOTEBOOK_FILE, TABLE, VIEW, VOLUME

NAME

    The fully qualified name of the asset, it is same as the name field in CleanRoomAsset.

Options

Global flags

Examples

The following example deletes a table asset from a clean room:

databricks clean-room-assets delete my-clean-room TABLE "catalog.schema.table_name"

The following example deletes a notebook asset from a clean room:

databricks clean-room-assets delete my-clean-room NOTEBOOK_FILE "my_notebook.py"

The following example deletes a volume asset from a clean room:

databricks clean-room-assets delete my-clean-room VOLUME "catalog.schema.volume_name"

databricks clean-room-assets get

Get the details of a clean room asset by its type and full name.

databricks clean-room-assets get CLEAN_ROOM_NAME ASSET_TYPE NAME [flags]

Arguments

CLEAN_ROOM_NAME

    Name of the clean room.

ASSET_TYPE

    The type of the asset. Supported values: FOREIGN_TABLE, NOTEBOOK_FILE, TABLE, VIEW, VOLUME

NAME

    The fully qualified name of the asset, it is same as the name field in CleanRoomAsset.

Options

Global flags

Examples

The following example gets details of a table asset in a clean room:

databricks clean-room-assets get my-clean-room TABLE "catalog.schema.table_name"

The following example gets details of a notebook asset in a clean room:

databricks clean-room-assets get my-clean-room NOTEBOOK_FILE "my_notebook.py"

The following example gets details of a view asset in a clean room:

databricks clean-room-assets get my-clean-room VIEW "catalog.schema.view_name"

databricks clean-room-assets list

List assets in a clean room.

databricks clean-room-assets list CLEAN_ROOM_NAME [flags]

Arguments

CLEAN_ROOM_NAME

    Name of the clean room.

Options

--page-token string

    Opaque pagination token to go to next page based on previous query.

Global flags

Examples

The following example lists all assets in a clean room:

databricks clean-room-assets list my-clean-room

databricks clean-room-assets update

Update a clean room asset. For example, updating the content of a notebook or changing the shared partitions of a table.

databricks clean-room-assets update CLEAN_ROOM_NAME ASSET_TYPE NAME [flags]

Arguments

CLEAN_ROOM_NAME

    Name of the clean room.

ASSET_TYPE

    The type of the asset. Supported values: FOREIGN_TABLE, NOTEBOOK_FILE, TABLE, VIEW, VOLUME

NAME

    A fully qualified name that uniquely identifies the asset within the clean room. This is also the name displayed in the clean room UI. For Unity Catalog securable assets (tables, volumes, etc.), the format is shared_catalog.shared_schema.asset_name. For notebooks, the name is the notebook file name.

Options

--asset-type CleanRoomAssetAssetType

    The type of the asset. Supported values: FOREIGN_TABLE, NOTEBOOK_FILE, TABLE, VIEW, VOLUME

--json JSON

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

--name string

    A fully qualified name that uniquely identifies the asset within the clean room.

Global flags

Examples

The following example updates a table asset in a clean room:

databricks clean-room-assets update my-clean-room TABLE "catalog.schema.table_name" --json '{
  "asset_type": "TABLE",
  "name": "catalog.schema.table_name"
}'

The following example updates a notebook asset in a clean room:

databricks clean-room-assets update my-clean-room NOTEBOOK_FILE "my_notebook.py" --name "updated_notebook.py"

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