class OvirtSDK4::ImageTransfersService

Constants

ADD
ADD_FOR_DISK
ADD_FOR_IMAGE
ADD_FOR_SNAPSHOT
LIST

Public Instance Methods

add(image_transfer, opts = {}) click to toggle source

Add a new image transfer. An image, disk or disk snapshot needs to be specified in order to make a new transfer.

IMPORTANT: The `image` attribute is deprecated since version 4.2 of the engine. Use the `disk` or `snapshot` attributes instead.

*Creating a new image transfer for downloading or uploading a `disk`:*

To create an image transfer to download or upload a disk with id `123`, send the following request:

source

POST /ovirt-engine/api/imagetransfers


With a request body like this:

source,xml

<image_transfer>

<disk id="123"/>
<direction>upload|download</direction>

</image_transfer>


*Creating a new image transfer for downloading or uploading a `disk_snapshot`:*

To create an image transfer to download or upload a `disk_snapshot` with id `456`, send the following request:

source

POST /ovirt-engine/api/imagetransfers


With a request body like this:

source,xml

<image_transfer>

<snapshot id="456"/>
<direction>download|upload</direction>

</image_transfer>


@param image_transfer [ImageTransfer] The image transfer to add.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly

given then the timeout set globally for the connection will be used.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [ImageTransfer]

# File lib/ovirtsdk4/services.rb, line 13508
def add(image_transfer, opts = {})
  internal_add(image_transfer, ImageTransfer, ADD, opts)
end
add_for_disk(image_transfer, opts = {}) click to toggle source

Adds a new `image_transfer`.

@param image_transfer [ImageTransfer] The image transfer to add.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly

given then the timeout set globally for the connection will be used.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [ImageTransfer]

# File lib/ovirtsdk4/services.rb, line 13535
def add_for_disk(image_transfer, opts = {})
  internal_add(image_transfer, ImageTransfer, ADD_FOR_DISK, opts)
end
add_for_image(image_transfer, opts = {}) click to toggle source

Adds a new `image_transfer`.

@param image_transfer [ImageTransfer] The image transfer to add.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly

given then the timeout set globally for the connection will be used.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [ImageTransfer]

# File lib/ovirtsdk4/services.rb, line 13562
def add_for_image(image_transfer, opts = {})
  internal_add(image_transfer, ImageTransfer, ADD_FOR_IMAGE, opts)
end
add_for_snapshot(image_transfer, opts = {}) click to toggle source

Adds a new `image_transfer`.

@param image_transfer [ImageTransfer] The image transfer to add.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly

given then the timeout set globally for the connection will be used.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [ImageTransfer]

# File lib/ovirtsdk4/services.rb, line 13589
def add_for_snapshot(image_transfer, opts = {})
  internal_add(image_transfer, ImageTransfer, ADD_FOR_SNAPSHOT, opts)
end
image_transfer_service(id) click to toggle source

Returns a reference to the service that manages an specific image transfer.

@param id [String] The identifier of the `image_transfer`.

@return [ImageTransferService] A reference to the `image_transfer` service.

# File lib/ovirtsdk4/services.rb, line 13633
def image_transfer_service(id)
  ImageTransferService.new(self, id)
end
list(opts = {}) click to toggle source

Retrieves the list of image transfers that are currently being performed.

The order of the returned list of image transfers is not guaranteed.

@param opts [Hash] Additional options.

@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part

of the current request. See <<documents/003_common_concepts/follow, here>> for details.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly

given then the timeout set globally for the connection will be used.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [Array<ImageTransfer>]

# File lib/ovirtsdk4/services.rb, line 13621
def list(opts = {})
  internal_get(LIST, opts)
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# File lib/ovirtsdk4/services.rb, line 13644
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return image_transfer_service(path)
  end
  return image_transfer_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end