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>
12235 12236 12237 |
# File 'lib/ovirtsdk4/services.rb', line 12235 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
.
12262 12263 12264 |
# File 'lib/ovirtsdk4/services.rb', line 12262 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
.
12289 12290 12291 |
# File 'lib/ovirtsdk4/services.rb', line 12289 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
.
12316 12317 12318 |
# File 'lib/ovirtsdk4/services.rb', line 12316 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.
12360 12361 12362 |
# File 'lib/ovirtsdk4/services.rb', line 12360 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.
12348 12349 12350 |
# File 'lib/ovirtsdk4/services.rb', line 12348 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 |
# File 'lib/ovirtsdk4/services.rb', line 12371 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 |