Sha256: 32c945c82d55b0e42786c47cc6533d857ff321a5b51246f9a270c0fdc4cd351a

Contents?: true

Size: 1.05 KB

Versions: 59

Compression:

Stored size: 1.05 KB

Contents

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
          result = []
          marker = nil
          finished = false
          while !finished
            data = service.describe_load_balancers('Marker' => marker).body
            result.concat(data['DescribeLoadBalancersResult']['LoadBalancerDescriptions'])
            marker = data['DescribeLoadBalancersResult']['NextMarker']
            finished = marker.nil?
          end
          load(result) # data is an array of attribute hashes
        end

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

Version data entries

59 entries across 57 versions & 6 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aws-2.0.1/lib/fog/aws/models/elb/load_balancers.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aws-2.0.1/lib/fog/aws/models/elb/load_balancers.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/lib/fog/aws/models/elb/load_balancers.rb
fog-aws-2.0.1 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-2.0.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-1.4.1 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-1.4.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-1.3.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-1.2.1 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-1.2.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-1.1.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-1.0.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.13.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.12.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.11.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.10.0 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.9.4 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.9.3 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.9.2 lib/fog/aws/models/elb/load_balancers.rb
fog-aws-0.9.1 lib/fog/aws/models/elb/load_balancers.rb