Class: Fog::Network::OpenStack::LbHealthMonitor

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/openstack/models/network/lb_health_monitor.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

#initialize(attributes) ⇒ LbHealthMonitor

Returns a new instance of LbHealthMonitor.



20
21
22
23
# File 'lib/fog/openstack/models/network/lb_health_monitor.rb', line 20

def initialize(attributes)
  prepare_service_value(attributes)
  super
end

Instance Method Details

#associate_to_pool(pool_id) ⇒ Object



53
54
55
56
57
# File 'lib/fog/openstack/models/network/lb_health_monitor.rb', line 53

def associate_to_pool(pool_id)
  requires :id
  service.associate_lb_health_monitor(pool_id, self.id)
  true
end

#createObject



30
31
32
33
34
35
36
37
38
# File 'lib/fog/openstack/models/network/lb_health_monitor.rb', line 30

def create
  requires :type, :delay, :timeout, :max_retries
  merge_attributes(service.create_lb_health_monitor(self.type,
                                                    self.delay,
                                                    self.timeout,
                                                    self.max_retries,
                                                    self.attributes).body['health_monitor'])
  self
end

#destroyObject



47
48
49
50
51
# File 'lib/fog/openstack/models/network/lb_health_monitor.rb', line 47

def destroy
  requires :id
  service.delete_lb_health_monitor(self.id)
  true
end

#disassociate_from_pool(pool_id) ⇒ Object



59
60
61
62
63
# File 'lib/fog/openstack/models/network/lb_health_monitor.rb', line 59

def disassociate_from_pool(pool_id)
  requires :id
  service.disassociate_lb_health_monitor(pool_id, self.id)
  true
end

#saveObject



25
26
27
28
# File 'lib/fog/openstack/models/network/lb_health_monitor.rb', line 25

def save
  requires :type, :delay, :timeout, :max_retries
  identity ? update : create
end

#updateObject



40
41
42
43
44
45
# File 'lib/fog/openstack/models/network/lb_health_monitor.rb', line 40

def update
  requires :id, :type, :delay, :timeout, :max_retries
  merge_attributes(service.update_lb_health_monitor(self.id,
                                                    self.attributes).body['health_monitor'])
  self
end