use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class ImportHostedEngineStorageDomainCommand method removeHostedEngineLunDisk.
private void removeHostedEngineLunDisk() {
List<BaseDisk> disks = baseDiskDao.getDisksByAlias(StorageConstants.HOSTED_ENGINE_LUN_DISK_ALIAS);
if (disks != null && !disks.isEmpty()) {
BaseDisk heDirectLun = disks.get(0);
ActionReturnValue removeDisk = backend.runInternalAction(ActionType.RemoveDisk, new RemoveDiskParameters(heDirectLun.getId()));
if (!removeDisk.getSucceeded()) {
setSucceeded(false);
log.error("Failed to remove the hosted engine direct lun disk");
return;
}
}
setSucceeded(true);
}
use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class DiskListModel method onRemove.
private void onRemove() {
RemoveDiskModel model = (RemoveDiskModel) getWindow();
ArrayList<ActionParametersBase> parameterList = new ArrayList<>();
for (Object item : getSelectedItems()) {
Disk disk = (Disk) item;
ActionParametersBase parameters = new RemoveDiskParameters(disk.getId());
parameterList.add(parameters);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveDisk, parameterList, result -> {
DiskListModel localModel = (DiskListModel) result.getState();
localModel.stopProgress();
cancel();
}, this);
}
use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class RemoveMemoryVolumesCommand method executeCommand.
@Override
protected void executeCommand() {
if (getParameters().getSnapshot().containsMemory() && isMemoryRemovable()) {
RemoveDiskParameters removeMemoryDumpDiskParameters = new RemoveDiskParameters(getParameters().getSnapshot().getMemoryDiskId());
removeMemoryDumpDiskParameters.setShouldBeLogged(false);
runInternalAction(ActionType.RemoveDisk, removeMemoryDumpDiskParameters);
RemoveDiskParameters removeMemoryMetadataDiskParameters = new RemoveDiskParameters(getParameters().getSnapshot().getMetadataDiskId());
removeMemoryMetadataDiskParameters.setShouldBeLogged(false);
runInternalAction(ActionType.RemoveDisk, removeMemoryMetadataDiskParameters);
}
setSucceeded(true);
}
use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class VmCommand method removeMemoryDisks.
protected boolean removeMemoryDisks(Snapshot snapshot) {
RemoveDiskParameters removeMemoryDumpDiskParameters = new RemoveDiskParameters(snapshot.getMemoryDiskId());
removeMemoryDumpDiskParameters.setShouldBeLogged(false);
ActionReturnValue retVal = runInternalAction(ActionType.RemoveDisk, removeMemoryDumpDiskParameters);
if (!retVal.getSucceeded()) {
return false;
}
RemoveDiskParameters removeMemoryMetadataDiskParameters = new RemoveDiskParameters(snapshot.getMetadataDiskId());
removeMemoryMetadataDiskParameters.setShouldBeLogged(false);
retVal = runInternalAction(ActionType.RemoveDisk, removeMemoryMetadataDiskParameters);
if (!retVal.getSucceeded()) {
return false;
}
return true;
}
use of org.ovirt.engine.core.common.action.RemoveDiskParameters in project ovirt-engine by oVirt.
the class BackendTemplateDiskResource method remove.
@Override
public Response remove() {
// will throw 404 if entity not found.
get();
RemoveDiskParameters params = new RemoveDiskParameters(asGuid(id));
boolean force = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, FORCE, true, false);
if (force) {
params.setForceDelete(force);
}
String storageDomain = ParametersHelper.getParameter(httpHeaders, uriInfo, STORAGE_DOMAIN);
if (storageDomain != null) {
params.setStorageDomainId(asGuid(storageDomain));
}
return performAction(ActionType.RemoveDisk, params);
}
Aggregations