dashboard_widgets
Creates, updates, deletes, gets or lists a dashboard_widgets resource.
Overview
| Name | dashboard_widgets |
| Type | Resource |
| Id | databricks_workspace.sql.dashboard_widgets |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
update | insert | id, deployment_name, dashboard_id, options, width | Updates an existing widget | |
create | insert | deployment_name, dashboard_id, options, width | Adds a widget to a dashboard | |
delete | delete | id, deployment_name | Removes a widget from a dashboard |
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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
id | string | Widget ID returned by :method:dashboardwidgets/create |
INSERT examples
- update
- create
- Manifest
Updates an existing widget
INSERT INTO databricks_workspace.sql.dashboard_widgets (
dashboard_id,
options,
width,
text,
visualization_id,
id,
deployment_name
)
SELECT
'{{ dashboard_id }}' /* required */,
'{{ options }}' /* required */,
{{ width }} /* required */,
'{{ text }}',
'{{ visualization_id }}',
'{{ id }}',
'{{ deployment_name }}'
RETURNING
id,
options,
visualization,
width
;
Adds a widget to a dashboard
INSERT INTO databricks_workspace.sql.dashboard_widgets (
dashboard_id,
options,
width,
text,
visualization_id,
deployment_name
)
SELECT
'{{ dashboard_id }}' /* required */,
'{{ options }}' /* required */,
{{ width }} /* required */,
'{{ text }}',
'{{ visualization_id }}',
'{{ deployment_name }}'
RETURNING
id,
options,
visualization,
width
;
# Description fields are for documentation purposes
- name: dashboard_widgets
props:
- name: id
value: "{{ id }}"
description: Required parameter for the dashboard_widgets resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the dashboard_widgets resource.
- name: dashboard_id
value: "{{ dashboard_id }}"
description: |
Dashboard ID returned by :method:dashboards/create.
- name: options
description: |
:param width: int Width of a widget
value:
created_at: "{{ created_at }}"
description: "{{ description }}"
isHidden: {{ isHidden }}
parameterMappings: "{{ parameterMappings }}"
position:
autoHeight: {{ autoHeight }}
col: {{ col }}
row: {{ row }}
sizeX: {{ sizeX }}
sizeY: {{ sizeY }}
title: "{{ title }}"
updated_at: "{{ updated_at }}"
- name: width
value: {{ width }}
- name: text
value: "{{ text }}"
description: |
If this is a textbox widget, the application displays this text. This field is ignored if the widget contains a visualization in the `visualization` field.
- name: visualization_id
value: "{{ visualization_id }}"
description: |
Query Vizualization ID returned by :method:queryvisualizations/create.
DELETE examples
- delete
Removes a widget from a dashboard
DELETE FROM databricks_workspace.sql.dashboard_widgets
WHERE id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;