Skip to main content

usage_dashboards

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

Overview​

Nameusage_dashboards
TypeResource
Iddatabricks_account.billing.usage_dashboards

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
dashboard_idstring
dashboard_urlstringThe URL of the usage dashboard.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
usage_dashboards_getselectaccount_id, account_hostdashboard_type, workspace_idGet a usage dashboard specified by workspaceId, accountId, and dashboard type.
usage_dashboards_createinsertaccount_id, account_hostCreate a usage dashboard specified by workspaceId, accountId, and dashboard type.

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
account_hoststringThe Databricks account console host. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws), or set explicitly with DATABRICKS_ACCOUNT_HOST (bare host, no scheme). (default: accounts.cloud.databricks.com, x-stackQL-envVar: DATABRICKS_ACCOUNT_HOST, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"accounts.cloud.databricks.com","azure":"accounts.azuredatabricks.net","gcp":"accounts.gcp.databricks.com"}})
account_idstring
dashboard_typestringWorkspace level usage dashboard shows usage data for the specified workspace ID. Global level usage dashboard shows usage data for all workspaces in the account.
workspace_idintegerThe workspace ID of the workspace in which the usage dashboard is created.

SELECT examples​

Get a usage dashboard specified by workspaceId, accountId, and dashboard type.

SELECT
dashboard_id,
dashboard_url
FROM databricks_account.billing.usage_dashboards
WHERE account_id = '{{ account_id }}' -- required
AND account_host = '{{ account_host }}' -- required
AND dashboard_type = '{{ dashboard_type }}'
AND workspace_id = '{{ workspace_id }}'
;

INSERT examples​

Create a usage dashboard specified by workspaceId, accountId, and dashboard type.

INSERT INTO databricks_account.billing.usage_dashboards (
dashboard_type,
major_version,
workspace_id,
account_id,
account_host
)
SELECT
'{{ dashboard_type }}',
'{{ major_version }}',
{{ workspace_id }},
'{{ account_id }}',
'{{ account_host }}'
RETURNING
dashboard_id
;