Skip to main content

dashboards

Operations on a dashboards resource.

Overview

Namedashboards
TypeResource
Iddatabricks_workspace.lakeview.dashboards

Fields

NameDatatype
create_timestring
dashboard_idstring
display_namestring
etagstring
lifecycle_statestring
parent_pathstring
pathstring
serialized_dashboardstring
update_timestring
warehouse_idstring

Methods

NameAccessible byRequired ParamsDescription
getSELECTdashboard_id, deployment_nameGet a draft dashboard.
listSELECTdeployment_name
createINSERTdeployment_nameCreate a draft dashboard.
trashDELETEdashboard_id, deployment_nameTrash a dashboard.
updateUPDATEdeployment_nameUpdate a draft dashboard.
migrateEXECdeployment_nameMigrates a classic SQL dashboard to Lakeview.
publishEXECdashboard_id, deployment_namePublish the current draft dashboard.
unpublishEXECdashboard_id, deployment_nameUnpublish the dashboard.

SELECT examples

SELECT
create_time,
dashboard_id,
display_name,
etag,
lifecycle_state,
parent_path,
path,
serialized_dashboard,
update_time,
warehouse_id
FROM databricks_workspace.lakeview.dashboards
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new dashboards resource.

/*+ create */
INSERT INTO databricks_workspace.lakeview.dashboards (
deployment_name,
data__display_name,
data__warehouse_id,
data__etag,
data__serialized_dashboard,
data__parent_path
)
SELECT
'{{ deployment_name }}',
'{{ display_name }}',
'{{ warehouse_id }}',
'{{ etag }}',
'{{ serialized_dashboard }}',
'{{ parent_path }}'
;

UPDATE example

Updates a dashboards resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.lakeview.dashboards
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a dashboards resource.

/*+ delete */
DELETE FROM databricks_workspace.lakeview.dashboards
WHERE dashboard_id = '{{ dashboard_id }}' AND
deployment_name = '{{ deployment_name }}';