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()
public class ImageTransferServiceImpl extends ServiceImpl implements ImageTransferService
ImageTransferService.ExtendRequest, ImageTransferService.ExtendResponse, ImageTransferService.FinalizeRequest, ImageTransferService.FinalizeResponse, ImageTransferService.GetRequest, ImageTransferService.GetResponse, ImageTransferService.PauseRequest, ImageTransferService.PauseResponse, ImageTransferService.ResumeRequest, ImageTransferService.ResumeResponse
Constructor and Description |
---|
ImageTransferServiceImpl(HttpConnection connection,
String path) |
Modifier and Type | Method and Description |
---|---|
ImageTransferService.ExtendRequest |
extend()
Extend the image transfer session.
|
ImageTransferService.FinalizeRequest |
finalize_()
After finishing to transfer the data, finalize the transfer.
|
ImageTransferService.GetRequest |
get()
Get the image transfer entity.
|
ImageTransferService.PauseRequest |
pause()
Pause the image transfer session.
|
ImageTransferService.ResumeRequest |
resume()
Resume the image transfer session.
|
Service |
service(String path)
Service locator method, returns individual service on which the URI is dispatched.
|
String |
toString() |
checkAction, checkFault, getConnection, getPath, throwError
public ImageTransferServiceImpl(HttpConnection connection, String path)
public ImageTransferService.ExtendRequest extend()
ImageTransferService
Extend the image transfer session.
extend
in interface ImageTransferService
public ImageTransferService.FinalizeRequest finalize_()
ImageTransferService
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.
finalize_
in interface ImageTransferService
public ImageTransferService.GetRequest get()
ImageTransferService
Get the image transfer entity.
get
in interface ImageTransferService
public ImageTransferService.PauseRequest pause()
ImageTransferService
Pause the image transfer session.
pause
in interface ImageTransferService
public ImageTransferService.ResumeRequest resume()
ImageTransferService
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()
resume
in interface ImageTransferService
public Service service(String path)
ImageTransferService
Service locator method, returns individual service on which the URI is dispatched.
service
in interface ImageTransferService
Copyright © 2016. All rights reserved.