Class: ZabbixManager::Proxies

Inherits:
Basic
  • Object
show all
Defined in:
lib/zabbix_manager/classes/proxies.rb

Instance Method Summary collapse

Methods inherited from Basic

#add, #all, #create, #create_or_update, #default_options, #destroy, #dump_by_id, #get, #get_full_data, #get_id, #get_ids, #get_ids_by_identify, #get_key_ids, #get_key_ids_by_identify, #get_or_create, #get_or_create_keys, #get_raw, #hash_equals?, #initialize, #key, #keys, #log, #merge_hashes, #normalize_array, #normalize_hash, #parse_keys, #request_raw, #symbolize_keys, #update

Constructor Details

This class inherits a constructor from ZabbixManager::Basic

Instance Method Details

#delete(data) ⇒ Object

使用 Zabbix API 删除代理对象



16
17
18
19
# File 'lib/zabbix_manager/classes/proxies.rb', line 16

def delete(data)
  result = @client.api_request(method: "proxy.delete", params: data)
  result.empty? ? nil : result["proxyids"][0].to_i
end

#identifyObject

识别特定代理对象的 id 字段名称



11
12
13
# File 'lib/zabbix_manager/classes/proxies.rb', line 11

def identify
  "host"
end

#is_readable(data) ⇒ Object

检查代理对象是否可读



22
23
24
# File 'lib/zabbix_manager/classes/proxies.rb', line 22

def is_readable(data)
  @client.api_request(method: "proxy.isreadable", params: data)
end

#is_writable(data) ⇒ Object

检查代理对象是否可写



27
28
29
# File 'lib/zabbix_manager/classes/proxies.rb', line 27

def is_writable(data)
  @client.api_request(method: "proxy.iswritable", params: data)
end

#method_nameObject

与 Zabbix API 交互的代理方法名称



6
7
8
# File 'lib/zabbix_manager/classes/proxies.rb', line 6

def method_name
  "proxy"
end