Class: Fog::Monitoring::OpenStack::NotificationMethod

Inherits:
OpenStack::Model
  • Object
show all
Defined in:
lib/fog/monitoring/openstack/models/notification_method.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

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

Instance Method Details

#createObject


15
16
17
18
19
20
# File 'lib/fog/monitoring/openstack/models/notification_method.rb', line 15

def create
  requires :name, :type, :address
  merge_attributes(
    service.create_notification_method(attributes).body
  )
end

#destroyObject


35
36
37
38
39
# File 'lib/fog/monitoring/openstack/models/notification_method.rb', line 35

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

#patch(attr = nil) ⇒ Object


29
30
31
32
33
# File 'lib/fog/monitoring/openstack/models/notification_method.rb', line 29

def patch(attr = nil)
  merge_attributes(
    service.patch_notification_method(id, attr || attributes).body
  )
end

#to_sObject


41
42
43
# File 'lib/fog/monitoring/openstack/models/notification_method.rb', line 41

def to_s
  name
end

#update(attr = nil) ⇒ Object


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

def update(attr = nil)
  requires :name, :type, :address
  merge_attributes(
    service.put_notification_method(id, attr || attributes).body
  )
end