deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject Initial draft of EC2 frontend support
Date Thu, 10 May 2012 15:28:22 GMT
Hi guys,

This patch should bring the initial support for EC2 frontend. So far you can
launch an instance using the Mock driver (I did not tested the other drivers
yet).

How it works?

EC2 API -> EC2 API Query Parser -> EC2 ActionHandler -> EC2 ResultParser

EC2 API is a Sinatra::Base class, that implements the EC2 entrypoint ('/').
This frontend can be choosed when starting the Deltacloud server using:

./bin/deltacloudd -i mock -f ec2

Note! I removed the '--cimi' option and you can now use '-f cimi' to get CIMI
frontend instead of default Deltacloud API.

EC2 API Query Parser just process the query parameters, extracts authentication
tokens and action name.

EC2 ActionHandler then maps EC2 actions to Deltacloud driver API and also define
how the parameters should be translated from EC2 to Deltacloud format.
After translation is done, handler will send the method to driver and obtain
results.

EC2 ResultParser will then process the result and convert Deltacloud model to
EC2 XML format using nokogiri.

How you can test it?

Apply this patch on the 'deltacloud_modular' branch (!) and then start server
using:

$ ./bin/deltacloudd -i mock -f ec2

Spawn other terminal window and use curl:

$ curl -v --user 'mockuser:mockpassword' -X GET -H 'Accept: application/xml' \
  "http://localhost:3001/?Action=RunInstances&ImageId=img1&InstanceType=m1-small"

$ curl -v --user 'mockuser:mockpassword' -X GET -H 'Accept: application/xml' \
  "http://localhost:3001/?Action=DescribeInstances"

So far just four methods are implemented (check the query_parser.rb:20).


  -- Michal


Mime
View raw message