dashboards
Operations on a dashboards
resource.
Overview
Name | dashboards |
Type | Resource |
Id | databricks_workspace.lakeview.dashboards |
Fields
Name | Datatype |
---|---|
create_time | string |
dashboard_id | string |
display_name | string |
etag | string |
lifecycle_state | string |
parent_path | string |
path | string |
serialized_dashboard | string |
update_time | string |
warehouse_id | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | dashboard_id, deployment_name | Get a draft dashboard. |
list | SELECT | deployment_name | |
create | INSERT | deployment_name | Create a draft dashboard. |
trash | DELETE | dashboard_id, deployment_name | Trash a dashboard. |
update | UPDATE | deployment_name | Update a draft dashboard. |
migrate | EXEC | deployment_name | Migrates a classic SQL dashboard to Lakeview. |
publish | EXEC | dashboard_id, deployment_name | Publish the current draft dashboard. |
unpublish | EXEC | dashboard_id, deployment_name | Unpublish the dashboard. |
SELECT
examples
- dashboards (list)
- dashboards (get)
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 }}';
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 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.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 }}'
;
- name: your_resource_model_name
props:
- name: display_name
value: Monthly Traffic Report
- name: warehouse_id
value: 47bb1c472649e711
- name: etag
value: '80611980'
- name: serialized_dashboard
value: '{"pages":[{"name":"b532570b","displayName":"New Page"}]}'
- name: parent_path
value: /path/to/dir
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 }}';