How do I test Openstack APIs?

Asked by Tushar Patil

I know how to test EC2 api's supported by nova using euca2ools.
Now I want to start testing Openstack APIs of nova.

Are there any tools available similar to euca2ools to test Openstack APIs?

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Tushar Patil
Solved:
Last query:
Last reply:
Revision history for this message
Dan Prince (dan-prince) said :
#1

You could use the Ruby bindings which are based on the Cloud Servers API bindings. The Openstack API still has some functionality missing but the core is there.

1) First install the openstack-compute rubygem (gem install openstack-compute)

2) Then you can create Ruby scripts and objects to interact with the API. The example below works if you 'source novarc' first:

require 'rubygems'
require 'openstack/compute'

USERNAME=ENV['CLOUD_SERVERS_USERNAME']
API_KEY=ENV['CLOUD_SERVERS_API_KEY']
API_URL=ENV['CLOUD_SERVERS_URL']
cs = OpenStack::Compute::Connection.new(:username => USERNAME, :api_key => API_KEY, :api_url => API_URL)

cs.flavors.each do |flavor|
 puts flavor.inspect
end

cs.images.each do |image|
  puts image.inspect
end

cs.create_server(:name => "Test1", :imageId => 2, :flavorId => 1)

cs.servers.each do |server|
  puts server.inspect
end

Revision history for this message
Dan Prince (dan-prince) said :
#2

Or if you want Python you can check out these:

https://github.com/rackspace/python-novatools

Revision history for this message
Tushar Patil (tpatil) said :
#3

Great!!! Thank you very much.