Online Labs ruby client


#1

I just released a simple ruby client https://github.com/bchatelard/onlinelabs-ruby

Here a sample form the README:

require 'onlinelabs'

OnlineLabs.organization = <organization_key>
OnlineLabs.token = <token>

# get the docker image
image = OnlineLabs::Image.find_by_name('Docker')

# create 5 new servers
5.times do |x|
    OnlineLabs::Server.create name: "docker#{x}", image: image.id, tags: ['docker']
end

# power on
OnlineLabs::Server.all.each do |server|
    OnlineLabs::Server.power_on(server.id)
end

# do something ...

# power off
OnlineLabs::Server.all.each do |server|
    OnlineLabs::Server.power_off(server.id)
end

Enjoy !