Class: Fog::HP::LB::LoadBalancer

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/hp/models/lb/load_balancer.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #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

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



22
23
24
25
26
# File 'lib/fog/hp/models/lb/load_balancer.rb', line 22

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

#nodesObject



36
37
38
39
40
41
42
43
# File 'lib/fog/hp/models/lb/load_balancer.rb', line 36

def nodes
  @nodes ||= begin
    Fog::HP::LB::Nodes.new({
      :service  => service,
      :load_balancer   => self
    })
  end
end

#nodes=(new_nodes = []) ⇒ Object



45
46
47
# File 'lib/fog/hp/models/lb/load_balancer.rb', line 45

def nodes=(new_nodes=[])
  nodes.load(new_nodes)
end

#ready?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/fog/hp/models/lb/load_balancer.rb', line 28

def ready?
  self.status == 'ACTIVE'
end

#saveObject



32
33
34
# File 'lib/fog/hp/models/lb/load_balancer.rb', line 32

def save
  identity ? update : create
end