How to Automate Cloud Infrastructure Using a Ruby SDK

You can automate cloud infrastructure using the Ruby SDK for the ProfitBricks API. This continues to add to our work with Ruby; however, the SDK is a bit different than our previous open-source contribution to the Fog project in that it abstracts and provides complete coverage for all current API functions. It exposes advanced functionality you may not find in a multi-cloud toolkit.

Why Ruby?

Ruby is a tremendously popular language used across the space. While it’s been around for awhile, Ruby has grown steadily and has seen industry leaders like Heroku launch their companies around it. It is also the language you will encounter when working with Chef, one of the most popular DevOps tools. As we grow our support for Ruby we will look to grow support within the DevOps toolkits that utilize it.


The library exposes a number of functions all of which map back to the REST API. You can find full documentation on the various aspects of the new API here and browse the Ruby repository here. We have taken the approach of keeping the code simple, while adhering to Ruby conventions.

Code Samples

Once you’ve followed our getting started guide you should have the gem available in your environment. The gem can be found on Ruby Gems.

You can create a Virtual Data Center, followed by adding a server:

You can take advantage of distinct features found in the ProfitBricks offering such as updating cores, memory, and disk independently of each other.

If you want to update the size, you would do:

Or maybe you want to create a volume:

You could then attach it:


The Ruby library creates a powerful interface to the REST API. With unlimited private networks, a developer can automate the creation of cluster environments where different services are segmented into different networks. All volumes get created on an ultra-fast disk subsystem which creates a compelling case for things like nice Big Data farms where I/O is tantamount; our library is excellent for doing these and other types of build outs automatically and at scale.

We will continue to improve and build upon this version one release of the Ruby SDK. We also welcome contributions back into the project and, as always, you can engage with the community over at DevOps Central. You might also want to sign-up for the ProfitBricks DevOps Central account and get a 33% discount off ProfitBricks’ award-winning IaaS platform.