use of org.ovirt.engine.core.common.action.AddVmTemplateFromSnapshotParameters in project ovirt-engine by oVirt.
the class VmSnapshotListModel method postNameUniqueCheck.
private void postNameUniqueCheck(VM vm) {
UnitVmModel model = (UnitVmModel) getWindow();
VM newVm = buildVmOnNewTemplate(model, vm);
AddVmTemplateFromSnapshotParameters parameters = new AddVmTemplateFromSnapshotParameters(newVm.getStaticData(), model.getName().getEntity(), model.getDescription().getEntity(), getSelectedItem().getId());
BuilderExecutor.build(model, parameters, new UnitToAddVmTemplateParametersBuilder());
model.startProgress();
Frontend.getInstance().runAction(ActionType.AddVmTemplateFromSnapshot, parameters, result -> {
VmSnapshotListModel vmSnapshotListModel = (VmSnapshotListModel) result.getState();
vmSnapshotListModel.getWindow().stopProgress();
ActionReturnValue returnValueBase = result.getReturnValue();
if (returnValueBase != null && returnValueBase.getSucceeded()) {
vmSnapshotListModel.cancel();
}
}, this);
}
Aggregations