Class: OvirtSDK4::ImageTransfersService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(image_transfer, opts = {}) ⇒ ImageTransfer
Add a new image transfer.
-
#add_for_disk(image_transfer, opts = {}) ⇒ ImageTransfer
Adds a new
image_transfer
. -
#add_for_image(image_transfer, opts = {}) ⇒ ImageTransfer
Adds a new
image_transfer
. -
#add_for_snapshot(image_transfer, opts = {}) ⇒ ImageTransfer
Adds a new
image_transfer
. -
#image_transfer_service(id) ⇒ ImageTransferService
Returns a reference to the service that manages an specific image transfer.
-
#list(opts = {}) ⇒ Array<ImageTransfer>
Retrieves the list of image transfers that are currently being performed.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(image_transfer, opts = {}) ⇒ ImageTransfer
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:
POST /ovirt-engine/api/imagetransfers
With a request body like this:
<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:
POST /ovirt-engine/api/imagetransfers
With a request body like this:
<image_transfer>
<snapshot id="456"/>
<direction>download|upload</direction>
</image_transfer>
13508 13509 13510 |
# 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 = {}) ⇒ ImageTransfer
Adds a new image_transfer
.
13535 13536 13537 |
# 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 = {}) ⇒ ImageTransfer
Adds a new image_transfer
.
13562 13563 13564 |
# 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 = {}) ⇒ ImageTransfer
Adds a new image_transfer
.
13589 13590 13591 |
# 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) ⇒ ImageTransferService
Returns a reference to the service that manages an specific image transfer.
13633 13634 13635 |
# File 'lib/ovirtsdk4/services.rb', line 13633 def image_transfer_service(id) ImageTransferService.new(self, id) end |
#list(opts = {}) ⇒ Array<ImageTransfer>
Retrieves the list of image transfers that are currently being performed.
The order of the returned list of image transfers is not guaranteed.
13621 13622 13623 |
# File 'lib/ovirtsdk4/services.rb', line 13621 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 |
# 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 |