Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (41 sloc) 2.79 KB

Rackspace Cloud Load Balancers


This is a Ruby interface into the Rackspace Cloud Load Balancers service. Mission-critical web-based applications and workloads require high availability. Load balancing distributes workloads across two or more servers, network links, and other resources to maximize throughput, minimize response time and avoid overload. Rackspace Cloud Load Balancers allow you to quickly load balance multiple Cloud Servers for optimal resource utilization.


This source is available on Github and the gem is available on RubyGems. To install it, do

sudo gem install cloudlb

To use it in Bundler, add the following statement to your Gemfile

gem "cloudlb"

RDOC Documentation

Find the latest RDoc documentation for this library at

API Documentation

This binding attempts to conform to the latest API specifications. For current API documentation, visit


See the class definitions for documentation on specific methods and operations.

require 'rubygems'
require 'cloudlb'

# Authenticate to the Rackspace Cloud, and choose to manage load balancers in the Dallas/Ft. Worth datacenter
lb = => "MY_USERNAME", :api_key => "MY_API_KEY", :region => :dfw)

# Show active load balancers
=> [
  {:status=>"ACTIVE", :port=>80, :updated=>{:time=>"2011-02-25T03:14:49+0000"}, :created=>{:time=>"2010-12-02T20:30:49+0000"}, :protocol=>"HTTP", :algorithm=>"RANDOM", :virtualIps=>[{:type=>"PUBLIC", :id=>21, :ipVersion=>"IPV4", :address=>""}], :name=>"stage-rax-lb", :id=>1}, 
  {:status=>"ACTIVE", :port=>80, :updated=>{:time=>"2011-02-25T15:31:16+0000"}, :created=>{:time=>"2011-02-25T01:11:31+0000"}, :protocol=>"HTTP", :algorithm=>"ROUND_ROBIN", :virtualIps=>[{:type=>"PUBLIC", :id=>38, :ipVersion=>"IPV4", :address=>""}], :name=>"Renamed LB", :id=>73}

# Select a load balancer
balancer = lb.get_load_balancer(1)
=> #<CloudLB::Balancer:0x101d7ebf8 @status="ACTIVE", @port=80, @name="stage-rax-lb", ...>

# Change the algorithm to round-robin

# Add a new node to the load balancer
node = balancer.create_node(:address => '', :port => 80)
=> #<CloudLB::Node:0x101d48c88 @status="ONLINE", @port=80, ...>


H. Wade Minter <>


See COPYING for license information. Copyright © 2011, Rackspace US, Inc.