Search in sources :

Example 1 with ExportOvaParameters

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

the class BackendVmResource method exportToPathOnHost.

@Override
public Response exportToPathOnHost(Action action) {
    ExportOvaParameters params = new ExportOvaParameters();
    params.setEntityType(VmEntityType.VM);
    params.setEntityId(guid);
    params.setProxyHostId(getHostId(action));
    params.setDirectory(action.getDirectory());
    params.setName(action.getFilename());
    return doAction(ActionType.ExportOva, params, action);
}
Also used : ExportOvaParameters(org.ovirt.engine.core.common.action.ExportOvaParameters)

Example 2 with ExportOvaParameters

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

the class VmListModel method onExportOva.

public void onExportOva() {
    ExportOvaModel model = (ExportOvaModel) getWindow();
    if (!model.validate()) {
        return;
    }
    model.startProgress();
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VM vm = (VM) item;
        ExportOvaParameters parameters = new ExportOvaParameters();
        parameters.setEntityId(vm.getId());
        parameters.setEntityType(VmEntityType.VM);
        parameters.setProxyHostId(model.getProxy().getSelectedItem().getId());
        parameters.setDirectory(model.getPath().getEntity());
        parameters.setName(model.getName().getEntity());
        list.add(parameters);
    }
    Frontend.getInstance().runMultipleAction(ActionType.ExportOva, list, result -> {
        ExportOvaModel localModel = (ExportOvaModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : ExportOvaParameters(org.ovirt.engine.core.common.action.ExportOvaParameters) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Aggregations

ExportOvaParameters (org.ovirt.engine.core.common.action.ExportOvaParameters)2 ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 VM (org.ovirt.engine.core.common.businessentities.VM)1