1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/models/elb/load_balancers.rb

29 lines
711 B
Ruby
Raw Normal View History

require 'fog/aws/models/elb/load_balancer'
module Fog
module AWS
class ELB
class LoadBalancers < Fog::Collection
model Fog::AWS::ELB::LoadBalancer
# Creates a new load balancer
def initialize(attributes={})
super
end
def all
data = connection.describe_load_balancers.body['DescribeLoadBalancersResult']['LoadBalancerDescriptions']
load(data)
end
def get(identity)
data = connection.describe_load_balancers(identity).body['DescribeLoadBalancersResult']['LoadBalancerDescriptions'].first
new(data)
rescue Fog::AWS::ELB::NotFound
nil
end
end
end
end
end