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
Format user parameters into JSON
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”]
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”]
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”]
Format user parameters into JSON.
Model: { “name”:”User”, “email”:”user@graf.com”, “login”:”user”, “password”:”userpassword” }