Class: Fog::Rackspace::LoadBalancers::LoadBalancers

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/rackspace/models/load_balancers/load_balancers.rb

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
# File 'lib/fog/rackspace/models/load_balancers/load_balancers.rb', line 10

def all
  data = service.list_load_balancers.body['loadBalancers']
  load(data)
end

#get(load_balancer_id) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/fog/rackspace/models/load_balancers/load_balancers.rb', line 15

def get(load_balancer_id)
  if load_balancer = service.get_load_balancer(load_balancer_id).body['loadBalancer']
    new(load_balancer)
  end
rescue Fog::Rackspace::LoadBalancers::NotFound
  nil
end