No description
Find a file
2018-02-04 13:51:30 -08:00
src more gcsafe 2018-02-04 13:51:30 -08:00
tests clean up 2018-01-29 19:23:02 -08:00
.gitignore clean up 2018-01-29 19:23:02 -08:00
docker-compose.yml changed name 2018-01-29 19:13:44 -08:00
Dockerfile clean up 2018-01-29 19:23:02 -08:00
grafanim.nimble changed structure 2018-01-29 19:43:45 -08:00
LICENSE Initial commit 2018-01-28 21:34:54 -08:00
Makefile clean up 2018-01-29 19:23:02 -08:00
README.md updated readme 2018-01-31 00:49:05 -08:00

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()