Skip to main content

assets

Creates, updates, deletes, gets or lists an assets resource.

Overview

Nameassets
TypeResource
Iddatabricks_workspace.cleanrooms.assets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringA fully qualified name that uniquely identifies the asset within the clean room. This is also the name displayed in the clean room UI. For UC securable assets (tables, volumes, etc.), the format is *shared_catalog*.*shared_schema*.*asset_name* For notebooks, the name is the notebook file name. For jar analyses, the name is the jar analysis name.
clean_room_namestringThe name of the clean room this asset belongs to. This field is required for create operations and populated by the server for responses.
added_atintegerWhen the asset is added to the clean room, in epoch milliseconds.
asset_typestringCreate a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />&gt;&gt;&gt; class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access:<br /><br /> &gt;&gt;&gt; Color.RED<br /> &lt;Color.RED: 1&gt;<br /><br />- value lookup:<br /><br /> &gt;&gt;&gt; Color(1)<br /> &lt;Color.RED: 1&gt;<br /><br />- name lookup:<br /><br /> &gt;&gt;&gt; Color['RED']<br /> &lt;Color.RED: 1&gt;<br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />&gt;&gt;&gt; len(Color)<br />3<br /><br />&gt;&gt;&gt; list(Color)<br />[&lt;Color.RED: 1&gt;, &lt;Color.BLUE: 2&gt;, &lt;Color.GREEN: 3&gt;]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (FOREIGN_TABLE, NOTEBOOK_FILE, TABLE, VIEW, VOLUME)
foreign_tableobjectForeign table details available to all collaborators of the clean room. Present if and only if **asset_type** is **FOREIGN_TABLE**
foreign_table_local_detailsobjectLocal details for a foreign that are only available to its owner. Present if and only if **asset_type** is **FOREIGN_TABLE**
notebookobjectNotebook details available to all collaborators of the clean room. Present if and only if **asset_type** is **NOTEBOOK_FILE**
owner_collaborator_aliasstringThe alias of the collaborator who owns this asset
statusstringStatus of the asset (ACTIVE, PENDING, PERMISSION_DENIED)
tableobjectTable details available to all collaborators of the clean room. Present if and only if **asset_type** is **TABLE**
table_local_detailsobjectLocal details for a table that are only available to its owner. Present if and only if **asset_type** is **TABLE**
viewobjectView details available to all collaborators of the clean room. Present if and only if **asset_type** is **VIEW**
view_local_detailsobjectLocal details for a view that are only available to its owner. Present if and only if **asset_type** is **VIEW**
volume_local_detailsobjectLocal details for a volume that are only available to its owner. Present if and only if **asset_type** is **VOLUME**

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectclean_room_name, asset_type.value, name, asset_type, deployment_nameGet the details of a clean room asset by its type and full name.
listselectclean_room_name, deployment_namepage_tokenList assets.
createinsertclean_room_name, deployment_name, assetCreate a clean room asset —share an asset like a notebook or table into the clean room. For each UC
updateupdateclean_room_name, asset_type.value, name, deployment_name, asset_type, assetUpdate a clean room asset. For example, updating the content of a notebook; changing the shared
deletedeleteclean_room_name, asset_type.value, name, asset_type, deployment_nameDelete a clean room asset - unshare/remove the asset from the clean room
reviewexecclean_room_name, asset_type.value, name, deployment_name, asset_typeSubmit an asset review

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.

NameDatatypeDescription
asset_typestringThe type of the asset.
asset_type.valuestring
clean_room_namestringName of the clean room
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
namestringName of the asset
page_tokenstringOpaque pagination token to go to next page based on previous query.

SELECT examples

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

SELECT
name,
clean_room_name,
added_at,
asset_type,
foreign_table,
foreign_table_local_details,
notebook,
owner_collaborator_alias,
status,
table,
table_local_details,
view,
view_local_details,
volume_local_details
FROM databricks_workspace.cleanrooms.assets
WHERE clean_room_name = '{{ clean_room_name }}' -- required
AND asset_type.value = '{{ asset_type.value }}' -- required
AND name = '{{ name }}' -- required
AND asset_type = '{{ asset_type }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Create a clean room asset —share an asset like a notebook or table into the clean room. For each UC

INSERT INTO databricks_workspace.cleanrooms.assets (
asset,
clean_room_name,
deployment_name
)
SELECT
'{{ asset }}' /* required */,
'{{ clean_room_name }}',
'{{ deployment_name }}'
RETURNING
name,
clean_room_name,
added_at,
asset_type,
foreign_table,
foreign_table_local_details,
notebook,
owner_collaborator_alias,
status,
table,
table_local_details,
view,
view_local_details,
volume_local_details
;

UPDATE examples

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

UPDATE databricks_workspace.cleanrooms.assets
SET
asset_type = '{{ asset_type }}',
asset = '{{ asset }}'
WHERE
clean_room_name = '{{ clean_room_name }}' --required
AND asset_type.value = '{{ asset_type.value }}' --required
AND name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND asset_type = '{{ asset_type }}' --required
AND asset = '{{ asset }}' --required
RETURNING
name,
clean_room_name,
added_at,
asset_type,
foreign_table,
foreign_table_local_details,
notebook,
owner_collaborator_alias,
status,
table,
table_local_details,
view,
view_local_details,
volume_local_details;

DELETE examples

Delete a clean room asset - unshare/remove the asset from the clean room

DELETE FROM databricks_workspace.cleanrooms.assets
WHERE clean_room_name = '{{ clean_room_name }}' --required
AND asset_type.value = '{{ asset_type.value }}' --required
AND name = '{{ name }}' --required
AND asset_type = '{{ asset_type }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;

Lifecycle Methods

Submit an asset review

EXEC databricks_workspace.cleanrooms.assets.review 
@clean_room_name='{{ clean_room_name }}' --required,
@asset_type.value='{{ asset_type.value }}' --required,
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"asset_type": "{{ asset_type }}",
"notebook_review": "{{ notebook_review }}"
}'
;