superwise_api.entities.dashboard_item
class
DashboardItemApi(superwise_api.entities.base.BaseApi):
This class provides methods to interact with the DashboardItem API.
Arguments:
- api_client (SuperwiseClient): An instance of the ApiClient to make requests.
def
get_by_id( self, dashboard_item_id: str, **kwargs) -> superwise_api.models.dashboard_item.dashboard_item.DashboardItem:
Gets a dashboard_item by id.
Arguments:
- dashboard_item_id (str): The id of the dashboard_item.
- **kwargs: Arbitrary keyword arguments.
Returns:
DashboardItem: The dashboard_item.
def
delete(self, dashboard_item_id: str, **kwargs) -> None:
Deletes a dashboard_item.
Arguments:
- dashboard_item_id (str): The id of the dashboard_item.
- **kwargs: Arbitrary keyword arguments.
def
create( self, name: str, query_type: superwise_api.models.dashboard_item.dashboard_item.QueryType, visualization_type: superwise_api.models.dashboard.dashboard.VisualizationType, datasource: superwise_api.models.dashboard_item.dashboard_item.Datasource, data_config: superwise_api.models.dashboard_item.dashboard_item.DataConfigBase, dashboard_id: str, item_metadata: dict, **kwargs) -> superwise_api.models.dashboard_item.dashboard_item.DashboardItem:
Creates a new dashboard_item.
Arguments:
- name (str): The name of the dashboard_item.
- query_type (QueryType): The type of query this dashboard item will execute.
- visualization_type (VisualizationType): The type of visualization to be used for this item.
- datasource (Datasource): Identifier for the data source from which this item retrieves data.
- data_config (DataConfigBase): how to extract the data: query, type, metric etc.
- dashboard_id (str): The ID of the dashboard to which this item belongs.
- item_metadata (dict, optional): Additional metadata for the item, such as visual settings.
- **kwargs: Arbitrary keyword arguments for future extensions or additional data.
Returns:
DashboardItem: The created dashboard_item.
def
get( self, name: Optional[str] = None, dashboard_id: 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 dashboard_items.
Arguments:
- name (str, optional): The name of the dashboard_item.
- dashboard_id (str, optional): The id 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_item_id: str, *, name: Optional[str] = None, query_type: Optional[superwise_api.models.dashboard_item.dashboard_item.QueryType] = None, visualization_type: Optional[superwise_api.models.dashboard.dashboard.VisualizationType] = None, datasource: Optional[superwise_api.models.dashboard_item.dashboard_item.Datasource] = None, data_config: Optional[superwise_api.models.dashboard_item.dashboard_item.DataConfigBase] = None, item_metadata: Optional[dict] = None, **kwargs) -> superwise_api.models.dashboard_item.dashboard_item.DashboardItem:
Updates a dashboard item.
Arguments:
- dashboard_item_id (str): The unique identifier of the dashboard item.
- name (str, optional): New name of the dashboard item.
- query_type (QueryType, optional): New type of query to be executed.
- visualization_type (VisualizationType, optional): New visualization type to be used.
- datasource (Datasource, optional): New data source identifier.
- data_config (DataConfigBase, optional): New data extraction configuration for the item.
- item_metadata (dict, optional): New additional metadata for the item.
- **kwargs: Arbitrary keyword arguments for future extensions or additional data.
Returns:
DashboardItem: The updated dashboard item.
Inherited Members
- superwise_api.entities.base.BaseApi
- BaseApi
- api_client
- wrap_api_calls
- raise_exception