Class: OvirtSDK4::ImageTransferService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#cancel(opts = {}) ⇒ Object
Cancel the image transfer session.
-
#extend(opts = {}) ⇒ Object
Extend the image transfer session.
-
#finalize(opts = {}) ⇒ Object
After finishing to transfer the data, finalize the transfer.
-
#get(opts = {}) ⇒ ImageTransfer
Get the image transfer entity.
-
#pause(opts = {}) ⇒ Object
Pause the image transfer session.
-
#resume(opts = {}) ⇒ Object
Resume the image transfer session.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#cancel(opts = {}) ⇒ Object
Cancel the image transfer session. This terminates the transfer operation and removes the partial image.
13107 13108 13109 |
# File 'lib/ovirtsdk4/services.rb', line 13107 def cancel(opts = {}) internal_action(:cancel, nil, CANCEL, opts) end |
#extend(opts = {}) ⇒ Object
Extend the image transfer session.
13130 13131 13132 |
# File 'lib/ovirtsdk4/services.rb', line 13130 def extend(opts = {}) internal_action(:extend, nil, EXTEND, opts) end |
#finalize(opts = {}) ⇒ Object
After finishing to transfer the data, finalize the transfer.
This will make sure that the data being transferred is valid and fits the image entity that was targeted in the transfer. Specifically, will verify that if the image entity is a QCOW disk, the data uploaded is indeed a QCOW file, and that the image doesn’t have a backing file.
13158 13159 13160 |
# File 'lib/ovirtsdk4/services.rb', line 13158 def finalize(opts = {}) internal_action(:finalize, nil, FINALIZE, opts) end |
#get(opts = {}) ⇒ ImageTransfer
Get the image transfer entity.
13187 13188 13189 |
# File 'lib/ovirtsdk4/services.rb', line 13187 def get(opts = {}) internal_get(GET, opts) end |
#pause(opts = {}) ⇒ Object
Pause the image transfer session.
13210 13211 13212 |
# File 'lib/ovirtsdk4/services.rb', line 13210 def pause(opts = {}) internal_action(:pause, nil, PAUSE, opts) end |
#resume(opts = {}) ⇒ Object
Resume the image transfer session. The client will need to poll the transfer’s phase until
it is different than resuming. For example:
transfer_service = transfers_service.image_transfer_service(transfer.id)
transfer_service.resume()
transfer = transfer_service.get()
while transfer.phase == types.ImageTransferPhase.RESUMING:
time.sleep(1)
transfer = transfer_service.get()
13244 13245 13246 |
# File 'lib/ovirtsdk4/services.rb', line 13244 def resume(opts = {}) internal_action(:resume, nil, RESUME, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
13255 13256 13257 13258 13259 13260 |
# File 'lib/ovirtsdk4/services.rb', line 13255 def service(path) if path.nil? || path == '' return self end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |