Sha256: 0ec87441478c602177c820d2bb1e240349ecdec43c3b61d6e5e2fec216b89771

Contents?: true

Size: 1.12 KB

Versions: 77

Compression:

Stored size: 1.12 KB

Contents

module Fog
  module Compute
    class XenServer

      class Real
        
        def create_vbd( vm_ref, vdi_ref, config = {} )
          raise ArgumentError.new('Invalid config') if config.nil?
          vm_ref = vm_ref.reference if vm_ref.kind_of? Fog::Compute::XenServer::Server
          vdi_ref = vdi_ref.reference if vdi_ref.kind_of? Fog::Compute::XenServer::VDI
          config.reject! { |k,v| (k == :server) or (k == :vdi) }
          default_config = {
            :VM => vm_ref,
            :VDI => vdi_ref,
            :empty => false,
            :other_config => {'owner' => ''},
            :userdevice => "0",
            :bootable => true,
            :mode => 'RW',
            :qos_algorithm_type=> '',
            :qos_algorithm_params=> {},
            :qos_supported_algorithms=> [],
            :type => 'Disk'
          }.merge config

          @connection.request({:parser => Fog::Parsers::XenServer::Base.new, :method => 'VBD.create'}, default_config )
        end
      end

      class Mock
        
        def create_vbd( config )
          Fog::Mock.not_implemented
        end
        
      end

    end
  end
end

Version data entries

77 entries across 77 versions & 12 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-1.20.0 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-1.19.0 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/xenserver/requests/compute/create_vbd.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/xenserver/requests/compute/create_vbd.rb