Search in sources :

Example 41 with Network

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

the class BackendNetworkLabelsResource method addParents.

@Override
protected NetworkLabel addParents(NetworkLabel model) {
    model.setNetwork(new Network());
    model.getNetwork().setId(networkId.toString());
    return model;
}
Also used : Network(org.ovirt.engine.api.model.Network)

Example 42 with Network

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

the class BackendNetworkResource method get.

@Override
public Network get() {
    org.ovirt.engine.core.common.businessentities.network.Network entity = parent.lookupNetwork(guid);
    if (entity == null) {
        return notFound();
    }
    Network network = map(entity);
    network.setDisplay(null);
    return addLinks(network);
}
Also used : Network(org.ovirt.engine.api.model.Network)

Example 43 with Network

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

the class BackendClusterNetworkResourceTest method getModel.

private Network getModel(int i) {
    Network network = new Network();
    network.setId(GUIDS[i].toString());
    network.setName(NAMES[i]);
    network.setDisplay(true);
    return network;
}
Also used : Network(org.ovirt.engine.api.model.Network)

Example 44 with Network

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

the class AbstractBackendNetworksResourceTest method getModel.

static Network getModel(int index) {
    Network model = new Network();
    model.setId(GUIDS[0].toString());
    model.setName(NAMES[index]);
    model.setDescription(DESCRIPTIONS[index]);
    return model;
}
Also used : Network(org.ovirt.engine.api.model.Network)

Example 45 with Network

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

the class AbstractBackendVnicProfilesResourceTest method doTestBadAddVnicProfile.

private void doTestBadAddVnicProfile(boolean valid, boolean success, String detail) throws Exception {
    setUriInfo(setUpActionExpectations(ActionType.AddVnicProfile, AddVnicProfileParameters.class, new String[] {}, new Object[] {}, valid, success));
    VnicProfile model = getModel(0);
    model.setNetwork(new Network());
    model.getNetwork().setId(NETWORK_ID.toString());
    try {
        collection.add(model);
        fail("expected WebApplicationException");
    } catch (WebApplicationException wae) {
        verifyFault(wae, detail);
    }
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) Network(org.ovirt.engine.api.model.Network) VnicProfile(org.ovirt.engine.api.model.VnicProfile) AddVnicProfileParameters(org.ovirt.engine.core.common.action.AddVnicProfileParameters)

Aggregations

Network (org.ovirt.engine.api.model.Network)45 Test (org.junit.Test)16 WebApplicationException (javax.ws.rs.WebApplicationException)9 Response (javax.ws.rs.core.Response)6 DataCenter (org.ovirt.engine.api.model.DataCenter)6 VnicProfile (org.ovirt.engine.api.model.VnicProfile)5 V3Network (org.ovirt.engine.api.v3.types.V3Network)4 Guid (org.ovirt.engine.core.compat.Guid)4 Networks (org.ovirt.engine.api.model.Networks)3 V3Networks (org.ovirt.engine.api.v3.types.V3Networks)3 V3PortMirroring (org.ovirt.engine.api.v3.types.V3PortMirroring)3 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)3 HostNic (org.ovirt.engine.api.model.HostNic)2 NetworkLabels (org.ovirt.engine.api.model.NetworkLabels)2 Nic (org.ovirt.engine.api.model.Nic)2 ClusterNetworksResource (org.ovirt.engine.api.resource.ClusterNetworksResource)2 NetworkResource (org.ovirt.engine.api.resource.NetworkResource)2 NetworksResource (org.ovirt.engine.api.resource.NetworksResource)2 SystemResource (org.ovirt.engine.api.resource.SystemResource)2 VnicProfileResource (org.ovirt.engine.api.resource.VnicProfileResource)2