Class: Nagios::API::Host

Inherits:
Resource show all
Defined in:
lib/nagios/api/host.rb

Instance Attribute Summary

Attributes inherited from Resource

#api_client, #attributes

Instance Method Summary collapse

Methods inherited from Resource

#initialize, #method_missing, #to_hash

Constructor Details

This class inherits a constructor from Nagios::API::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Nagios::API::Resource

Instance Method Details

#nameObject



28
29
30
# File 'lib/nagios/api/host.rb', line 28

def name
  host_name
end

#schedule_downtimeObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/nagios/api/host.rb', line 36

def schedule_downtime
  # host
  # author
  # comment
  # start_time
  # fixed
  # duration
  # end_time
  # services_too
end

#servicesObject



24
25
26
# File 'lib/nagios/api/host.rb', line 24

def services
  @services ||= Nagios::API::Services.new(api_client: api_client, host: self)
end

#stateObject



32
33
34
# File 'lib/nagios/api/host.rb', line 32

def state
  api_client.state.for_host(name)
end