Class: Fog::AWS::ELB::LoadBalancers

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

Instance Attribute Summary

Attributes inherited from Collection

#connection

Instance Method Summary collapse

Methods inherited from Collection

#clear, #create, #inspect, #load, model, #model, #new, #reload, #table, #to_json

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

#initialize(attributes = {}) ⇒ LoadBalancers

Creates a new load balancer



9
10
11
# File 'lib/fog/aws/models/elb/load_balancers.rb', line 9

def initialize(attributes={})
  super
end

Instance Method Details

#allObject



13
14
15
16
# File 'lib/fog/aws/models/elb/load_balancers.rb', line 13

def all
  data = connection.describe_load_balancers.body['DescribeLoadBalancersResult']['LoadBalancerDescriptions']
  load(data)
end

#get(identity) ⇒ Object



18
19
20
21
22
23
# File 'lib/fog/aws/models/elb/load_balancers.rb', line 18

def get(identity)
  data = connection.describe_load_balancers(identity).body['DescribeLoadBalancersResult']['LoadBalancerDescriptions'].first
  new(data)
rescue Fog::AWS::ELB::NotFound
  nil
end