Skip to content

doubledutch/spacecadet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpaceCadet

SpaceCadet is a library written in Ruby for interacting with the Rackspace Cloud Load Balancers. The library itself uses the fog gem, which is a very popular Ruby library for interacting with all of the different cloud providers (including Rackspace).

License

SpaceCadet is released under the Apache 2.0 license. See the LICENSE file for full the full details of the license.

Why SpaceCadet?

Because this library is meant to speed up deploys, and it's a little "special"...

It's not meant to be pretty, clean, or re-usable. This library was written with one purpose in mind: being able to change a single backend node from ENABLED to DRAINING within multiple LBs.

Also: (Rack)space.

Including in Gemfile

gem 'dd_spacecadet', git: 'git@ddgit.me:EngOps/spacecadet.git'

Usage

Here's an example of using the library while interacting with the DFW region:

require 'dd_spacecadet'

env = 'dfw-prod'
region = 'DFW'

DoubleDutch::SpaceCadet::Config.register(
  env, ENV['RS_CLOUD_USERNAME'], ENV['RS_CLOUD_KEY'], region
)

dfw_prod = DoubleDutch::SpaceCadet::LB.new(env)

# search for an LB by its label, in this example "prod-lb"
# if multiple LBs match it will use *ALL* of them
dfw_prod.find_lb_and_use('prod-lb')

# gets the status of each LB and its nodes
# you can use dfw.print_status to print the info to stdout with formatting
dfw.status

dfw.update_node('node01', :draining)

dfw.update_node('node01', :enabled)

About

A helper library around management of the Rackspace Cloud Load Balancers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages