RTC Toolkit 6.0.0
Loading...
Searching...
No Matches

Import prepared dashboards, folders, alerts, data sources, and library panels to Grafana. More...

Classes

class  grafana.grafana_widget_tool.GrafanaConfig
 Simple data class holding configuration for Grafana. More...
 

Namespaces

namespace  grafana
 
namespace  grafana.grafana_widget_tool
 

Functions

dict|None grafana.grafana_widget_tool.fetch_json (str url, GrafanaConfig config)
 Helper function fetching JSON from Grafana REST API.
 
dict|None grafana.grafana_widget_tool.post_json (str url, dict payload, GrafanaConfig config)
 Helper function sending JSON payload to Grafana REST API via POST method.
 
dict|None grafana.grafana_widget_tool.put_json (str url, dict payload, GrafanaConfig config)
 Helper function sending JSON payload to Grafana REST API via PUT method.
 
dict|None grafana.grafana_widget_tool.patch_json (str url, dict payload, GrafanaConfig config)
 Helper function sending JSON payload to Grafana REST API via PATCH method.
 
dict|None grafana.grafana_widget_tool.del_req (str url, GrafanaConfig config)
 Helper function sending DELETE request to Grafana REST API.
 
 grafana.grafana_widget_tool.ensure_dir (str path)
 Creates directory if it doesn't exist.
 
 grafana.grafana_widget_tool.find_json_files (str path)
 Returns a list of .json files in the given directory.
 
 grafana.grafana_widget_tool.load_json_file (str path)
 Load and return JSON data from the given file.
 
 grafana.grafana_widget_tool.save_json (str path, dict data)
 Save dictionary as JSON to the given file with formatting.
 
str grafana.grafana_widget_tool.format_title (str title)
 Convert a title string to lowercase with underscores instead of spaces.
 
str grafana.grafana_widget_tool.format_name (str name)
 Convert a name string to lowercase, underscores, and remove slashes.
 
 grafana.grafana_widget_tool.export_data_sources (GrafanaConfig config)
 Export all Grafana data sources to JSON files in the configured data directory.
 
 grafana.grafana_widget_tool.export_folders (GrafanaConfig config)
 Export all Grafana folders to the configured data directory.
 
 grafana.grafana_widget_tool.export_dashboards (GrafanaConfig config)
 Export all Grafana dashboards to JSON files in the configured data directory.
 
 grafana.grafana_widget_tool.export_library_panels (GrafanaConfig config)
 Export all Grafana libary pannels to JSON files in the configured data directory.
 
 grafana.grafana_widget_tool.export_alerts (GrafanaConfig config)
 Export all Grafana alerts to JSON files in the configured data directory.
 
 grafana.grafana_widget_tool.import_data_sources (GrafanaConfig config, str secrets)
 Import data sources into Grafana, optionally injecting secret tokens.
 
 grafana.grafana_widget_tool.import_folders (GrafanaConfig config)
 Import Grafana folders from JSON files, creating or updating them.
 
 grafana.grafana_widget_tool.import_dashboards (GrafanaConfig config)
 Import Grafana dashboards from JSON files, creating or updating them.
 
 grafana.grafana_widget_tool.import_library_panels (GrafanaConfig config)
 Import Grafana library panels from JSON files, creating or updating them.
 
 grafana.grafana_widget_tool.import_alerts (GrafanaConfig config)
 Import Grafana alerts from JSON files, creating or updating them.
 
 grafana.grafana_widget_tool.rtctk_grafana_import (uri=None, token=None, data_dir=None, secrets=None)
 Import all Grafana resources in a specific order: data sources, folders, alerts, library panels, and dashboards.
 
 grafana.grafana_widget_tool.rtctk_grafana_export (uri=None, token=None, data_dir=None)
 Export Grafana resources from API and saves them as JSON files in the configured data directory.
 
 grafana.grafana_widget_tool.rtctk_grafana_cleanup (uri=None, token=None, data_dir=None)
 Remove all Grafana resources previously exported or imported from the data directory.
 

Variables

 grafana.grafana_widget_tool.logger = CiiLogManager.get_logger()
 
int grafana.grafana_widget_tool.REQ_TIMEOUT = 10
 

Detailed Description

Import prepared dashboards, folders, alerts, data sources, and library panels to Grafana.