Class: ZabbixApi::Applications
- Defined in:
- lib/zabbixapi/classes/applications.rb
Instance Method Summary collapse
-
#create_or_update(data) ⇒ Integer
Create or update Application object using Zabbix API.
-
#get_or_create(data) ⇒ Integer
Get or Create Application object using Zabbix API.
-
#indentify ⇒ String
The id field name used for identifying specific Application objects via Zabbix API.
-
#method_name ⇒ String
The method name used for interacting with Applications via Zabbix API.
Methods inherited from Basic
#add, #all, #create, #default_options, #delete, #destroy, #dump_by_id, #get, #get_full_data, #get_id, #get_raw, #hash_equals?, #initialize, #key, #keys, #log, #merge_params, #normalize_array, #normalize_hash, #parse_keys, #symbolize_keys, #update
Constructor Details
This class inherits a constructor from ZabbixApi::Basic
Instance Method Details
#create_or_update(data) ⇒ Integer
Create or update Application object using Zabbix API
38 39 40 41 |
# File 'lib/zabbixapi/classes/applications.rb', line 38 def create_or_update(data) applicationid = get_id(:name => data[:name], :hostid => data[:hostid]) applicationid ? update(data.merge(:applicationid => applicationid)) : create(data) end |
#get_or_create(data) ⇒ Integer
Get or Create Application object using Zabbix API
23 24 25 26 27 28 29 30 |
# File 'lib/zabbixapi/classes/applications.rb', line 23 def get_or_create(data) log "[DEBUG] Call get_or_create with parameters: #{data.inspect}" unless (id = get_id(:name => data[:name], :hostid => data[:hostid])) id = create(data) end id end |
#indentify ⇒ String
The id field name used for identifying specific Application objects via Zabbix API
13 14 15 |
# File 'lib/zabbixapi/classes/applications.rb', line 13 def indentify 'name' end |
#method_name ⇒ String
The method name used for interacting with Applications via Zabbix API
6 7 8 |
# File 'lib/zabbixapi/classes/applications.rb', line 6 def method_name 'application' end |