use of org.ovirt.engine.api.model.Vm in project ovirt-engine by oVirt.
the class BackendVmResource method update.
@Override
public Vm update(Vm incoming) {
validateParameters(incoming);
if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) {
Guid clusterId = lookupClusterId(incoming);
if (!clusterId.toString().equals(get().getCluster().getId())) {
performAction(ActionType.ChangeVMCluster, // TODO: change 'null' to 'incoming.getVmCompa...' when REST support is added
new ChangeVMClusterParameters(clusterId, guid, null));
}
}
if (!isFiltered()) {
if (incoming.isSetPlacementPolicy()) {
parent.validateAndUpdateHostsInPlacementPolicy(incoming.getPlacementPolicy());
}
} else {
incoming.setPlacementPolicy(null);
}
QueryType queryType = isNextRunRequested() ? QueryType.GetVmNextRunConfiguration : QueryType.GetVmByVmId;
Vm vm = performUpdate(incoming, new QueryIdResolver<>(queryType, IdQueryParameters.class), ActionType.UpdateVm, new UpdateParametersProvider());
if (vm != null) {
DisplayHelper.adjustDisplayData(this, vm, false);
removeRestrictedInfo(vm);
}
return vm;
}
use of org.ovirt.engine.api.model.Vm in project ovirt-engine by oVirt.
the class BackendVmWatchdogsResource method addParents.
@Override
public Watchdog addParents(Watchdog watchdog) {
Vm vm = new Vm();
vm.setId(vmId.toString());
watchdog.setVm(vm);
return watchdog;
}
use of org.ovirt.engine.api.model.Vm in project ovirt-engine by oVirt.
the class BackendVmNicFilterParameterResource method addParents.
@Override
public NetworkFilterParameter addParents(NetworkFilterParameter parameter) {
Vm vm = new Vm();
vm.setId(vmId.toString());
Nic nic = new Nic();
nic.setId(nicId.toString());
nic.setVm(vm);
parameter.setNic(nic);
return parameter;
}
use of org.ovirt.engine.api.model.Vm in project ovirt-engine by oVirt.
the class BackendVmNicResource method addParents.
@Override
protected Nic addParents(Nic nic) {
Vm vm = new Vm();
vm.setId(vmId.toString());
nic.setVm(vm);
return nic;
}
use of org.ovirt.engine.api.model.Vm in project ovirt-engine by oVirt.
the class BackendVmNicsResource method addParents.
@Override
protected Nic addParents(Nic nic) {
Vm vm = new Vm();
vm.setId(vmId.toString());
nic.setVm(vm);
return nic;
}
Aggregations