Exgrafana

Build StatusHex pmhex.pm downloadsDeps StatusInline docs

(Incomplete) Grafana client library for Elixir using HTTPoison.

The available functions are:

@spec create_dashboard(map) :: {:ok, map} | {:error, term}
@spec create_dashboard(map, Keyword.t) :: {:ok, map} | {:error, term}

@spec get_dashboard(binary) :: {:ok, map} | {:error, term}

@spec update_dashboard(map) :: {:ok, map} | {:error, term}
@spec update_dashboard(map, Keyword.t) :: {:ok, map} | {:error, term}

@spec delete_dashboard(binary) :: {:ok, map} | {:error, term}

For more information about the dashboard model structure and the slugs look at Grafana HTTP API reference.

Configuration

The following are the configuration arguments available:

e.g:

config :exgrafana
  url: "<URL of your Grafana server>",
  token: "<your API token>"

The OS environment variables $EXGRAFANA_URL, $EXGRAFANA_TOKEN and $EXGRAFANA_VERSION can be used instead.

Installation

Exgrafana is available as a Hex package. To install, add it to your dependencies in your mix.exs file:

def deps do
  [{:exgrafana, "~> 0.1"}]
end

and ensure httpoison is started before your application:

def application do
  [applications: [:httpoison]]
end