Search in sources :

Example 16 with HostNic

use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.

the class HostNicStatisticalQuery method clone.

private HostNic clone(HostNic parent) {
    HostNic nic = new HostNic();
    nic.setId(parent.getId());
    nic.setHost(new Host());
    nic.getHost().setId(parent.getHost().getId());
    return nic;
}
Also used : HostNic(org.ovirt.engine.api.model.HostNic) Host(org.ovirt.engine.api.model.Host)

Example 17 with HostNic

use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.

the class BackendHostNicNetworkAttachmentResourceTest method getModel.

@Override
protected org.ovirt.engine.api.model.NetworkAttachment getModel(int index) {
    org.ovirt.engine.api.model.NetworkAttachment model = super.getModel(index);
    model.setHostNic(new HostNic());
    model.getHostNic().setId(HOST_NIC_ID.toString());
    return model;
}
Also used : HostNic(org.ovirt.engine.api.model.HostNic)

Example 18 with HostNic

use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.

the class BackendHostNicResourceTest method testGetIncludeStatistics.

@Test
public void testGetIncludeStatistics() throws Exception {
    try {
        accepts.add("application/xml; detail=statistics");
        setUriInfo(setUpBasicUriExpectations());
        setGetVdsQueryExpectations(1);
        setGetNetworksQueryExpectations(1);
        setUpEntityQueryExpectations();
        HostNic nic = resource.get();
        assertTrue(nic.isSetStatistics());
        hostNicsResource.verifyModelSpecific(nic, NIC_IDX);
    } finally {
        accepts.clear();
    }
}
Also used : HostNic(org.ovirt.engine.api.model.HostNic) Test(org.junit.Test)

Example 19 with HostNic

use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.

the class BackendHostNicResourceTest method testStatisticalQuery.

@Test
public void testStatisticalQuery() throws Exception {
    VdsNetworkInterface entity = setUpStatisticalExpectations();
    @SuppressWarnings("unchecked") BackendStatisticsResource<HostNic, VdsNetworkInterface> statisticsResource = (BackendStatisticsResource<HostNic, VdsNetworkInterface>) resource.getStatisticsResource();
    assertNotNull(statisticsResource);
    verifyQuery(statisticsResource.getQuery(), entity);
}
Also used : HostNic(org.ovirt.engine.api.model.HostNic) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) Test(org.junit.Test)

Example 20 with HostNic

use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.

the class BackendHostNicsResourceTest method testListIncludeStatistics.

@Test
public void testListIncludeStatistics() throws Exception {
    try {
        accepts.add("application/xml; detail=statistics");
        UriInfo uriInfo = setUpBasicUriExpectations();
        setGetVdsQueryExpectations(1);
        setGetNetworksQueryExpectations(1);
        setUpQueryExpectations("");
        collection.setUriInfo(uriInfo);
        List<HostNic> nics = getCollection();
        assertTrue(nics.get(0).isSetStatistics());
        verifyCollection(nics);
    } finally {
        accepts.clear();
    }
}
Also used : HostNic(org.ovirt.engine.api.model.HostNic) UriInfo(javax.ws.rs.core.UriInfo) Test(org.junit.Test)

Aggregations

HostNic (org.ovirt.engine.api.model.HostNic)30 Test (org.junit.Test)7 Host (org.ovirt.engine.api.model.Host)6 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)6 Guid (org.ovirt.engine.core.compat.Guid)6 Bond (org.ovirt.engine.core.common.businessentities.network.Bond)4 Bonding (org.ovirt.engine.api.model.Bonding)3 HostNics (org.ovirt.engine.api.model.HostNics)3 Network (org.ovirt.engine.api.model.Network)3 BootProtocol (org.ovirt.engine.api.model.BootProtocol)2 HostNicVirtualFunctionsConfiguration (org.ovirt.engine.api.model.HostNicVirtualFunctionsConfiguration)2 CreateOrUpdateBond (org.ovirt.engine.core.common.action.CreateOrUpdateBond)2 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)2 HostNicVfsConfig (org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig)2 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)2 List (java.util.List)1 Collectors.joining (java.util.stream.Collectors.joining)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 UriInfo (javax.ws.rs.core.UriInfo)1 StringUtils (org.apache.commons.lang.StringUtils)1