Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

91 lines (63 sloc) 2.795 kb

Rackspace Cloud Servers


This is a Ruby interface into the Rackspace Cloud Servers service. Cloud Servers from The Rackspace Cloud put you in complete control of your hosting infrastructure. Each Cloud Server is a fully-customizable, pay by the hour, virtualized Windows or Linux server instance that you launch, maintain, and control with full root access.

*Note that in version 0.2.0 the connection style changed, from positional arguments to a hash of options*


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

gem sources -a (Newer Ruby Gems have this already)

sudo gem install cloudservers

To use it in a Rails application, add the following information to your config/environment.rb

config.gem "cloudservers"


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

require 'rubygems'
require 'cloudservers'

# Log into the Cloud Servers
cs = => USERNAME, :api_key => API_KEY)

# Log into the Cloud Servers UK
cs = => USERNAME, :api_key => API_KEY, :auth_url => CloudServers::AUTH_UK)

# Get a listing of all current servers
>> cs.servers
=> [{:name=>"RenamedRubyTest", :id=>110917}]

# Access a specific server
>> server = cs.server(110917)
=> "RenamedRubyTest"

# or...

# See what type of server this is
=> "256 server"
=> "Ubuntu 8.04.2 LTS (hardy)"

# Soft-reboot the server
>> server.reboot
=> true

# Create a new 512MB CentOS 5.2 server.  The root password is returned in the adminPass method.
>> image = cs.get_image(8)
=> #<CloudServers::Image:0x1014a8060 ...>, status"ACTIVE"
=> "CentOS 5.2"
>> flavor = cs.get_flavor(2)
=> #<CloudServers::Flavor:0x101469130 @disk=20, @name="512 server", @id=2, @ram=512>
=> "512 server"
>> newserver = cs.create_server(:name => "New Server", :imageId =>, :flavorId =>
=> #<CloudServers::Server:0x101433f08 ....
>> newserver.status
=> "BUILD"
>> newserver.progress
=> 0
>> newserver.adminPass
=> "NewServerMbhzUnO"
>> newserver.refresh
=> true
>> newserver.progress
=> 12

# Delete the new server
>> newserver.delete!
=> true


By H. Wade Minter <>, Mike Mayo <>, and Dan Prince <>


See COPYING for license information.

Jump to Line
Something went wrong with that request. Please try again.