Skip to content

opsgit/rest_connection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"gem install rest_connection"
"git clone http://github.com/rightscale/rest_connection.git"
"gem install jeweler rspec"
"rake check_dependencies" <- Install any gems listed.
"rake install"

You must setup ~/.rest_connection/rest_api_config.yaml or /etc/rest_connection/rest_api_config.yaml

Copy the example from GEMHOME/rest_connection/config/rest_api_config.yaml.sample and fill in your connection info.

Pro Tip: to find a GEMHOME, use gemedit
"gem install gemedit"
"gem edit rest_connection"
$ irb
ruby> require 'rubygems'; require 'rest_connection'
first_fe = Server.find(:first) { |s| s.nickname =~ /Front End/ }
st = ServerTemplate.find(first_fe.server_template_href)
connect_script = st.executables.detect { |ex| ex.name =~  /LB [app|mongrels]+ to HA proxy connect/i }
state = first_fe.run_executable(connect_script)
state.wait_for_completed
deployment = Deployment.find(opts[:id])
my_servers = deployment.servers
my_servers.each { |s| s.stop }
my_servers.each { |s| s.wait_for_state("stopped") }
my_array = Ec2ServerArray.find(opts[:href])
my_array.active = true
my_array.save

puts my_array.instances.map { |i| i['ip-address'] }
Edit VERSION and bump the number
rake gemspec
rake install
visit www.rubygems.org
  gem push pkg/rest_connection-0.0.0.gem (use your new version number in this command)

About

Net::HTTP helper for restful requests -and- additional library of helpers for various APIs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 96.0%
  • Perl 2.1%
  • Shell 1.9%