Class: ZabbixManager::Configurations

Inherits:
Basic
  • Object
show all
Defined in:
lib/zabbix_manager/classes/configurations.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_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

#array_flagObject

用于标识返回结果是否为数组



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

def array_flag
  true
end

#export(data) ⇒ Object

使用 Zabbix API 导出配置数据



21
22
23
# File 'lib/zabbix_manager/classes/configurations.rb', line 21

def export(data)
  @client.api_request(method: "configuration.export", params: data)
end

#identifyObject

用于通过 Zabbix API 标识特定 Configuration 对象的 id 字段名称



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

def identify
  "host"
end

#import(data) ⇒ Object

使用 Zabbix API 导入配置数据



26
27
28
# File 'lib/zabbix_manager/classes/configurations.rb', line 26

def import(data)
  @client.api_request(method: "configuration.import", params: data)
end

#method_nameObject

用于通过 Zabbix API 与 Configurations 交互的方法名称



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

def method_name
  "configuration"
end