Class: Fog::OpenStack::Monitoring::AlarmDefinition

Inherits:
Fog::OpenStack::Model show all
Defined in:
lib/fog/openstack/monitoring/models/alarm_definition.rb

Instance Attribute Summary

Attributes inherited from Fog::OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from Fog::OpenStack::Model

#initialize, #save

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#createObject



22
23
24
25
26
27
28
# File 'lib/fog/openstack/monitoring/models/alarm_definition.rb', line 22

def create
  requires :name, :expression
  merge_attributes(
    service.create_alarm_definition(attributes).body
  )
  self
end

#destroyObject



45
46
47
48
49
# File 'lib/fog/openstack/monitoring/models/alarm_definition.rb', line 45

def destroy
  requires :id
  service.delete_alarm_definition(id)
  true
end

#patch(attr = nil) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/fog/openstack/monitoring/models/alarm_definition.rb', line 37

def patch(attr = nil)
  requires :id
  merge_attributes(
    service.patch_alarm_definition(id, attr || attributes).body
  )
  self
end

#to_sObject



51
52
53
# File 'lib/fog/openstack/monitoring/models/alarm_definition.rb', line 51

def to_s
  name
end

#update(attr = nil) ⇒ Object



30
31
32
33
34
35
# File 'lib/fog/openstack/monitoring/models/alarm_definition.rb', line 30

def update(attr = nil)
  requires :name, :expression
  merge_attributes(
    service.update_alarm_definition(id, attr || attributes).body
  )
end