Class: HP::Cloud::LbNodes

Inherits:
FogCollection show all
Defined in:
lib/hpcloud/lb_nodes.rb

Instance Attribute Summary

Attributes inherited from FogCollection

#items, #name

Instance Method Summary collapse

Methods inherited from FogCollection

#create, #empty?, #filter, #get, #get_array

Constructor Details

#initialize(load_balancer_id) ⇒ LbNodes

Returns a new instance of LbNodes.



27
28
29
30
# File 'lib/hpcloud/lb_nodes.rb', line 27

def initialize(load_balancer_id)
  super("load balancer node")
  @items = @connection.lb.nodes({:load_balancer_id => load_balancer_id})
end

Instance Method Details

#matches(arg, item) ⇒ Object



37
38
39
# File 'lib/hpcloud/lb_nodes.rb', line 37

def matches(arg, item)
  return ((arg == item.id.to_s) || (arg == "#{item.address}:#{item.port}"))
end

#unique(name) ⇒ Object



32
33
34
35
# File 'lib/hpcloud/lb_nodes.rb', line 32

def unique(name)
  super(name)
  Fog::HP::LB::Node.new({:service => Connection.instance.lb})
end