superwise_api.entities.dashboard

class DashboardApi(superwise_api.entities.base.BaseApi):

This class provides methods to interact with the Dashboard API.

Arguments:
  • api_client (SuperwiseClient): An instance of the ApiClient to make requests.
def create( self, name: str, **kwargs) -> superwise_api.models.dashboard.dashboard.Dashboard:

Creates a new dashboard.

Arguments:
  • name (str): The name of the dashboard.
  • **kwargs: Arbitrary keyword arguments.
Returns:

Dashboard: The created dashboard.

def get( self, name: Optional[str] = None, page: Optional[Annotated[int, Strict(strict=True), Interval(gt=None, ge=1, lt=None, le=None), None]] = None, size: Optional[Annotated[int, Strict(strict=True), Interval(gt=None, ge=1, lt=None, le=500), None]] = None, **kwargs) -> superwise_api.client.models.page.Page:

Gets all dashboards.

Arguments:
  • name (str, optional): The name of the dashboard.
  • page (int, optional): The page number.
  • size (int, optional): The size of the page.
  • **kwargs: Arbitrary keyword arguments.
Returns:

Page: A page of sources.

def update( self, dashboard_id: str, *, name: Optional[str] = None, positions: Optional[Dict[str, superwise_api.models.dashboard.dashboard.WidgetMeta]] = None, **kwargs):

Updates a dashboard.

Arguments:
  • dashboard_id (str): The id of the dashboard.
  • name (str, optional): The new name of the dashboard.
  • positions (dict, optional): The new positions of the widgets.
  • **kwargs: Arbitrary keyword arguments.
Returns:

Dashboard: The updated dashboard.

def add_tags(self, dashboard_id: str, tag_ids: list[str], **kwargs):

Add tags to an dashboard.

Arguments:
  • dashboard_id (str): The id of the dashboard.
  • tag_ids list(str): List of tag ids to add the dashboard
Returns:

None

def remove_tags(self, dashboard_id: str, tag_ids: list[str], **kwargs):

Delete tags from an dashboard.

Arguments:
  • dashboard_id (str): The id of the dashboard.
  • tag_ids list(str): List of tag ids to remove from the dashboard
Returns:

None

def search( self, filters: list[typing.Any] | None = None, search: str | None = None, sort_by: str | None = None, sort_direction: Literal['asc', 'desc'] = 'desc', **kwargs) -> superwise_api.client.models.page.Page:

Searches for dashboards based on a prefix.

Arguments:
  • filters (list[Any]): Filter on db columns, list of tuples. e.g. [[["id", "eq", "5c05dc9f-f04a-4ce8-9d57-2ec63ee76aac"], "and", ["description", "ilike", "Construction"]], "or", ["name", "ilike", "active"]]
  • search (str): Free text search on searchable fields
  • sort_by (str): Field to sort by
  • sort_direction (Literal["asc", "desc"]): Sort direction (ascending or descending)
  • query_params can be passed as part of the kwargs for pagination
Returns:

Page: A page of dashboards.

Inherited Members
superwise_api.entities.base.BaseApi
BaseApi
api_client
wrap_api_calls
raise_exception
get_by_id
delete