Module: Grafana::Organizations

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

Instance Method Summary collapse

Instance Method Details

#add_user_to_org(org_id, user = {}) ⇒ Object



26
27
28
29
30
# File 'lib/grafana/organizations.rb', line 26

def add_user_to_org(org_id, user={}) 
  endpoint = "/api/orgs/#{org_id}/users"
  @logger.info("Adding user to orgnaization ID #{org_id} (POST #{endpoint})") if @debug
  return post_request(endpoint, user)
end

#delete_user_from_org(org_id, user_id) ⇒ Object



38
39
40
41
42
# File 'lib/grafana/organizations.rb', line 38

def delete_user_from_org(org_id, user_id)
  endpoint = "/api/orgs/#{org_id}/users/#{user_id}"
  @logger.info("Deleting user #{user_id} in organization #{org_id} (DELETE #{endpoint})") if @debug
  return delete_request(endpoint)
end

#get_all_orgsObject



6
7
8
9
10
# File 'lib/grafana/organizations.rb', line 6

def get_all_orgs()
  endpoint = "/api/orgs"
  @logger.info("Getting all organizations (GET #{endpoint})") if @debug
  return get_request(endpoint)
end

#get_org_users(org_id) ⇒ Object



19
20
21
22
23
# File 'lib/grafana/organizations.rb', line 19

def get_org_users(org_id)
  endpoint = "/api/orgs/#{org_id}/users"
  @logger.info("Getting users in orgnaization ID #{org_id} (GET #{endpoint})") if @debug
  return get_request(endpoint)
end

#update_org(org_id, properties = {}) ⇒ Object



13
14
15
16
17
# File 'lib/grafana/organizations.rb', line 13

def update_org(org_id, properties={})
  endpoint = "/api/orgs/#{org_id}"
  @logger.info("Updating orgnaization ID #{org_id} (POST #{endpoint})") if @debug
  return post_request(endpoint, properties)
end

#update_org_user(org_id, user_id, properties = {}) ⇒ Object



32
33
34
35
36
# File 'lib/grafana/organizations.rb', line 32

def update_org_user(org_id, user_id, properties={})
  endpoint = "/api/orgs/#{org_id}/users/#{user_id}"
  @logger.info("Updating user #{user_id} in organization #{org_id} (PATCH #{endpoint})") if @debug
  return patch_request(endpoint, properties)
end