use of org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters in project ovirt-engine by oVirt.
the class UpdateHostNicVfsConfigCommandTest method createCommand.
public void createCommand() {
param = new UpdateHostNicVfsConfigParameters(NIC_ID, NUM_OF_VFS, false);
command = spy(new UpdateHostNicVfsConfigCommand(param, null));
doReturn(validator).when(command).getVfsConfigValidator();
}
use of org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters in project ovirt-engine by oVirt.
the class VfsConfigAction method initUpdateVfsConfigParams.
private void initUpdateVfsConfigParams(HostNicVfsConfig originalVfsConfig, HostNicVfsConfig updatedVfsConfig) {
if (shouldUpdateVfsConfig(originalVfsConfig, updatedVfsConfig)) {
UpdateHostNicVfsConfigParameters param = new UpdateHostNicVfsConfigParameters(updatedVfsConfig.getNicId(), updatedVfsConfig.getNumOfVfs(), updatedVfsConfig.isAllNetworksAllowed());
updatedVfsConfigsParams.add(param);
}
}
use of org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters in project ovirt-engine by oVirt.
the class BackendHostNicResource method updateVirtualFunctionsConfiguration.
@Override
public Response updateVirtualFunctionsConfiguration(Action action) {
validateParameters(action, "virtualFunctionsConfiguration.numberOfVirtualFunctions|allNetworksAllowed");
final HostNicVfsConfig vfsConfig = parent.findVfsConfig(guid);
if (vfsConfig == null) {
return notAllowed(localize(Messages.INVALID_OPERATION_ON_NON_SRIOV_NIC), guid.toString());
}
UpdateHostNicVfsConfigParameters params = prepareUpdateHostNicVfsConfigParameters(action, vfsConfig);
return doAction(ActionType.UpdateHostNicVfsConfig, params, action);
}
use of org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters in project ovirt-engine by oVirt.
the class BackendHostNicResource method prepareUpdateHostNicVfsConfigParameters.
private UpdateHostNicVfsConfigParameters prepareUpdateHostNicVfsConfigParameters(Action action, HostNicVfsConfig vfsConfig) {
final Mapper<HostNicVfsConfig, UpdateHostNicVfsConfigParameters> entityMapper = getMapper(HostNicVfsConfig.class, UpdateHostNicVfsConfigParameters.class);
UpdateHostNicVfsConfigParameters params = entityMapper.map(vfsConfig, new UpdateHostNicVfsConfigParameters());
final Mapper<org.ovirt.engine.api.model.HostNicVirtualFunctionsConfiguration, UpdateHostNicVfsConfigParameters> userInputMapper = getMapper(org.ovirt.engine.api.model.HostNicVirtualFunctionsConfiguration.class, UpdateHostNicVfsConfigParameters.class);
userInputMapper.map(action.getVirtualFunctionsConfiguration(), params);
return params;
}
Aggregations