On 28/11/12 14:24, Michal Fojtik wrote:
> On 11/28, [email protected] 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 :-)
> 

Thanks a lot for doing that - I tested it and it works fine (comments on
the pull request). I think its still very useful to have this ability
because it means we can expose the 'attach' volume route as

PUT /cimi/machines/:id/volumes  (now we have /volume_attach)

and still have the regular

GET /cimi/machines/:id/volumes

marios

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

Reply via email to