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

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

Instance Method Summary collapse

Instance Method Details

#allObject



31
32
33
34
35
# File 'lib/monkey/hp/models/lb/nodes.rb', line 31

def all
  data = service.list_load_balancer_nodes(@attributes[:load_balancer_id]).body['nodes']
  load(data)
  self.each{ |x| x.load_balancer_id = @attributes[:load_balancer_id] }
end

#get(record_id) ⇒ Object



37
38
39
40
41
42
# File 'lib/monkey/hp/models/lb/nodes.rb', line 37

def get(record_id)
  record = service.get_load_balancer_node(@attributes[:load_balancer_id], record_id).body['node']
  new(record)
rescue Fog::HP::LB::NotFound
  nil
end