Sha256: 52c6f8748406c5e2184e17b7f8493407a90648286f39eee12ee413440b8a5aca

Contents?: true

Size: 655 Bytes

Versions: 41

Compression:

Stored size: 655 Bytes

Contents

require 'fog/core/collection'
require 'fog/rackspace/models/load_balancers/load_balancer'

module Fog
  module Rackspace
    class LoadBalancers

      class LoadBalancers < Fog::Collection

        model Fog::Rackspace::LoadBalancers::LoadBalancer

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

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

Version data entries

41 entries across 41 versions & 13 rubygems

Version Path
fog-1.2.0 lib/fog/rackspace/models/load_balancers/load_balancers.rb
ktheory-fog-1.1.2 lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
fog-1.1.2 lib/fog/rackspace/models/load_balancers/load_balancers.rb
fog_tractical-1.1.4 lib/fog/rackspace/models/load_balancers/load_balancers.rb
fog_tractical-1.1.3 lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
fog-1.1.1 lib/fog/rackspace/models/load_balancers/load_balancers.rb
fog-1.1.0 lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
tag-fog-1.0.1 lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
fog-1.0.0 lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/load_balancers.rb