module Grafana::User
Public Instance Methods
add_dashboard_star(dashboard_id)
click to toggle source
# File lib/grafana/user.rb, line 30 def add_dashboard_star(dashboard_id) endpoint = "/api/user/stars/dashboard/#{dashboard_id}" @logger.info("Adding start to dashboard ID #{dashboard_id} (GET #{endpoint})") if @debug return post_request(endpoint, {}) end
get_current_user()
click to toggle source
# File lib/grafana/user.rb, line 6 def get_current_user() endpoint = "/api/user" @logger.info("Getting user current user (GET #{endpoint})") if @debug return get_request(endpoint) end
get_current_user_orgs()
click to toggle source
# File lib/grafana/user.rb, line 24 def get_current_user_orgs() endpoint = "/api/user/orgs" @logger.info("Getting current user organizations (GET #{endpoint})") if @debug return get_request(endpoint) end
remove_dashboard_star(dashboard_id)
click to toggle source
# File lib/grafana/user.rb, line 36 def remove_dashboard_star(dashboard_id) endpoint = "/api/user/stars/dashboard/#{dashboard_id}" @logger.info("Deleting start on dashboard ID #{dashboard_id} (GET #{endpoint})") if @debug return delete_request(endpoint) end
switch_current_user_org(org_id)
click to toggle source
# File lib/grafana/user.rb, line 18 def switch_current_user_org(org_id) endpoint = "/api/user/using/#{org_id}" @logger.info("Switching current user to Org ID #{id} (GET #{endpoint})") if @debug return post_request(endpoint, {}) end
update_current_user_pass(properties={})
click to toggle source
# File lib/grafana/user.rb, line 12 def update_current_user_pass(properties={}) endpoint = "/api/user/password" @logger.info("Updating current user password (PUT #{endpoint})") if @debug return put_request(endpoint,properties) end