Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colombo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colombo

  • 0.0.6
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

colombo Code Climate

A simple Digital Ocean (http://digitalocean.com) API wrapper

Install

gem install columbus

Examples

Configuration

# You can set Columbus configuration at class level like so
Colombo.configure do |c|
  c.api_key   = ENV['DO_API_KEY']
  c.client_id = ENV['DO_CLIENT_ID']
end

# Or configure each instance independently
@client = Colombo.new(
  :api_key   => ENV['DO_API_KEY'],
  :client_id => ENV['DO_CLIENT_ID']
)

Droplets


# This method returns a specfic droplet (via droplet id) without having to fetch all droplets first
@client.droplet( droplet_id )

# This method returns all active droplets that are currently running in your account
@client.droplets()

# This method returns full information for a specific droplet ID
@client.droplets.find( droplet_id )

# This method allows you to create a new droplet.
new_droplet = droplets.create({
  :name       => COLOMBO_DROPLET_NAME  ,
  :image_id   => COLOMBO_IMAGE_ID      ,
  :region_id  => COLOMBO_REGION_ID     ,
  :size_id    => COLOMBO_SIZE_ID
})

# This method allows you to reboot a droplet.
# This is the preferred method to use if a server is not responding.
@client.droplets.find( droplet_id ).reboot()

# This method allows you to power cycle a droplet.
# This will turn off the droplet and then turn it back on.
@client.droplets.find( droplet_id ).power_cycle()

# This method allows you to shutdown a running droplet.
# The droplet will remain in your account.
@client.droplets.find( droplet_id ).shutdown()

Regions

# Return all the available regions within the Digital Ocean cloud.
@client.regions

Images

# This method returns all the available images that can be accessed by your
# client ID. You will have access to all public images by default, and any
# snapshots or backups that you have created in your own account.
@client.images

# Takes the optional parameter filter, either :my_images or :global
@client.images(:filter => :my_images)

# This method displays the attributes of an image.
@client.images.find(image_id)

# This method allows you to destroy an image. There is no way to restore a
# deleted image so be careful and ensure your data is properly backed up.
# NOTE: You need to pass true to the destroy method to ensure that you know
# what you are doing.
@client.images.find( image_id ).destroy(true)

SSH Keys

# This method lists all the available public SSH keys in your account
# that can be added to a droplet.
@client.ssh_keys

# Shows a specific public SSH key in your account that can be added to a droplet.
@client.find( ssh_key_id )

# This method allows you to add a new public SSH key to your account.
ssh_key = @client.ssh_keys.create({
  :name        => 'my ssh key name',
  :ssh_pub_key => 'my ssh key ...'
})

# This method allows you to modify an existing public SSH key in your account.
ssh_key.update(:ssh_pub_key => 'my new ssh key')

# This method will delete the SSH key from your account.
ssh_key.destroy

Sizes

# This method returns all the available sizes that can be used to create a droplet.
@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.

FAQs

Package last updated on 04 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc