Sha256: a93b7ce17380a60c32342af028c759ef5bbbf3f54d608c1c45f41446142a91db
Contents?: true
Size: 1.67 KB
Versions: 2
Compression:
Stored size: 1.67 KB
Contents
module Fog module VcloudDirector class Compute class Real require 'fog/vcloud_director/parsers/compute/disks' # Retrieve all RASD items that specify hard disk and hard disk # controller properties of a VM. # # @deprecated Use {#get_disks_rasd_items_list} instead. # @todo Log deprecation warning. # # @param [String] id # @return [Excon::Response] # * body<~Hash>: # # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/GET-DisksRasdItemsList.html # @since vCloud API version 0.9 def get_vm_disks(id) request( :expects => 200, :idempotent => true, :method => 'GET', :parser => Fog::VcloudDirector::Parsers::Compute::Disks.new, :path => "vApp/#{id}/virtualHardwareSection/disks" ) end end class Mock def get_vm_disks(id) disks = data[:disks].values.select {|d| d[:parent_vm] == id}.each_with_index.map do |disk, i| { :address => i, :description => disk[:description], :name => disk[:name], :id => (i+1)*1000, :resource_type => 17, :capacity => disk[:capacity], } end body = {:type => 'application/vnd.vmware.vcloud.rasditemslist+xml', :disks => disks} Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-vcloud-director-0.3.1 | lib/fog/vcloud_director/requests/compute/get_vm_disks.rb |
fog-vcloud-director-0.3.0 | lib/fog/vcloud_director/requests/compute/get_vm_disks.rb |