Sha256: f0e0f35d8799536fef16a32804203c2e819fe83d4cecc361493c22ee186c5feb

Contents?: true

Size: 956 Bytes

Versions: 8

Compression:

Stored size: 956 Bytes

Contents

module Fog
  module Compute
    class Ovirt
      class V4
        class Real
          def list_vm_volumes(vm_id)
            # disk_attachments_service = client.system_service.vms_service.vm_service(vm_id).disk_attachments_service
            # disk_attachments_service.list.map {|ovirt_obj| ovirt_attrs client.system_service.disks_service.disk_service(ovirt_obj.id).get}

            vm = client.system_service.vms_service.vm_service(vm_id).get

            attachments = client.follow_link(vm.disk_attachments)

            attachments.map do |attachment|
              ovirt_attrs client.follow_link(attachment.disk)
            end
          end
        end
        class Mock
          def list_vm_volumes(_vm_id)
            xml = read_xml "volumes.xml"
            Nokogiri::XML(xml).xpath("/disks/disk").map do |vol|
              ovirt_attrs OvirtSDK4::Reader.read(vol.to_s)
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 6 versions & 2 rubygems

Version Path
fog-ovirt-1.1.1 lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ovirt-1.1.0/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ovirt-1.1.0/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ovirt-1.1.0/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
fog-ovirt-1.1.0 lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
fog-ovirt-1.0.4 lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
fog-ovirt-1.0.3 lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
fog-ovirt-1.0.2 lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb