Class: ZabbixApi::Users

Inherits:
Basic
  • Object
show all
Defined in:
lib/zabbixapi/classes/users.rb

Instance Method Summary collapse

Methods inherited from Basic

#add, #all, #create, #create_or_update, #default_options, #delete, #destroy, #dump_by_id, #get, #get_full_data, #get_id, #get_or_create, #hash_equals?, #initialize, #log, #merge_params, #normalize_hash, #parse_keys, #symbolize_keys, #update

Constructor Details

This class inherits a constructor from ZabbixApi::Basic

Instance Method Details

#add_medias(data) ⇒ Object


20
21
22
23
24
25
26
27
28
29
# File 'lib/zabbixapi/classes/users.rb', line 20

def add_medias(data)
  result = @client.api_request(
    :method => "user.addMedia",
    :params => {
      :users => data[:userids].map { |t| {:userid => t} },
      :medias => data[:media]
    }
  )
  result ? result['mediaids'][0].to_i : nil
end

#indentifyObject


16
17
18
# File 'lib/zabbixapi/classes/users.rb', line 16

def indentify
  "alias"
end

#keyObject


12
13
14
# File 'lib/zabbixapi/classes/users.rb', line 12

def key 
  "userid"
end

#keysObject


8
9
10
# File 'lib/zabbixapi/classes/users.rb', line 8

def keys
  "userids"
end

#method_nameObject


4
5
6
# File 'lib/zabbixapi/classes/users.rb', line 4

def method_name
  "user"
end