use of org.ovirt.engine.core.common.action.AddVmInterfaceParameters in project ovirt-engine by oVirt.
the class BaseEditVmInterfaceModel method createVdcActionParameters.
@Override
protected ActionParametersBase createVdcActionParameters(VmNetworkInterface nicToSave) {
AddVmInterfaceParameters parameters = new AddVmInterfaceParameters(getVm().getId(), nicToSave);
parameters.setFilterParameters(getNetworkFilterParameterListModel().getItems().stream().map(x -> x.flush()).collect(Collectors.toList()));
return parameters;
}
use of org.ovirt.engine.core.common.action.AddVmInterfaceParameters in project ovirt-engine by oVirt.
the class SyncNetworkProviderCommand method disconnectVms.
private void disconnectVms(Guid networkId) {
Map<Guid, VnicProfile> profiles = vnicProfileDao.getAllForNetwork(networkId).stream().collect(Collectors.toConcurrentMap(VnicProfile::getId, Function.identity()));
for (VM vm : vmDao.getAllForNetwork(networkId)) {
vmHandler.updateNetworkInterfacesFromDb(vm);
for (VmNetworkInterface iface : vm.getInterfaces()) {
if (profiles.get(iface.getVnicProfileId()) != null) {
log.warn("External network '{}' disappeared from provider '{}', disconnecting interface '{}' of VM '{}'.", networkId, getProvider().getName(), iface.getName(), vm.getName());
iface.setVnicProfileId(null);
iface.setPlugged(false);
propagateReturnValue(runInternalAction(ActionType.UpdateVmInterface, new AddVmInterfaceParameters(vm.getId(), iface), getInternalCommandContext()));
}
}
}
}
use of org.ovirt.engine.core.common.action.AddVmInterfaceParameters in project ovirt-engine by oVirt.
the class NewVmInterfaceModel method createVdcActionParameters.
@Override
protected ActionParametersBase createVdcActionParameters(VmNetworkInterface nicToSave) {
AddVmInterfaceParameters parameters = new AddVmInterfaceParameters(getVm().getId(), nicToSave);
parameters.setFilterParameters(getNetworkFilterParameterListModel().getItems().stream().map(x -> x.flush()).collect(Collectors.toList()));
return parameters;
}
Aggregations