Class: Fog::Rackspace::Monitoring::Entity
- Defined in:
- lib/fog/rackspace/models/monitoring/entity.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#alarms ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/fog/rackspace/models/monitoring/entity.rb', line 46 def alarms @alarms ||= begin Fog::Rackspace::Monitoring::Alarms.new( :entity => self, :service => service ) end end |
#checks ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/fog/rackspace/models/monitoring/entity.rb', line 37 def checks @checks ||= begin Fog::Rackspace::Monitoring::Checks.new( :entity => self, :service => service ) end end |
#destroy ⇒ Object
55 56 57 58 |
# File 'lib/fog/rackspace/models/monitoring/entity.rb', line 55 def destroy requires :id service.delete_entity(id) end |
#params ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/rackspace/models/monitoring/entity.rb', line 17 def params = { 'label' => label, 'metadata' => , 'ip_addresses'=> ip_addresses, 'agent_id' => agent_id } .reject {|key, value| value.nil?} end |
#save ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/rackspace/models/monitoring/entity.rb', line 27 def save if identity data = service.update_entity(identity, params) else data = service.create_entity(params) self.id = data.headers['X-Object-ID'] end true end |