grafana v0.1.3 Grafana.Admin View Source

Link to this section Summary

Functions

Delete global user with given id

Create new global user as specified by json

Set password for user with given id. Json format is {“password”: ““}

Set permissions for given user as specified by json

Get global admin settings

Link to this section Functions

Delete global user with given id.

iex> {:ok, response} = Grafana.Admin.delete_user(1) …> Map.keys(response) [“message”]

Create new global user as specified by json.

iex> {:ok, response} = Grafana.Admin.new_user(%{“name” => “User”, “email” => “user@graf.com”, “login” => “user”, “password” => “userpassword”}) …> Map.keys(response) [“id”,”message”]

Link to this function set_password(user_id, json) View Source

Set password for user with given id. Json format is {“password”: ““}.

iex> {:ok, response} = Grafana.Admin.set_password(1, %{“password” => “newpassword”}) …> Map.keys(response) [“message”]

Link to this function set_permissions(user_id, json) View Source

Set permissions for given user as specified by json.

iex> {:ok, response} = Grafana.Admin.set_permissions(1, %{“isGrafanaAdmin” => true}) …> Map.keys(response) [“message”]

Get global admin settings.

iex> {:ok, settings} = Grafana.Admin.settings …> Map.keys(settings) [“DEFAULT”,”analytics”,”auth.anonymous”,”auth.basic”,”auth.github”,”auth.google”,”auth.ldap”,”auth.proxy”,”dashboards.json”,”database”,”emails”,”event_publisher”,”log”,”log.console”,”log.file”,”paths”,”security”,”server”,”session”,”smtp”,”users”]

Link to this function user_params_to_json(name \\ "", email \\ "", login \\ "user", password \\ "password") View Source

Format user parameters into JSON.

Model: { “name”:”User”, “email”:”user@graf.com”, “login”:”user”, “password”:”userpassword” }