use of org.ovirt.engine.core.common.vdscommands.UploadImageVDSCommandParameters in project ovirt-engine by oVirt.
the class ExportRepoImageCommand method executeCommand.
@Override
protected void executeCommand() {
DiskImage diskImage = getDiskImage();
OpenStackImageProviderProxy proxy = getProviderProxy();
acquireImageDbLock();
String newImageId = proxy.createImageFromDiskImage(diskImage);
getParameters().setParentCommand(ActionType.ExportRepoImage);
Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand());
getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupID()));
VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.UploadImage, new UploadImageVDSCommandParameters(getStorageDomain().getStoragePoolId(), getStorageDomain().getId(), diskImage.getId(), diskImage.getImageId(), new HttpLocationInfo(getProviderProxy().getImageUrl(newImageId), getProviderProxy().getUploadHeaders())));
if (vdsReturnValue.getSucceeded()) {
getReturnValue().getVdsmTaskIdList().add(createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Disk, getParameters().getImageGroupID(), getParameters().getDestinationDomainId()));
}
getReturnValue().setActionReturnValue(newImageId);
setSucceeded(true);
}
Aggregations