mirror of
https://github.com/jamesalbert/grafanim
synced 2026-01-12 15:21:40 +00:00
No description
| src | ||
| tests | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| grafanim.nimble | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
Grafanim
Grafana module for nim 🤷♂️
Installing
nimble install grafanim
Development
$ make up # bring up docker
$ make test # to run tests/test.nim
$ make ssh # run bash in grafanim container (*air quotes* ssh *end air quotes*)
It's not really a "testing environment", just a container to mess around with api calls.
Examples
Credentials are defaults for InfluxDB and Grafana
import grafanim, json
let gc = newGrafanaClient("grafana:3000", "admin", "admin") # or ("grafana:3000", "api-key")
echo gc.NewDashboard( %* {
"title": "new dash"
})
echo gc.NewInfluxDBDatasource( %* {
"host": "localhost",
"name": "BTCUSD",
"database": "btc_usd",
"user": "root",
"pass": "root"
})
echo gc.Datasources()
echo gc.Dashboards()