Search in sources :

Example 16 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class MapVnicFlowTestUtils method profileViewOf.

static VnicProfileView profileViewOf(Guid id) {
    VnicProfileView vpv = new VnicProfileView();
    vpv.setId(id);
    return vpv;
}
Also used : VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView)

Example 17 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class VnicProfileViewDaoTest method testGetForUserWithoutPermission.

/**
 * Ensures that no network interface profile is returned.
 */
@Test
public void testGetForUserWithoutPermission() {
    VnicProfileView result = dao.get(FixturesTool.VM_NETWORK_INTERFACE_PROFILE, UNPRIVILEGED_USER_ID, true);
    assertNull(result);
}
Also used : VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView) Test(org.junit.Test)

Example 18 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class VnicProfileViewDaoTest method testGetAllForDataCenterWithPermissions.

/**
 * Ensures the right set of vnic profiles is returned for the given data center.
 */
@Test
public void testGetAllForDataCenterWithPermissions() {
    List<VnicProfileView> result = dao.getAllForDataCenter(FixturesTool.DATA_CENTER, PRIVILEGED_USER_ID, true);
    assertNotNull(result);
    assertFalse(result.isEmpty());
    for (VnicProfileView profile : result) {
        assertEquals(FixturesTool.DATA_CENTER_NAME, profile.getDataCenterName());
    }
}
Also used : VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView) Test(org.junit.Test)

Example 19 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class VmInterfaceModel method onSave.

protected void onSave() {
    VmNetworkInterface nic = createBaseNic();
    if (getProgress() != null) {
        return;
    }
    if (!validate()) {
        return;
    }
    // Save changes.
    nic.setName(getName().getEntity());
    VnicProfileView profile = getProfile().getSelectedItem();
    nic.setVnicProfileId(profile.getId());
    nic.setNetworkName(profile.getNetworkName());
    nic.setLinked(getLinked().getEntity());
    if (getNicType().getSelectedItem() == null) {
        nic.setType(null);
    } else {
        nic.setType(getNicType().getSelectedItem().getValue());
    }
    onSaveMAC(nic);
    nic.setPlugged(getPlugged().getEntity());
    startProgress();
    Frontend.getInstance().runAction(getActionType(), createVdcActionParameters(nic), result -> {
        ActionReturnValue returnValue = result.getReturnValue();
        stopProgress();
        if (returnValue != null && returnValue.getSucceeded()) {
            cancel();
            postOnSave();
        }
    }, this);
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView)

Example 20 with VnicProfileView

use of org.ovirt.engine.core.common.businessentities.network.VnicProfileView in project ovirt-engine by oVirt.

the class VmInterfaceModel method getDefaultNicTypeByProfile.

protected VmInterfaceType getDefaultNicTypeByProfile() {
    VnicProfileView profile = getProfile().getSelectedItem();
    boolean passthroughSupported = getSupportedVnicTypes().contains(VmInterfaceType.pciPassthrough);
    return profile != null && profile.isPassthrough() && passthroughSupported ? VmInterfaceType.pciPassthrough : AsyncDataProvider.getInstance().getDefaultNicType(getSupportedVnicTypes());
}
Also used : VnicProfileView(org.ovirt.engine.core.common.businessentities.network.VnicProfileView)

Aggregations

VnicProfileView (org.ovirt.engine.core.common.businessentities.network.VnicProfileView)22 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)5 VmNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)4 Network (org.ovirt.engine.core.common.businessentities.network.Network)2 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)2 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)2 Column (com.google.gwt.user.cellview.client.Column)1 List (java.util.List)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 NetworkQoS (org.ovirt.engine.core.common.businessentities.network.NetworkQoS)1 QueryParametersBase (org.ovirt.engine.core.common.queries.QueryParametersBase)1 QueryType (org.ovirt.engine.core.common.queries.QueryType)1 Guid (org.ovirt.engine.core.compat.Guid)1 AbstractCheckboxColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractCheckboxColumn)1 AbstractDiskSizeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn)1 AbstractEnumColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn)1 AbstractImageResourceColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn)1 AbstractSafeHtmlColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractSafeHtmlColumn)1