Skip to main content

dashboards

Operations on a dashboards resource.

Overview

Namedashboards
TypeResource
Iddatabricks_workspace.dbsql.dashboards

Fields

NameDatatype
idstring
namestring
can_editboolean
created_atstring
dashboard_filters_enabledboolean
is_archivedboolean
is_draftboolean
is_favoriteboolean
optionsobject
parentstring
permission_tierstring
slugstring
tagsarray
updated_atstring
userobject
user_idinteger
widgetsarray

Methods

NameAccessible byRequired ParamsDescription
getSELECTdashboard_id, deployment_nameReturns a JSON representation of a dashboard object, including its visualization and query objects.
listSELECTdeployment_nameFetch a paginated list of dashboard objects.
createINSERTdeployment_name
deleteDELETEdashboard_id, deployment_nameMoves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot be shared.
updateUPDATEdashboard_id, deployment_nameModify this dashboard definition. This operation only affects attributes of the dashboard object. It does not add, modify, or remove widgets.
restoreEXECdashboard_id, deployment_nameA restored dashboard appears in list views and searches and can be shared.

SELECT examples

SELECT
id,
name,
can_edit,
created_at,
dashboard_filters_enabled,
is_archived,
is_draft,
is_favorite,
options,
parent,
permission_tier,
slug,
tags,
updated_at,
user,
user_id,
widgets
FROM databricks_workspace.dbsql.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.dbsql.dashboards (
deployment_name,
data__name,
data__parent,
data__tags,
data__is_favorite,
data__run_as_role,
data__dashboard_filters_enabled
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ parent }}',
'{{ tags }}',
'{{ is_favorite }}',
'{{ run_as_role }}',
'{{ dashboard_filters_enabled }}'
;

UPDATE example

Updates a dashboards resource.

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

DELETE example

Deletes a dashboards resource.

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