Howdy guys--
I've made some good progress on the API, and Hugh suggested I punt some examples to the list.
First, we have "Flavors" which denote types of VM that can be spun up, with their capabilities:
<flavor href="http://localhost:3000/api/flavors/m1-large"> <id>m1-large</id> <memory>7.5</memory> <storage>850</storage> <architecture>x86_64</architecture> </flavor>
Next, we have images (templates in RHEV-M terminology):
<image href="http://localhost:3000/api/images/img1"> <id>img1</id> <description>Fedora 10</description> <owner_id>fedoraproject</owner_id> <architecture>x86_64</architecture> </image>
From there we can spin up instances, actual running VMs based upon an image:
<instance href="http://localhost:3000/api/instances/inst1"> <id>inst1</id> <public-address>img3.inst1.public.com</public-address> <image>http://localhost:3000/api/images/img3</image> <private-address>img3.inst1.private.com</private-address> <state>RUNNING</state> <owner_id>mockuser</owner_id> <flavor>http://localhost:3000/api/flavors/m1-small</flavor> </instance>
Storage volumes and snapshots are still works-in-progress.
The whole API is based upon discovery from a root URL, which gives entry-points into the sub-collections.
<api version="1.0"> <link rel="flavors">http://localhost:3000/api/flavors</link> <link rel="images">http://localhost:3000/api/images</link> <link rel="instances">http://localhost:3000/api/instances</link> <link rel="storage_volumes">http://localhost:3000/api/storage/volumes </link> <link rel="storage_snapshots">http://localhost:3000/api/storage/snapshots </link> </api>
I'm writing a Ruby client library also, which tries to be easy to use, and exposes a rich object model to the caller, with navigable and lazy- loaded references between
it "should allow navigation from instance to image" do DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client| instances = client.instances instances.should_not be_empty instance = instances.first instance.image.should_not be_nil instance.image.description.should_not be_nil instance.image.description.should be_a(String) end end
Models are defined here:
http://github.com/bobmcwhirter/deltacloud-client-ruby/blob/master/lib/models...
For instance, instance:
http://github.com/bobmcwhirter/deltacloud-client-ruby/blob/master/lib/models...
I'm also hacking together a "mock" driver, so that even folks without EC2 access can fire up a driver to test against. This is still a work- in-progress also (isn't everything?)
-Bob