1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vcloudng/requests/compute/put_vm_disks.rb

25 lines
769 B
Ruby
Raw Normal View History

2013-06-27 12:44:27 -04:00
module Fog
module Compute
class Vcloudng
class Real
require 'fog/vcloudng/generators/compute/disks'
2013-06-27 15:26:42 -04:00
# disks is the body of get_vm_disks
def put_vm_disks(vm_id, disks=[])
data = Fog::Generators::Compute::Vcloudng::Disks.new(disks)
2013-06-27 12:44:27 -04:00
request(
2013-06-27 15:26:42 -04:00
:body => data.generate_xml,
2013-06-27 12:44:27 -04:00
:expects => 202,
:headers => { 'Content-Type' => 'application/vnd.vmware.vcloud.rasdItemsList+xml',
'Accept' => 'application/*+xml;version=1.5' },
:method => 'PUT',
:parser => Fog::ToHashDocument.new,
:path => "vApp/#{vm_id}/virtualHardwareSection/disks"
)
end
end
end
end
end