Skip to main content

dashboards

Creates, updates, deletes, gets or lists a dashboards resource.

Overview

Namedashboards
TypeResource
Iddatabricks_workspace.dbsql.dashboards

Fields

The following fields are returned by SELECT queries:

Dashboard fetched successfully.

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

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameReturns a JSON representation of a dashboard object, including its visualization and query objects.
listselectdeployment_nameFetch a paginated list of dashboard objects.
createinsertdeployment_name
updateupdatedeployment_nameModify this dashboard definition. This operation only affects attributes of the dashboard object. It does not add, modify, or remove widgets.
deletedeletedeployment_nameMoves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot be shared.
restoreexecdeployment_nameA restored dashboard appears in list views and searches and can be shared.

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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Returns a JSON representation of a dashboard object, including its visualization and query objects.

SELECT
id,
name,
user_id,
can_edit,
created_at,
dashboard_filters_enabled,
is_archived,
is_draft,
is_favorite,
options,
parent,
permission_tier,
slug,
tags,
updated_at,
user,
widgets
FROM databricks_workspace.dbsql.dashboards
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

No description available.

INSERT INTO databricks_workspace.dbsql.dashboards (
data__name,
data__parent,
data__tags,
data__is_favorite,
data__run_as_role,
data__dashboard_filters_enabled,
deployment_name
)
SELECT
'{{ name }}',
'{{ parent }}',
'{{ tags }}',
'{{ is_favorite }}',
{{ run_as_role }},
'{{ dashboard_filters_enabled }}',
'{{ deployment_name }}'
RETURNING
id,
name,
user_id,
can_edit,
created_at,
dashboard_filters_enabled,
is_archived,
is_draft,
is_favorite,
options,
parent,
permission_tier,
slug,
tags,
updated_at,
user,
widgets
;

UPDATE examples

Modify this dashboard definition. This operation only affects attributes of the dashboard object. It does not add, modify, or remove widgets.

UPDATE databricks_workspace.dbsql.dashboards
SET
data__name = '{{ name }}',
data__run_as_role = '{{ run_as_role }}',
data__tags = '{{ tags }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
id,
name,
user_id,
can_edit,
created_at,
dashboard_filters_enabled,
is_archived,
is_draft,
is_favorite,
options,
parent,
permission_tier,
slug,
tags,
updated_at,
user,
widgets;

DELETE examples

Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot be shared.

DELETE FROM databricks_workspace.dbsql.dashboards
WHERE deployment_name = '{{ deployment_name }}' --required;

Lifecycle Methods

A restored dashboard appears in list views and searches and can be shared.

EXEC databricks_workspace.dbsql.dashboards.restore 
@deployment_name='{{ deployment_name }}' --required;