Sha256: 5204012d002cbf1ab0f649f95769f944b4528810b6c824758413c7560f42cf13

Contents?: true

Size: 828 Bytes

Versions: 12

Compression:

Stored size: 828 Bytes

Contents

module Fog
  module Rackspace
    class LoadBalancers
      class Real
        def create_load_balancer(name, protocol, port, virtual_ips, nodes, options = {})
          data = {
            'loadBalancer' => {
              'name' => name,
              'port' => port,
              'protocol' => protocol,
              'virtualIps' => virtual_ips,
              'nodes' => nodes
            }
          }

          data['loadBalancer']['algorithm'] = options[:algorithm] if options.has_key? :algorithm
          data['loadBalancer']['timeout'] = options[:timeout] if options.has_key? :timeout

          request(
            :body     => Fog::JSON.encode(data),
            :expects  => 202,
            :method   => 'POST',
            :path     => 'loadbalancers.json'
          )
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
fog-1.15.0 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
gapinc-fog-1.14.0 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
fog-1.14.0 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
fog-1.13.0 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
gapinc-fog-1.12.1.2 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
gapinc-fog-1.12.1.1 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
gapinc-fog-1.12.1a lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
gapinc-fog-1.12.1 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
fog-1.12.1 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb
fog-1.12.0 lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb