Class: RZabbix::HostGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/rzabbix/host_group.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize, perform_request, #to_hash

Constructor Details

This class inherits a constructor from RZabbix::Base

Class Method Details

.default_attributesObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/rzabbix/host_group.rb', line 10

def self.default_attributes
  {                      
    :nodeids => nil,
    :groupids => nil,
    :hostids => nil,
    :templateids => nil,
    :graphids => nil,
    :triggerids => nil,
    :maintenanceids => nil,
    :monitored_hosts => nil,
    :templated_hosts => nil,
    :real_hosts => nil,
    :not_proxy_hosts => nil,
    :with_items => nil,
    :with_monitored_items => nil,
    :with_historical_items => nil,
    :with_triggers => nil,
    :with_monitored_triggers => nil,
    :with_httptests => nil,
    :with_monitored_httptests => nil,
    :with_graphs => nil,
    :editable => nil,
    :nopermissions => nil
    
#        :filter => nil,
#        :pattern => '',
#        
#        :output => Connection::API_OUTPUT_REFER,
#        :extendoutput => nil,
#        :select_hosts => nil,
#        :select_templates => nil,
#        :count => nil,
#        :preservekeys => nil,
#        :sortfield => '',
#        :sortorder => '',
#        :limit => nil,
#        :limitSelects => nil
  }
end

.find_by_name(name) ⇒ Object



5
6
7
8
# File 'lib/rzabbix/host_group.rb', line 5

def self.find_by_name(name)
  groups = perform_request(:hostgroup, :get, :filter => {:name=>name}, :output=>"extend")
  self.new(groups.first.rzbx_recursively_symbolize_keys) unless groups.empty?
end

Instance Method Details

#to_json(*args) ⇒ Object



50
51
52
# File 'lib/rzabbix/host_group.rb', line 50

def to_json(*args)
  self.attributes.to_json(*args)
end