Sha256: 6d86ccb28e6bd9624bdfb37654afc79cf7ce9b51642dcad0819ba7ecf3852ef5

Contents?: true

Size: 933 Bytes

Versions: 9

Compression:

Stored size: 933 Bytes

Contents

module Fog
  module Compute
    class XenServer
      class Real
        def clone_server( server_name, template_ref )
          # Clone the VM template
          if template_ref.kind_of? Fog::Compute::XenServer::Server
            Fog::Logger.deprecation(
                'Passing an object to #clone_server is deprecated. Pass the reference instead.'
            )
            template_ref = template_ref.reference
          end
          raise ArgumentError.new("Invalid template_ref") if template_ref.nil?
          raise ArgumentError.new("Invalid template_ref") if server_name.nil?

          ref = @connection.request(
              {:parser => Fog::Parsers::XenServer::Base.new, :method => 'VM.clone'},
              template_ref, server_name
          )
        end
      end

      class Mock
        def clone_server( server_name, template_ref )
          Fog::Mock.not_implemented
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.34.0 lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.33.0 lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.32.0 lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.31.0 lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.30.0 lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.29.0 lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.28.0 lib/fog/xenserver/requests/compute/clone_server.rb
fog-1.27.0 lib/fog/xenserver/requests/compute/clone_server.rb