Search in sources :

Example 46 with ActionParametersBase

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

the class VolumeListModel method startRebalance.

private void startRebalance() {
    if (getSelectedItems() == null) {
        return;
    }
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        GlusterVolumeEntity volume = (GlusterVolumeEntity) item;
        list.add(new GlusterVolumeRebalanceParameters(volume.getId(), false, false));
    }
    Frontend.getInstance().runMultipleAction(ActionType.StartRebalanceGlusterVolume, list, null, true, true);
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) ArrayList(java.util.ArrayList) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) GlusterVolumeRebalanceParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters)

Example 47 with ActionParametersBase

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

the class ImportVmTemplateCommand method endActionOnAllImageGroups.

@Override
protected void endActionOnAllImageGroups() {
    for (ActionParametersBase p : getParameters().getImagesParameters()) {
        p.setTaskGroupSuccess(getParameters().getTaskGroupSuccess());
        backend.endAction(ActionType.CopyImageGroup, p, getContext().clone().withoutCompensationContext().withoutExecutionContext().withoutLock());
    }
}
Also used : ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 48 with ActionParametersBase

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

the class RefreshNetworksParametersFactory method create.

/**
 * @param networks networks to be refreshed.
 * @return list of PersistentHostSetupNetworksParameters instances to update all given networks on all hosts where
 * they are used.
 */
public ArrayList<ActionParametersBase> create(List<Network> networks) {
    Map<Guid, List<Network>> vdsIdToNetworksOfAlteredQos = mapNetworksByAttachedHosts(networks);
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    for (Map.Entry<Guid, List<Network>> entry : vdsIdToNetworksOfAlteredQos.entrySet()) {
        Guid hostId = entry.getKey();
        List<Network> networksOfAlteredQos = entry.getValue();
        PersistentHostSetupNetworksParameters setupNetworkParams = persistentHostSetupNetworksParametersFactory.create(hostId, networksOfAlteredQos);
        parameters.add(setupNetworkParams);
    }
    return parameters;
}
Also used : PersistentHostSetupNetworksParameters(org.ovirt.engine.core.common.action.PersistentHostSetupNetworksParameters) Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Guid(org.ovirt.engine.core.compat.Guid) HashMap(java.util.HashMap) Map(java.util.Map) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 49 with ActionParametersBase

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

the class CreateOvfVolumeForStorageDomainCommand method endChildCommand.

private void endChildCommand(boolean succeeded) {
    if (!getParameters().getImagesParameters().isEmpty()) {
        ActionParametersBase childParams = getParameters().getImagesParameters().get(0);
        childParams.setTaskGroupSuccess(succeeded);
        backend.endAction(childParams.getCommandType(), childParams, getContext().clone().withoutCompensationContext().withoutExecutionContext().withoutLock());
    }
}
Also used : ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 50 with ActionParametersBase

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

the class JsonObjectSerializerTest method serializeVdsActionParameters.

@Test
public void serializeVdsActionParameters() {
    ActionParametersBase params = new ActionParametersBase();
    params.setLockProperties(LockProperties.create(Scope.None).withWait(true));
    JsonObjectSerializer serializer = new JsonObjectSerializer();
    assertTrue(serializer.serialize(params).length() > 0);
}
Also used : ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) Test(org.junit.Test)

Aggregations

ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)204 ArrayList (java.util.ArrayList)149 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)53 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)52 ActionType (org.ovirt.engine.core.common.action.ActionType)45 Test (org.junit.Test)44 Guid (org.ovirt.engine.core.compat.Guid)35 VDS (org.ovirt.engine.core.common.businessentities.VDS)26 List (java.util.List)23 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)23 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)20 VM (org.ovirt.engine.core.common.businessentities.VM)19 QueryType (org.ovirt.engine.core.common.queries.QueryType)18 Frontend (org.ovirt.engine.ui.frontend.Frontend)18 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)18 IFrontendActionAsyncCallback (org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback)18 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)16 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)16 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)16 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)15