Ask Your Question
0

How do I test Openstack APIs?

asked 2011-01-31 21:31:40 -0600

tpatil gravatar image

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?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2011-02-04 14:02:45 -0600

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

edit flag offensive delete link more
0

answered 2011-02-04 16:21:58 -0600

Or if you want Python you can check out these:

https://github.com/rackspace/python-novatools (https://github.com/rackspace/python-n...)

edit flag offensive delete link more
0

answered 2011-02-04 17:45:09 -0600

tpatil gravatar image

Great!!! Thank you very much.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-01-31 21:31:40 -0600

Seen: 50 times

Last updated: Feb 04 '11