ruby-grafana-api icon indicating copy to clipboard operation
ruby-grafana-api copied to clipboard

A simple Ruby wrapper for the Grafana HTTP API

ruby-grafana-api

Gem Version

Description

A simple Ruby wrapper for the Grafana HTTP API. To include in your project, simply require the grafana library:

require 'grafana'

Comments/Notes

If you come across a bug or if you have a request for a new feature, please open an issue.

Methods & Usage Examples

Creating an instance of the grafana api client:

options = {
  "debug" => false,
  "timeout" => 3,
  "ssl" => false
}
g = Grafana::Client.new('[GRAFANA_HOST]', [GRAFANA_PORT], '[GRAFANA_USER]', '[GRAFANA_PASS]', options)

Connecting to Grafana using an API key:

options = {
  "debug" => false,
  "timeout" => 3,
  "ssl" => false,
  "headers" => {
    "Authorization" => "Bearer eiJrIjoidTBsQWpicGR0SzFXD29aclExTjk1cVliMWREUVp0alAiLCJuIjoiR8JhZGFzaG3yFiwiawQIOjE2"
  }
}
g = Grafana::Client.new('[GRAFANA_HOST]', [GRAFANA_PORT], nil, nil, options)

user and pass attributes are ignored when specifying Authorization header

Individual Module Documentation

  • Admin
  • Dashboard
  • Datasource
  • Frontend
  • Login
  • Organization
  • Organizations
  • Snapshot
  • User
  • Users

License

Covered by the MIT license.