dashboards
Operations on a dashboards
resource.
Overview
Name | dashboards |
Type | Resource |
Id | databricks_workspace.dbsql.dashboards |
Fields
Name | Datatype |
---|---|
id | string |
name | string |
can_edit | boolean |
created_at | string |
dashboard_filters_enabled | boolean |
is_archived | boolean |
is_draft | boolean |
is_favorite | boolean |
options | object |
parent | string |
permission_tier | string |
slug | string |
tags | array |
updated_at | string |
user | object |
user_id | integer |
widgets | array |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | dashboard_id, deployment_name | Returns a JSON representation of a dashboard object, including its visualization and query objects. |
list | SELECT | deployment_name | Fetch a paginated list of dashboard objects. |
create | INSERT | deployment_name | |
delete | DELETE | dashboard_id, deployment_name | Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot be shared. |
update | UPDATE | dashboard_id, deployment_name | Modify this dashboard definition. This operation only affects attributes of the dashboard object. It does not add, modify, or remove widgets. |
restore | EXEC | dashboard_id, deployment_name | A restored dashboard appears in list views and searches and can be shared. |
SELECT
examples
- dashboards (list)
- dashboards (get)
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 }}';
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 dashboard_id = '{{ dashboard_id }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new dashboards
resource.
- dashboards
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: Sales Dashboard
- name: parent
value: folders/2025532471912059
- name: tags
value:
- Payroll
- name: is_favorite
value: true
- name: run_as_role
value: viewer
- name: dashboard_filters_enabled
value: true
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 }}';