Module: Grafana::User

Included in:
Client
Defined in:
lib/grafana/user.rb

Instance Method Summary collapse

Instance Method Details

#add_dashboard_star(dashboard_id) ⇒ Object



30
31
32
33
34
# 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_userObject



6
7
8
9
10
# 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_orgsObject



24
25
26
27
28
# 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) ⇒ Object



36
37
38
39
40
# 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) ⇒ Object



18
19
20
21
22
# 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 = {}) ⇒ Object



12
13
14
15
16
# 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