create_annotation

swxsoc.util.grafana.create_annotation(start_time: datetime, text: str, tags: List[str], end_time: datetime | None = None, dashboard_id: int | None = None, panel_id: int | None = None, dashboard_name: str | None = None, panel_name: str | None = None, mission_dashboard: str | None = None, overwrite: bool = False) Dict[str, str | int][source]

Creates a new annotation for a specified event or time period, with optional filtering by dashboard and panel names.

Args:

start_time (datetime): Start time of the annotation in UTC. text (str): Annotation text to display. tags (List[str]): List of tags for categorizing the annotation. end_time (Optional[datetime]): End time of the annotation, if applicable. dashboard_id (Optional[int]): UID of the dashboard to associate the annotation. panel_id (Optional[int]): ID of the panel to associate the annotation. dashboard_name (Optional[str]): Name of the dashboard to look up UID if dashboard_id is not provided. panel_name (Optional[str]): Name of the panel to look up ID if panel_id is not provided.

Returns:

Dict[str, Union[str, int]]: The created annotation data.