Sha256: e9cd9230dc8cefb84853e7023901e01c35e8384dcda6f393edaaa07f50c7616e

Contents?: true

Size: 1.1 KB

Versions: 42

Compression:

Stored size: 1.1 KB

Contents

module Fog
  module Compute
    class Vsphere
      class Real
        def list_vm_cdroms(vm_id)
          get_vm_ref(vm_id).config.hardware.device.select { |hw| hw.class == RbVmomi::VIM::VirtualCdrom }.map do |cdrom|
            {
              :filename => (cdrom.backing.fileName rescue(nil)),
              :name => cdrom.deviceInfo.label,
              :key => cdrom.key,
              :controller_key => cdrom.controllerKey,
              :unit_number => cdrom.unitNumber,
              :start_connected => cdrom.connectable.startConnected,
              :allow_guest_control => cdrom.connectable.allowGuestControl,
              :connected => cdrom.connectable.connected,
              :instance_uuid => vm_id,
            }
          end
        end
      end
      class Mock
        def list_vm_cdroms(vm_id)
          raise Fog::Compute::Vsphere::NotFound, 'VM not Found' unless self.data[:servers].key?(vm_id)
          return [] unless self.data[:servers][vm_id].key?('cdroms')
          self.data[:servers][vm_id]['cdroms'].map {|h| h.merge({:instance_uuid => vm_id}) }
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
fog-vsphere-1.7.0.1 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-2.1.1 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-2.1.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-2.0.1 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-2.0.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.13.1 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.13.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.12.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.11.3 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.11.2 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.11.1 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.11.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.10.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.9.2 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.9.1 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.9.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.8.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.7.1 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.7.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb
fog-vsphere-1.6.0 lib/fog/vsphere/requests/compute/list_vm_cdroms.rb