use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.
the class PoolDiskListModel method onEntityChanged.
@Override
protected void onEntityChanged() {
super.onEntityChanged();
VmPool pool = getEntity();
if (pool != null) {
Frontend.getInstance().runQuery(QueryType.GetVmDataByPoolId, new IdQueryParameters(pool.getVmPoolId()), new AsyncQuery<QueryReturnValue>(result -> {
if (result != null) {
VM vm = result.getReturnValue();
if (vm == null) {
return;
}
setVM(vm);
syncSearch();
}
}));
}
}
use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.
the class PoolInterfaceListModel method onEntityChanged.
@Override
protected void onEntityChanged() {
super.onEntityChanged();
VmPool pool = getEntity();
if (pool != null) {
Frontend.getInstance().runQuery(QueryType.GetVmDataByPoolId, new IdQueryParameters(pool.getVmPoolId()), new AsyncQuery<QueryReturnValue>(result -> {
if (result != null) {
VM vm = result.getReturnValue();
if (vm == null) {
return;
}
syncSearch(QueryType.GetVmInterfacesByVmId, new IdQueryParameters(vm.getId()));
}
}));
}
}
use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.
the class PoolListModel method onRemove.
public void onRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VmPool pool = (VmPool) item;
list.add(new VmPoolParametersBase(pool.getVmPoolId()));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveVmPool, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.
the class AddVmPoolCommand method getJobMessageProperties.
@Override
public Map<String, String> getJobMessageProperties() {
if (jobProperties == null) {
jobProperties = new HashMap<>();
VmPool vmPool = getParameters().getVmPool();
String vmPoolName = vmPool == null ? StringUtils.EMPTY : vmPool.getName();
jobProperties.put(VdcObjectType.VmPool.name().toLowerCase(), vmPoolName);
Guid vmTemplateId = getVmTemplateId();
String templateName = getVmTemplateName();
if (StringUtils.isEmpty(templateName)) {
templateName = vmTemplateId == null ? StringUtils.EMPTY : vmTemplateId.toString();
}
jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), templateName);
}
return jobProperties;
}
use of org.ovirt.engine.core.common.businessentities.VmPool in project ovirt-engine by oVirt.
the class CommonVmPoolCommandTestAbstract method mockVmPools.
/**
* Mock VM pools.
*/
private VmPool mockVmPools() {
VmPool pool = new VmPool();
pool.setName("simplePoolName");
pool.setClusterId(clusterId);
pool.setVmPoolId(vmPoolId);
return pool;
}
Aggregations