colombo
A simple Digital Ocean (http://digitalocean.com) API wrapper
Install
gem install columbus
Examples
Configuration
Colombo.configure do |c|
c.api_key = ENV['DO_API_KEY']
c.client_id = ENV['DO_CLIENT_ID']
end
@client = Colombo.new(
:api_key => ENV['DO_API_KEY'],
:client_id => ENV['DO_CLIENT_ID']
)
Droplets
@client.droplet( droplet_id )
@client.droplets()
@client.droplets.find( droplet_id )
new_droplet = droplets.create({
:name => COLOMBO_DROPLET_NAME ,
:image_id => COLOMBO_IMAGE_ID ,
:region_id => COLOMBO_REGION_ID ,
:size_id => COLOMBO_SIZE_ID
})
@client.droplets.find( droplet_id ).reboot()
@client.droplets.find( droplet_id ).power_cycle()
@client.droplets.find( droplet_id ).shutdown()
Regions
@client.regions
Images
@client.images
@client.images(:filter => :my_images)
@client.images.find(image_id)
@client.images.find( image_id ).destroy(true)
SSH Keys
@client.ssh_keys
@client.find( ssh_key_id )
ssh_key = @client.ssh_keys.create({
:name => 'my ssh key name',
:ssh_pub_key => 'my ssh key ...'
})
ssh_key.update(:ssh_pub_key => 'my new ssh key')
ssh_key.destroy
Sizes
@client.sizes
Bug reports and other issues
Help and Docs
Contributing
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Send me a pull request. Bonus points for topic branches.
License
Colombo is free software distributed under the terms of the MIT license reproduced here.