Sha256: c62f8c6d475f6403b16b44383f6e06b8157d23469e133b80071170857d4fa138

Contents?: true

Size: 1.01 KB

Versions: 53

Compression:

Stored size: 1.01 KB

Contents

require 'fog/core/collection'
require 'fog/storm_on_demand/models/network/balancer'

module Fog
  module Network
    class StormOnDemand

      class Balancers < Fog::Collection

        model Fog::Network::StormOnDemand::Balancer

        def all(options={})
          data = service.list_balancers(options).body['items']
          load(data)
        end

        def available(name)
          avail = service.check_balancer_available(:name => name).body
          avail['available'].to_i == 1 ? true : false
        end

        def create(options)
          balancer = service.create_balancer(options).body
          new(balancer)
        end

        def get(uniq_id)
          balancer = service.get_balancer_details(:uniq_id => uniq_id).body
          new(balancer)
        end

        def possible_nodes(options={})
          service.get_balancer_possible_nodes(options).body['items']
        end

        def strategies
          service.get_balancer_strategies.body['strategies']
        end

      end

    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
fog-1.22.0 lib/fog/storm_on_demand/models/network/balancers.rb
fog-1.21.0 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/storm_on_demand/models/network/balancers.rb
fog-1.20.0 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/storm_on_demand/models/network/balancers.rb
fog-1.19.0 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/storm_on_demand/models/network/balancers.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/storm_on_demand/models/network/balancers.rb