Skip to main content

dashboards

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

Overview

Namedashboards
TypeResource
Iddatabricks_workspace.sql.dashboards

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID for this dashboard.
namestringThe title of the dashboard that appears in list views and at the top of the dashboard page.
user_idintegerThe ID of the user who owns the dashboard.
can_editbooleanWhether the authenticated user can edit the query definition.
created_atstringTimestamp when this dashboard was created.
dashboard_filters_enabledbooleanIn the web application, query filters that share a name are coupled to a single selection box if this value is `true`.
is_archivedbooleanIndicates whether a dashboard is trashed. Trashed dashboards won't appear in list views. If this boolean is `true`, the `options` property for this dashboard includes a `moved_to_trash_at` timestamp. Items in trash are permanently deleted after 30 days.
is_draftbooleanWhether a dashboard is a draft. Draft dashboards only appear in list views for their owners.
is_favoritebooleanIndicates whether this query object appears in the current user's favorites list. This flag determines whether the star icon for favorites is selected.
optionsobject
parentstringThe identifier of the workspace folder containing the object.
permission_tierstring* `CAN_VIEW`: Can view the query * `CAN_RUN`: Can run the query * `CAN_EDIT`: Can edit the query * `CAN_MANAGE`: Can manage the query (CAN_EDIT, CAN_MANAGE, CAN_RUN, CAN_VIEW)
slugstringURL slug. Usually mirrors the query name with dashes (`-`) instead of spaces. Appears in the URL for this query.
tagsarray
updated_atstringTimestamp when this dashboard was last updated.
userobject
widgetsarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdashboard_id, deployment_nameReturns a JSON representation of a dashboard object, including its visualization and query objects.
listselectdeployment_nameorder, page, page_size, qFetch a paginated list of dashboard objects.
updateinsertdashboard_id, deployment_nameModify this dashboard definition. This operation only affects attributes of the dashboard object. It
deletedeletedashboard_id, deployment_nameMoves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot
restoreexecdashboard_id, deployment_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
dashboard_idstringstr
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
orderstringName of dashboard attribute to order by.
pageintegerPage number to retrieve.
page_sizeintegerNumber of dashboards to return per page.
qstringFull text search term.

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.sql.dashboards
WHERE dashboard_id = '{{ dashboard_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Modify this dashboard definition. This operation only affects attributes of the dashboard object. It

INSERT INTO databricks_workspace.sql.dashboards (
name,
run_as_role,
tags,
dashboard_id,
deployment_name
)
SELECT
'{{ name }}',
'{{ run_as_role }}',
'{{ tags }}',
'{{ dashboard_id }}',
'{{ 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
;

DELETE examples

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

DELETE FROM databricks_workspace.sql.dashboards
WHERE dashboard_id = '{{ dashboard_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;

Lifecycle Methods

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

EXEC databricks_workspace.sql.dashboards.restore 
@dashboard_id='{{ dashboard_id }}' --required,
@deployment_name='{{ deployment_name }}' --required
;