w.dashboards: Dashboards (deprecated)

class databricks.sdk.service.sql.DashboardsAPI

In general, there is little need to modify dashboards using the API. However, it can be useful to use dashboard objects to look-up a collection of related query IDs. The API can also be used to duplicate multiple dashboards at once since you can get a dashboard definition with a GET request and then POST it to create a new one. Dashboards can be scheduled using the sql_task type of the Jobs API, e.g. :method:jobs/create.

Warning: This API is deprecated. Please use the AI/BI Dashboards API instead. [Learn more]

[Learn more]: https://docs.databricks.com/en/dashboards/

delete(dashboard_id: str)

Usage:

import time

from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

created = w.dashboards.create(name=f"sdk-{time.time_ns()}")

w.dashboards.delete(dashboard_id=created.id)

# cleanup
w.dashboards.delete(dashboard_id=created.id)

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

Warning: This API is deprecated. Please use the AI/BI Dashboards API instead. [Learn more]

[Learn more]: https://docs.databricks.com/en/dashboards/

Parameters:

dashboard_id – str

get(dashboard_id: str) Dashboard

Usage:

import time

from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

created = w.dashboards.create(name=f"sdk-{time.time_ns()}")

by_id = w.dashboards.get(dashboard_id=created.id)

# cleanup
w.dashboards.delete(dashboard_id=created.id)

Returns a JSON representation of a dashboard object, including its visualization and query objects.

Warning: This API is deprecated. Please use the AI/BI Dashboards API instead. [Learn more]

[Learn more]: https://docs.databricks.com/en/dashboards/

Parameters:

dashboard_id – str

Returns:

Dashboard

list([, order: Optional[ListOrder], page: Optional[int], page_size: Optional[int], q: Optional[str]]) Iterator[Dashboard]

Usage:

from databricks.sdk import WorkspaceClient
from databricks.sdk.service import sql

w = WorkspaceClient()

all = w.dashboards.list(sql.ListDashboardsRequest())

Fetch a paginated list of dashboard objects.

Warning: Calling this API concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.

Warning: This API is deprecated. Please use the AI/BI Dashboards API instead. [Learn more]

[Learn more]: https://docs.databricks.com/en/dashboards/

Parameters:
  • orderListOrder (optional) Name of dashboard attribute to order by.

  • page – int (optional) Page number to retrieve.

  • page_size – int (optional) Number of dashboards to return per page.

  • q – str (optional) Full text search term.

Returns:

Iterator over Dashboard

restore(dashboard_id: str)

Usage:

import time

from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

created = w.dashboards.create(name=f"sdk-{time.time_ns()}")

w.dashboards.restore(dashboard_id=created.id)

# cleanup
w.dashboards.delete(dashboard_id=created.id)

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

Warning: This API is deprecated. Please use the AI/BI Dashboards API instead. [Learn more]

[Learn more]: https://docs.databricks.com/en/dashboards/

Parameters:

dashboard_id – str

update(dashboard_id: str [, name: Optional[str], run_as_role: Optional[RunAsRole], tags: Optional[List[str]]]) Dashboard

Modify this dashboard definition. This operation only affects attributes of the dashboard object. It does not add, modify, or remove widgets.

Note: You cannot undo this operation.

Warning: This API is deprecated. Please use the AI/BI Dashboards API instead. [Learn more]

[Learn more]: https://docs.databricks.com/en/dashboards/

Parameters:
  • dashboard_id – str

  • name – str (optional) The title of this dashboard that appears in list views and at the top of the dashboard page.

  • run_as_roleRunAsRole (optional) Sets the Run as role for the object. Must be set to one of “viewer” (signifying “run as viewer” behavior) or “owner” (signifying “run as owner” behavior)

  • tags – List[str] (optional)

Returns:

Dashboard