2013-06-27 12:44:27 -04:00
|
|
|
module Fog
|
|
|
|
module Compute
|
2013-08-27 05:19:54 -04:00
|
|
|
class VcloudDirector
|
2013-06-27 12:44:27 -04:00
|
|
|
class Real
|
2013-10-01 03:43:28 -04:00
|
|
|
extend Fog::Deprecation
|
|
|
|
deprecate :put_vm_disks, :put_disks
|
|
|
|
|
2013-08-27 05:19:54 -04:00
|
|
|
require 'fog/vcloud_director/generators/compute/disks'
|
2013-09-16 13:13:09 -04:00
|
|
|
|
2013-09-27 11:32:49 -04:00
|
|
|
# Update all RASD items that specify hard disk and hard disk controller
|
|
|
|
# properties of a VM.
|
|
|
|
#
|
|
|
|
# This operation is asynchronous and returns a task that you can
|
|
|
|
# monitor to track the progress of the request.
|
|
|
|
#
|
2013-10-08 13:46:06 -04:00
|
|
|
# @param [String] id Object identifier of the VM.
|
2013-09-27 11:32:49 -04:00
|
|
|
# @param [Array] disks
|
|
|
|
# * disks is the body of #get_vm_disks
|
|
|
|
# @return [Excon::Response]
|
|
|
|
# * body<~Hash>:
|
2013-10-13 15:23:24 -04:00
|
|
|
#
|
2013-09-27 11:32:49 -04:00
|
|
|
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/PUT-Disks.html
|
2013-09-29 13:57:18 -04:00
|
|
|
# @since vCloud API version 0.9
|
2013-10-08 13:46:06 -04:00
|
|
|
def put_disks(id, disks=[])
|
2013-08-27 05:19:54 -04:00
|
|
|
data = Fog::Generators::Compute::VcloudDirector::Disks.new(disks)
|
2013-09-16 13:13:09 -04:00
|
|
|
|
2013-06-27 12:44:27 -04:00
|
|
|
request(
|
2013-09-16 13:13:09 -04:00
|
|
|
:body => data.generate_xml,
|
|
|
|
:expects => 202,
|
2013-09-29 13:57:18 -04:00
|
|
|
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.rasdItemsList+xml'},
|
2013-09-16 13:13:09 -04:00
|
|
|
:method => 'PUT',
|
|
|
|
:parser => Fog::ToHashDocument.new,
|
2013-10-08 13:46:06 -04:00
|
|
|
:path => "vApp/#{id}/virtualHardwareSection/disks"
|
2013-06-27 12:44:27 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|