Search in sources :

Example 1 with RemoveVmFromImportExportParameters

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

the class VmBackupModel method onRemove.

private void onRemove() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    model.startProgress();
    AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery<>(pools -> {
        if (pools != null && pools.size() > 0) {
            StoragePool pool = pools.get(0);
            ArrayList<ActionParametersBase> list = new ArrayList<>();
            for (VM vm : getSelectedItems()) {
                list.add(new RemoveVmFromImportExportParameters(vm.getId(), getEntity().getId(), pool.getId()));
            }
            Frontend.getInstance().runMultipleAction(ActionType.RemoveVmFromImportExport, list, result -> {
                ConfirmationModel localModel = (ConfirmationModel) result.getState();
                localModel.stopProgress();
                cancel();
                onEntityChanged();
            }, getWindow());
        }
    }), getEntity().getId());
}
Also used : StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) GetAllFromExportDomainQueryParameters(org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters) VmAppListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel) ArchitectureType(org.ovirt.engine.core.common.businessentities.ArchitectureType) RemoveVmFromImportExportParameters(org.ovirt.engine.core.common.action.RemoveVmFromImportExportParameters) Inject(com.google.inject.Inject) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ArrayList(java.util.ArrayList) ActionType(org.ovirt.engine.core.common.action.ActionType) Frontend(org.ovirt.engine.ui.frontend.Frontend) LexoNumericNameableComparator(org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) StringHelper(org.ovirt.engine.core.compat.StringHelper) VM(org.ovirt.engine.core.common.businessentities.VM) Provider(com.google.inject.Provider) ImportVmData(org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) ImportVmFromExportDomainModel(org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel) Collections(java.util.Collections) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) RemoveVmFromImportExportParameters(org.ovirt.engine.core.common.action.RemoveVmFromImportExportParameters) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 2 with RemoveVmFromImportExportParameters

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

the class BackendStorageDomainVmResource method remove.

@Override
public Response remove() {
    get();
    RemoveVmFromImportExportParameters params = new RemoveVmFromImportExportParameters(guid, parent.storageDomainId, getDataCenterId(parent.storageDomainId));
    return performAction(ActionType.RemoveVmFromImportExport, params);
}
Also used : RemoveVmFromImportExportParameters(org.ovirt.engine.core.common.action.RemoveVmFromImportExportParameters)

Aggregations

RemoveVmFromImportExportParameters (org.ovirt.engine.core.common.action.RemoveVmFromImportExportParameters)2 Inject (com.google.inject.Inject)1 Provider (com.google.inject.Provider)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 ActionType (org.ovirt.engine.core.common.action.ActionType)1 ArchitectureType (org.ovirt.engine.core.common.businessentities.ArchitectureType)1 StorageDomainSharedStatus (org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus)1 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 VM (org.ovirt.engine.core.common.businessentities.VM)1 LexoNumericNameableComparator (org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator)1 GetAllFromExportDomainQueryParameters (org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters)1 QueryType (org.ovirt.engine.core.common.queries.QueryType)1 StringHelper (org.ovirt.engine.core.compat.StringHelper)1 Frontend (org.ovirt.engine.ui.frontend.Frontend)1 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)1