File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 77
88* Make ` GrafanaApi(auth=) ` an optional argument. This makes it easier to
99 connect to Grafana instances that do not require authentication.
10+ * Add basic example program, inquiring ` play.grafana.org ` .
1011
1112
1213## 2.2.1 (2022-05-20)
Original file line number Diff line number Diff line change 1+ import json
2+ import sys
3+
4+ from grafana_client import GrafanaApi
5+
6+
7+ def main ():
8+
9+ # Connect to Grafana instance of Grafana Labs fame.
10+ grafana = GrafanaApi (host = 'play.grafana.org' )
11+
12+ print ("## All folders on play.grafana.org" , file = sys .stderr )
13+ folders = grafana .folder .get_all_folders ()
14+ print (json .dumps (folders , indent = 2 ))
15+
16+ # print("## Dashboard with UID 000000012 at play.grafana.org", file=sys.stderr)
17+ # dashboard_000000012 = grafana.dashboard.get_dashboard("000000012")
18+ # print(dashboard_000000012)
19+
20+
21+ if __name__ == "__main__" :
22+ main ()
You can’t perform that action at this time.
0 commit comments