Class: DNApi::Components::Nagios
- Includes:
- DNApi::Component
- Defined in:
- lib/dnapi/components/nagios.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#master_key ⇒ Object
Returns the value of attribute master_key.
Attributes inherited from Struct
Instance Method Summary collapse
Methods included from DNApi::Component
[], #can_belong_to?, components, from, included, #key, #to_hash
Methods inherited from Struct
#==, _many, #_many, #_many_values, _ones, #_ones, #_ones_values, _umembers, belongs_to, from, #initialize, #inspect, many, map, one, #to_hash, #umember_inspect, unserialized_member
Methods included from Test::Ext
#default_fauxture_name, #fixture, #generate, #generate_attributes, #pick
Constructor Details
This class inherits a constructor from DNApi::Struct
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint
3 4 5 |
# File 'lib/dnapi/components/nagios.rb', line 3 def endpoint @endpoint end |
#master_key ⇒ Object
Returns the value of attribute master_key
3 4 5 |
# File 'lib/dnapi/components/nagios.rb', line 3 def master_key @master_key end |
Instance Method Details
#master? ⇒ Boolean
15 16 17 |
# File 'lib/dnapi/components/nagios.rb', line 15 def master? master_instance == instance end |
#master_instance ⇒ Object
11 12 13 |
# File 'lib/dnapi/components/nagios.rb', line 11 def master_instance instance.environment.instances.detect {|i| i.id == master_key } end |
#monitored_instances ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/dnapi/components/nagios.rb', line 19 def monitored_instances if master? instance.environment.instances else [master_instance] end end |