Patches 1/2 add the Volume model to server and self find to model itself
Patch 3 adds VolumeConfiguration collection and Volume create route to server

(note, drivers currently supporting Deltacloud::StorageVolume are ec2 and 
rhevm. I used  EC2 
as reference in implementing this patch series. EC2 has no notion of 
VolumeCOnfiguration... only
specifies that 'capacity' is between 1 and 1000 GiB. So the 'find' method 
basically creates
the VolumeConfigurations 'on the fly'.. listing all gives you 1000 of them... 
needs scrutiny+discussion)

Patch 4 Adds the self find to VolumeConfiguration model
Patch 5 adds the actual create to the Volume model

======================

To create a Volume, with 'deltacloudd --cimi -i ec2' (i.e. ec2 driver with cimi 
frontend)

with xml body:

curl -X POST --user "user:pass" -H "Content-Type: 
application/CIMI-VolumeCreate+xml" -d '<VolumeCreate><name> marios_new_volume 
</name> <description> a new volume </description><volumeTemplate><volumeConfig 
href="http://localhost:3001/cimi/volume_configurations/2";> 
</volumeConfig></volumeTemplate></VolumeCreate>' 
http://localhost:3001//cimi/volumes?format=xml

with json body:

curl -X POST --user "user:pass" -H "Content-Type: 
application/CIMI-VolumeCreate+json" -d '{"name": "marios_new_volume", 
"description": "a new volume", "volumeTemplate": { "volumeConfig": 
{"href":"http://localhost:3001/cimi/volume_configurations/2"; }}}' 
http://localhost:3001//cimi/volumes?format=xml


response:
<Volume xmlns="http://www.dmtf.org/cimi";>
  <name>vol-c955f5a4</name>
  <eventlog href="http://eventlogs"; />
  <guestInterface></guestInterface>
  <uri>http://localhost:3001/cimi/volumes/vol-c955f5a4</uri>
  <supportsSnapshots>true</supportsSnapshots>
  <capacity quantity="2" units="gibibyte" />
  <description>vol-c955f5a4</description>
  <bootable>false</bootable>
  <created>Fri Nov 25 17:05:14 UTC 2011</created>
</Volume>


marios

Reply via email to