RightApiProvision
Basic helper gem for provisioning IaaS servers using the RightScale API.
It is intended to be used by ruby applications that need to launch servers.
Installation
Add this line to your application's Gemfile:
gem 'right_api_provision'
And then execute:
$ bundle
Usage
See lib/right_api_provisioner/provisioner.rb for all public methods.
Example:
require "right_api_provision"
# initialize rightscale provisioner
@rightscale =
RightApiProvision::Provisioner.new("[email protected]", // user
"my_rightscale_password", // password
12345) // rightscale account ID
# setup some inputs
server_inputs = {
# open up port 8000
"sys_firewall/rule/enable" => "text:enable",
"sys_firewall/rule/port" => "text:8000",
"sys_firewall/rule/ip_address" => "text:any",
"sys_firewall/rule/protocol" => "text:tcp"
}
# provision a RightScale managed server from a ServerTemplate
@rightscale.provision("My Cool Server",
"ServerTemplate for Linux (v13.5)", // name or ID
"AWS US-East",
"My Deployment",
server_inputs)
# wait for server to be ready
state = @rightscale.wait_for_operational
# Do stuff with your brand new server...
TODO
- document this readme
- add logger class
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request