Attach volume to Machine
XML:
curl -v --user "mockuser:mockpassword" -H "Content-Type: application/xml"
-H "Accept: application/xml" -X PUT -d
'<MachineVolume xmlns="http://schemas.dmtf.org/cimi/1/MachineVolume">
<initialLocation> /dev/sdf </initialLocation>
<volume href="http://localhost:3001/cimi/volumes/vol2"/>
</MachineVolume>' http://localhost:3001/cimi/machines/inst1/volume_attach
JSON:
curl -v --user "mockuser:mockpassword" -H "Content-Type: application/json"
-H "Accept: application/xml" -X PUT -d
'{"resourceURI":"http://schemas.dmtf.org/cimi/1/MachineVolume",
"initialLocation": "/dev/sdf",
"volume": {"href":"http://localhost:3001/cimi/volumes/vol2"}}'
http://localhost:3001/cimi/machines/inst1/volume_attach
Detach volume (remove MachineVolume from the MachineVolumeCollection):
curl -v --user "mockuser:mockpassword" -H "Accept: application/xml"
-X DELETE http://localhost:3001/cimi/machines/inst1/volumes/vol2
write-up and more info @
http://mariosandreou.com/deltacloud/cloud_API/2012/11/28/cimi-machine-volumes-collection.html
marios