Search in sources :

Example 6 with AddVmTemplateParameters

use of org.ovirt.engine.core.common.action.AddVmTemplateParameters in project ovirt-engine by oVirt.

the class VmListModel method postNameUniqueCheck.

private void postNameUniqueCheck() {
    UnitVmModel model = (UnitVmModel) getWindow();
    VM vm = getSelectedItem();
    VM newVm = buildVmOnNewTemplate(model, vm);
    AddVmTemplateParameters addVmTemplateParameters = new AddVmTemplateParameters(newVm, model.getName().getEntity(), model.getDescription().getEntity());
    BuilderExecutor.build(model, addVmTemplateParameters, new UnitToAddVmTemplateParametersBuilder());
    model.startProgress();
    Frontend.getInstance().runAction(ActionType.AddVmTemplate, addVmTemplateParameters, result -> {
        getWindow().stopProgress();
        ActionReturnValue returnValueBase = result.getReturnValue();
        if (returnValueBase != null && returnValueBase.getSucceeded()) {
            cancel();
        }
    }, this);
}
Also used : ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) UnitToAddVmTemplateParametersBuilder(org.ovirt.engine.ui.uicommonweb.builders.template.UnitToAddVmTemplateParametersBuilder) VM(org.ovirt.engine.core.common.businessentities.VM) AddVmTemplateParameters(org.ovirt.engine.core.common.action.AddVmTemplateParameters)

Aggregations

AddVmTemplateParameters (org.ovirt.engine.core.common.action.AddVmTemplateParameters)6 VmStatic (org.ovirt.engine.core.common.businessentities.VmStatic)4 VM (org.ovirt.engine.core.common.businessentities.VM)3 Guid (org.ovirt.engine.core.compat.Guid)3 Response (javax.ws.rs.core.Response)2 Template (org.ovirt.engine.api.model.Template)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)2 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)2 GetVmTemplateParameters (org.ovirt.engine.core.common.queries.GetVmTemplateParameters)2 InstanceType (org.ovirt.engine.api.model.InstanceType)1 DisplayType (org.ovirt.engine.core.common.businessentities.DisplayType)1 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)1 UnitToAddVmTemplateParametersBuilder (org.ovirt.engine.ui.uicommonweb.builders.template.UnitToAddVmTemplateParametersBuilder)1 UnitToGraphicsDeviceParamsBuilder (org.ovirt.engine.ui.uicommonweb.builders.vm.UnitToGraphicsDeviceParamsBuilder)1 UnitVmModel (org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel)1 UnitVmModelNetworkAsyncCallback (org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback)1