Class: Fog::HP::LB::Nodes

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#load_balancerObject

Returns the value of attribute load_balancer.



10
11
12
# File 'lib/fog/hp/models/lb/nodes.rb', line 10

def load_balancer
  @load_balancer
end

Instance Method Details

#allObject



12
13
14
15
16
# File 'lib/fog/hp/models/lb/nodes.rb', line 12

def all
  requires :load_balancer
  data = service.list_load_balancer_nodes(load_balancer.id).body['nodes']
  load(data)
end

#get(node_id) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/fog/hp/models/lb/nodes.rb', line 18

def get(node_id)
  requires :load_balancer
  node = service.get_load_balancer_node(load_balancer.id, node_id).body
  new(node)
rescue Fog::HP::LB::NotFound
  nil
end