grafanarmadillo.flow

Pieces for templating multiple dashboards at once.

class grafanarmadillo.flow.Alert(name_obj: str, name_tmpl: str, templator: Templator)[source]

Flowable request for an Alert.

class grafanarmadillo.flow.Dashboard(name_obj: str, name_tmpl: str, templator: Templator)[source]

Flowable request for a Dashboard.

class grafanarmadillo.flow.FileStore(root: Path)[source]

Store and retrieve Grafana objects in the filesystem.

Objects will be stored under the same path as in Grafana. For example, a dashboard titled “MyDashboard” in a folder titled “MyFolder” will appear at {root}/MyFolder/MyDashboard.json.

read_alert(name)[source]

Read an alert from this store.

read_dashboard(name)[source]

Read a dashboard from this store.

write_alert(name, alert)[source]

Write an alert to this store.

write_dashbaord(name, dashboard)[source]

Write an alert to this store.

class grafanarmadillo.flow.Flow(store_obj: ~grafanarmadillo.flow.Store, store_tmpl: ~grafanarmadillo.flow.Store, flows: ~typing.List[~grafanarmadillo.flow.Alert | ~grafanarmadillo.flow.Dashboard] = <class 'list'>)[source]

A collection of templating actions to do.

append(flow: Alert | Dashboard)[source]

Add a Flowable request to this Flow.

flows

alias of list

obj_to_tmpl() FlowResult[source]

Import from the source to the destination.

run(obj_to_tmpl: bool) FlowResult[source]

Run the flow.

tmpl_to_obj() FlowResult[source]

Export from the destination to the source.

exception grafanarmadillo.flow.FlowException(item: Alert | Dashboard, cause: BaseException | None = None)[source]

Wrapped Exception of running a Flow.

class grafanarmadillo.flow.FlowResult(successes: List[Alert | Dashboard], failures: List[FlowException])[source]

Result of running a Flow.

raise_first()[source]

Raise the first exception, if present.

class grafanarmadillo.flow.GrafanaStore(gfn: GrafanaApi)[source]

Store and retrieve objects from a Grafana instance.

read_alert(name)[source]

Read an alert from this store.

read_dashboard(name)[source]

Read a dashboard from this store.

write_alert(name, alert)[source]

Write an alert to this store.

write_dashbaord(name, dashboard)[source]

Write an alert to this store.

class grafanarmadillo.flow.Store[source]

A destination or source for items.

abstract read_alert(name)[source]

Read an alert from this store.

abstract read_dashboard(name)[source]

Read a dashboard from this store.

abstract write_alert(name, alert)[source]

Write an alert to this store.

abstract write_dashbaord(name, dashboard)[source]

Write an alert to this store.