deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: CIMI MachineVolumes collection attach/detach volume
Date Wed, 28 Nov 2012 12:24:01 GMT
On 11/28, marios@redhat.com wrote:

Nicely done. ACK to this series. I also prepared a patch[1] for
Sinatra::Rabbit to support operations with same name but different HTTP
method. But I think having a sub-collection here is better idea :-)

One minor nit: There are no unit tests for this stuff :)

[1] https://github.com/mifo/sinatra-rabbit/pull/12

> 
> 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

-- 
Michal Fojtik <mfojtik@redhat.com>
Deltacloud API, CloudForms

Mime
View raw message