Class: ZabbixManager::Actions
- Defined in:
- lib/zabbix_manager/classes/actions.rb
Instance Method Summary collapse
-
#get_full_data(data) ⇒ Hash
获取操作及其执行、恢复、确认操作和过滤条件的完整数据。.
-
#identify ⇒ String
返回操作对象用于业务识别的字段名。.
-
#method_name ⇒ String
返回操作对象对应的 Zabbix API 方法前缀。.
Methods inherited from Basic
#add, #all, #create, #create_or_update, #create_raw, #default_options, #delete, #delete_raw, #destroy, #dump_by_id, #get, #get_id, #get_or_create, #get_raw, #hash_equals?, #identity_filter, #initialize, #key, #keys, #log, #normalize_hash, #parse_keys, #update, #update_raw
Constructor Details
This class inherits a constructor from ZabbixManager::Basic
Instance Method Details
#get_full_data(data) ⇒ Hash
获取操作及其执行、恢复、确认操作和过滤条件的完整数据。
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/zabbix_manager/classes/actions.rb', line 25 def get_full_data(data) log "[DEBUG] Call get_full_data with parameters: #{data.inspect}" @client.api_request( method: "#{method_name}.get", params: { filter: { identify.to_sym => data[identify.to_sym] }, output: "extend", selectOperations: "extend", selectRecoveryOperations: "extend", selectAcknowledgeOperations: "extend", selectFilter: "extend" } ) end |
#identify ⇒ String
返回操作对象用于业务识别的字段名。
15 16 17 |
# File 'lib/zabbix_manager/classes/actions.rb', line 15 def identify "name" end |
#method_name ⇒ String
返回操作对象对应的 Zabbix API 方法前缀。
8 9 10 |
# File 'lib/zabbix_manager/classes/actions.rb', line 8 def method_name "action" end |