Class: Fog::Network::OpenStack::LbPool

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/openstack/models/network/lb_pool.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) ⇒ LbPool

Returns a new instance of LbPool.



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

def initialize(attributes)
  prepare_service_value(attributes)
  super
end

Instance Method Details

#associate_health_monitor(health_monitor_id) ⇒ Object



63
64
65
66
67
# File 'lib/fog/openstack/models/network/lb_pool.rb', line 63

def associate_health_monitor(health_monitor_id)
  requires :id
  service.associate_lb_health_monitor(self.id, health_monitor_id)
  true
end

#createObject



35
36
37
38
39
40
41
42
# File 'lib/fog/openstack/models/network/lb_pool.rb', line 35

def create
  requires :subnet_id, :protocol, :lb_method
  merge_attributes(service.create_lb_pool(self.subnet_id,
                                          self.protocol,
                                          self.lb_method,
                                          self.attributes).body['pool'])
  self
end

#destroyObject



51
52
53
54
55
# File 'lib/fog/openstack/models/network/lb_pool.rb', line 51

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

#disassociate_health_monitor(health_monitor_id) ⇒ Object



69
70
71
72
73
# File 'lib/fog/openstack/models/network/lb_pool.rb', line 69

def disassociate_health_monitor(health_monitor_id)
  requires :id
  service.disassociate_lb_health_monitor(self.id, health_monitor_id)
  true
end

#saveObject



30
31
32
33
# File 'lib/fog/openstack/models/network/lb_pool.rb', line 30

def save
  requires :subnet_id, :protocol, :lb_method
  identity ? update : create
end

#statsObject



57
58
59
60
61
# File 'lib/fog/openstack/models/network/lb_pool.rb', line 57

def stats
  requires :id
  merge_attributes(service.get_lb_pool_stats(self.id).body['stats'])
  self
end

#updateObject



44
45
46
47
48
49
# File 'lib/fog/openstack/models/network/lb_pool.rb', line 44

def update
  requires :id, :subnet_id, :protocol, :lb_method
  merge_attributes(service.update_lb_pool(self.id,
                                          self.attributes).body['pool'])
  self
end