Search in sources :

Example 1 with UpdateHostNicVfsConfigParameters

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();
}
Also used : UpdateHostNicVfsConfigParameters(org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters)

Example 2 with UpdateHostNicVfsConfigParameters

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);
    }
}
Also used : UpdateHostNicVfsConfigParameters(org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters)

Example 3 with UpdateHostNicVfsConfigParameters

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);
}
Also used : HostNicVfsConfig(org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig) UpdateHostNicVfsConfigParameters(org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters)

Example 4 with UpdateHostNicVfsConfigParameters

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;
}
Also used : HostNicVfsConfig(org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig) UpdateHostNicVfsConfigParameters(org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters)

Aggregations

UpdateHostNicVfsConfigParameters (org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters)4 HostNicVfsConfig (org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig)2