Operations¶
grafanarmadillo.bulk¶
Perform bulk operations on Grafana.
BulkOperations defines the basic interface. It is meant to be parametrised in 2 phases: - information source: Subclasses of BulkOperations implement methods to get orgs and resources - actions: Subclasses of those classes implement the actions to take
- For example:
BulkGrafanaOperation uses a Grafana instance as its source BulkExporter uses BulkGrafanaOperations to list all objects and write them to disk
- class grafanarmadillo.bulk.BulkExporter(cfg: dict, root_directory: Path, templator: Templator)[source]¶
Export all resources from Grafana to files.
- class grafanarmadillo.bulk.BulkFileOperation(cfg: dict, root_directory: Path)[source]¶
Bulk operation which uses a filetree as its source.
- all_orgs() Generator[Tuple[OrgMeta, GrafanaApi], None, None][source]¶
Iterate over all organisations in Grafana.
- class grafanarmadillo.bulk.BulkGrafanaOperation(cfg: dict)[source]¶
Bulk operations which uses a Grafana instance as its source.
- all_orgs() Generator[Tuple[OrgMeta, GrafanaApi], None, None][source]¶
Iterate over all organisations in Grafana.
- class grafanarmadillo.bulk.BulkImporter(cfg: dict, root_directory: Path, templator: Templator)[source]¶
Import all resources from files into Grafana.
- class grafanarmadillo.bulk.BulkOperation(cfg: dict)[source]¶
Run bulk operations on Grafana.
- abstract all_orgs() Generator[Tuple[OrgMeta, GrafanaApi], None, None][source]¶
Iterate over all organisations.
This method should be implemented for each source of information.
- abstract each_alert(path: Path, alert: AlertContent)[source]¶
Act on each alert in Grafana.
This method should be implemented for each operation.
- abstract each_dashboard(path: Path, dashboard: DashboardContent)[source]¶
Act on each dashboard in Grafana.
This method should be implemented for each operation.
- abstract get_all_alerts(org: OrgMeta, gfn: GrafanaApi) Generator[Tuple[Path, AlertContent], None, None][source]¶
Iterate over all alerts.
This method should be implemented for each source of information.