Skip to content

hopsworks.core.dashboard_api #

DashboardApi #

REST wrapper over /project/{id}/dashboards.

HTTP calls go through :mod:hopsworks_common.core.rest so this module does not reach into the SDK's private client surface (_send_request / _project_id).

add_chart #

add_chart(
    dashboard_id: int, chart_id: int
) -> dict[str, Any]

Attach an existing chart to a dashboard.

The backend represents membership by embedding the chart list in the dashboard, so we fetch, mutate, and PUT.

PARAMETER DESCRIPTION
dashboard_id

Dashboard identifier.

TYPE: int

chart_id

Chart identifier to attach.

TYPE: int

RETURNS DESCRIPTION
dict[str, Any]

The updated dashboard dict.

create_dashboard #

create_dashboard(name: str) -> dict[str, Any]

Create an empty dashboard.

PARAMETER DESCRIPTION
name

Dashboard name.

TYPE: str

RETURNS DESCRIPTION
dict[str, Any]

The created dashboard dict.

delete_dashboard #

delete_dashboard(dashboard_id: int) -> None

Delete a dashboard by ID.

PARAMETER DESCRIPTION
dashboard_id

Dashboard identifier.

TYPE: int

get_dashboard #

get_dashboard(dashboard_id: int) -> dict[str, Any]

Fetch a single dashboard by ID.

PARAMETER DESCRIPTION
dashboard_id

Dashboard identifier.

TYPE: int

RETURNS DESCRIPTION
dict[str, Any]

The dashboard dict.

list_dashboards #

list_dashboards() -> list[dict[str, Any]]

Return every dashboard in the current project.

RETURNS DESCRIPTION
list[dict[str, Any]]

A list of dashboard dicts, each with an id, name and

list[dict[str, Any]]

embedded charts list.

remove_chart #

remove_chart(
    dashboard_id: int, chart_id: int
) -> dict[str, Any]

Detach a chart from a dashboard.

PARAMETER DESCRIPTION
dashboard_id

Dashboard identifier.

TYPE: int

chart_id

Chart identifier to remove.

TYPE: int

RETURNS DESCRIPTION
dict[str, Any]

The updated dashboard dict.

update_dashboard #

update_dashboard(
    dashboard_id: int, **fields: Any
) -> dict[str, Any]

Update selected fields of a dashboard.

Accepts name and/or charts as keyword arguments.

PARAMETER DESCRIPTION
dashboard_id

Dashboard identifier.

TYPE: int

RETURNS DESCRIPTION
dict[str, Any]

The updated dashboard dict.