Dashboard
GrafanaDashboard
¶
Initialize the uploader with Grafana server details and credentials.
Source code in src/zenbt/grafana/dashboard.py
delete_dashboard
¶
Delete a dashboard by its UID.
:param dashboard_uid: UID of the dashboard to delete :return: True if deletion was successful, False otherwise
Source code in src/zenbt/grafana/dashboard.py
get_dashboard_uid_by_name
¶
Retrieve the UID of a dashboard by its name.
:param dashboard_name: Name of the dashboard :return: UID of the dashboard if found, None otherwise
Source code in src/zenbt/grafana/dashboard.py
upload_dashboard
¶
upload_dashboard(
json_file_path: str,
dashboard_name: str,
folder_uid: Optional[str] = None,
) -> bool
Upload a dashboard to Grafana.
:param json_file_path: Path to the JSON file containing the dashboard definition :param dashboard_name: Desired name for the dashboard in Grafana :param folder_uid: UID of the folder to save the dashboard in (optional) :return: True if upload was successful, False otherwise