Skip to content

Instantly share code, notes, and snippets.

@elight
Created July 16, 2014 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elight/026e203471adcd403237 to your computer and use it in GitHub Desktop.
Save elight/026e203471adcd403237 to your computer and use it in GitHub Desktop.
require 'aviator'
configuration = {
:provider => 'openstack',
:auth_service => {
:name => 'identity',
:host_uri => 'http://devstack:5000/v2.0',
:request => 'create_token',
:validator => 'list_tenants'
},
:auth_credentials => {
:username => 'myusername',
:password => 'mypassword',
:tenant_name => 'myproject'
}
}
openstack = Aviator::Session.new(
:config => configuration,
:log_file => 'path/to/aviator.log'
)
openstack.authenticate
keystone = openstack.identity_service
response = keystone.request(:list_tenants)
puts response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment