An updated ruby-openstack rubygem

This post is so long overdue that I’ve forgotten much of the details involved. In short, there’s a new rubygem in town for talking to Openstack. Well - ‘new’ is definitely an exaggeration; the ruby-openstack gem is the merger between the ruby-openstack-compute and ruby-cloudfiles gems.


Now why would you want to do that?!

The deltacloud openstack driver was recently (o_O) updated to work with v2 of the OS (Nova) API. At that time I used the the ruby-openstack-compute gem to handle the calls out to the Openstack Nova service. I got talking to Dan Prince who was the main contributer and maintainer of ruby-openstack-compute and we agreed it would be nice to have a single ruby gem to handle all Openstack services. Right now ruby-openstack does v2 authentication (Keystone) and handles Nova (Openstack Compute) as well as Swift (Openstack Object storage). The idea is that the codebase will be expanded to add all Openstack services.


How do I use it?

The README is pretty self-explanatory. Basically:

  sudo gem install openstack
  [sudo] password for herp:
  Successfully installed openstack-1.0.1

  [herp@name lib]$ irb -rubygems
  irb(main):001:0> require 'openstack'
  => true

  irb(main):002:0> os = OpenStack::Connection.create({:username => "herp@derp.net", :api_key=>"1234abcd", :auth_method=>"password", :auth_url => "https://regionerer-g.go-bar.identity.dacloudfoo.herpy:13327/v2.0/", :authtenant_name =>"herp@derp.net-default-tenant", :service_type=>"compute"})

  => #<OpenStack::Compute::Connection:0xb7339070 @connection=#<OpenStack::Connection:0xb73392dc @service_scheme="https", @auth_host="regionerer-g.go-bar.identity.dacloudfoo.herpy", @http={}, @service_name=nil, @authuser="herp@derp.net", @proxy_port=nil, @auth_path="/v2.0/", @authtenant={:type=>"tenantName", :value=>"herp@derp.net-default-tenant"}, @service_port=443, @authkey="1235abcd", @authok=true, @service_type="compute", @auth_method="password", @auth_scheme="https", @service_host="az-2.region-a.geo-1.dacloudfoo.herpy", @is_debug=nil, @proxy_host=nil, @service_path="/v1.1/482195756462871", @auth_port=35357, @auth_url="https://regionerer-g.go-bar.identity.dacloudfoo.herpy:13327/v2.0/", @region=nil, @authtoken="Auth_543254fdsasabd546543a3", @retry_auth=nil>>

i.e., you use OpenStack::Connection.create to get a handle to an OpenStack service - setting the :service_type parameter to either “compute” or “object-store”.


Next

The latest update to the gem adds support for api_extensions. Right now the keypairs extension is implemented (list/create/delete and include in server instance params) with more to follow. The ‘team’ consists of many of the deltacloud core developers and we can certainly do with more help/bug-reports/docs/beer. So if you are using ruby and need to talk to Openstack - check it out and feel free to jump in!



blog comments powered by Disqus
RSS Feed Icon site.xml
RSS Feed Icon tripleo.xml