Class: ZabbixManager::Applications

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

Instance Method Summary collapse

Methods inherited from Basic

#add, #all, #create, #create_or_update, #create_raw, #default_options, #delete, #delete_raw, #destroy, #dump_by_id, #get, #get_full_data, #get_id, #get_or_create, #get_raw, #hash_equals?, #initialize, #key, #keys, #log, #normalize_hash, #parse_keys, #update, #update_raw

Constructor Details

This class inherits a constructor from ZabbixManager::Basic

Instance Method Details

#identifyString

返回应用集对象用于业务识别的字段名。

Returns:

  • (String)


15
16
17
# File 'lib/zabbix_manager/classes/applications.rb', line 15

def identify
  "name"
end

#identity_filter(data) ⇒ Hash

生成由应用集名称和所属主机构成的稳定查询条件。

Parameters:

  • data (Hash)

    包含 name 和 hostid 的应用集属性

Returns:

  • (Hash)

    应用集唯一查询条件



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

def identity_filter(data)
  attributes = data.deep_symbolize_keys
  { name: attributes.fetch(:name), hostid: attributes.fetch(:hostid) }
end

#method_nameString

返回应用集对象对应的 Zabbix API 方法前缀。

Returns:

  • (String)


8
9
10
# File 'lib/zabbix_manager/classes/applications.rb', line 8

def method_name
  "application"
end