assets
Creates, updates, deletes, gets or lists an assets resource.
Overview
| Name | assets |
| Type | Resource |
| Id | databricks_workspace.cleanrooms.assets |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | 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 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_name | string | The name of the clean room this asset belongs to. This field is required for create operations and populated by the server for responses. |
added_at | integer | When the asset is added to the clean room, in epoch milliseconds. |
asset_type | string | Create a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />>>> class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access:<br /><br /> >>> Color.RED<br /> <Color.RED: 1><br /><br />- value lookup:<br /><br /> >>> Color(1)<br /> <Color.RED: 1><br /><br />- name lookup:<br /><br /> >>> Color['RED']<br /> <Color.RED: 1><br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />>>> len(Color)<br />3<br /><br />>>> list(Color)<br />[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]<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_table | object | Foreign table details available to all collaborators of the clean room. Present if and only if **asset_type** is **FOREIGN_TABLE** |
foreign_table_local_details | object | Local details for a foreign that are only available to its owner. Present if and only if **asset_type** is **FOREIGN_TABLE** |
notebook | object | Notebook details available to all collaborators of the clean room. Present if and only if **asset_type** is **NOTEBOOK_FILE** |
owner_collaborator_alias | string | The alias of the collaborator who owns this asset |
status | string | Status of the asset (ACTIVE, PENDING, PERMISSION_DENIED) |
table | object | Table details available to all collaborators of the clean room. Present if and only if **asset_type** is **TABLE** |
table_local_details | object | Local details for a table that are only available to its owner. Present if and only if **asset_type** is **TABLE** |
view | object | View details available to all collaborators of the clean room. Present if and only if **asset_type** is **VIEW** |
view_local_details | object | Local details for a view that are only available to its owner. Present if and only if **asset_type** is **VIEW** |
volume_local_details | object | Local details for a volume that are only available to its owner. Present if and only if **asset_type** is **VOLUME** |
| Name | Datatype | Description |
|---|
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | clean_room_name, asset_type.value, name, asset_type, deployment_name | Get the details of a clean room asset by its type and full name. | |
list | select | clean_room_name, deployment_name | page_token | List assets. |
create | insert | clean_room_name, deployment_name, asset | Create a clean room asset —share an asset like a notebook or table into the clean room. For each UC | |
update | update | clean_room_name, asset_type.value, name, deployment_name, asset_type, asset | Update a clean room asset. For example, updating the content of a notebook; changing the shared | |
delete | delete | clean_room_name, asset_type.value, name, asset_type, deployment_name | Delete a clean room asset - unshare/remove the asset from the clean room | |
review | exec | clean_room_name, asset_type.value, name, deployment_name, asset_type | Submit 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.
| Name | Datatype | Description |
|---|---|---|
asset_type | string | The type of the asset. |
asset_type.value | string | |
clean_room_name | string | Name of the clean room |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | Name of the asset |
page_token | string | Opaque pagination token to go to next page based on previous query. |
SELECT examples
- get
- list
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
;
List assets.
SELECT
*
FROM databricks_workspace.cleanrooms.assets
WHERE clean_room_name = '{{ clean_room_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: assets
props:
- name: clean_room_name
value: "{{ clean_room_name }}"
description: Required parameter for the assets resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the assets resource.
- name: asset
description: |
Metadata of the clean room asset
value:
name: "{{ name }}"
asset_type: "{{ asset_type }}"
added_at: {{ added_at }}
clean_room_name: "{{ clean_room_name }}"
foreign_table:
columns: "{{ columns }}"
foreign_table_local_details:
local_name: "{{ local_name }}"
notebook:
notebook_content: "{{ notebook_content }}"
etag: "{{ etag }}"
review_state: "{{ review_state }}"
reviews:
- comment: "{{ comment }}"
created_at_millis: {{ created_at_millis }}
review_state: "{{ review_state }}"
review_sub_reason: "{{ review_sub_reason }}"
reviewer_collaborator_alias: "{{ reviewer_collaborator_alias }}"
runner_collaborator_aliases:
- "{{ runner_collaborator_aliases }}"
owner_collaborator_alias: "{{ owner_collaborator_alias }}"
status: "{{ status }}"
table:
columns: "{{ columns }}"
table_local_details:
local_name: "{{ local_name }}"
partitions: "{{ partitions }}"
view:
columns: "{{ columns }}"
view_local_details:
local_name: "{{ local_name }}"
volume_local_details:
local_name: "{{ local_name }}"
UPDATE examples
- update
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
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
- review
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 }}"
}'
;