Search in sources :

Example 1 with NetworkLabel

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

the class AbstractBaseHostNicLabelsResource method mapCollection.

private NetworkLabels mapCollection(List<org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel> networkLabels) {
    NetworkLabels labels = new NetworkLabels();
    for (org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel networkLabel : networkLabels) {
        NetworkLabel label = new NetworkLabel();
        label.setId(networkLabel.getId());
        labels.getNetworkLabels().add(label);
        addLinks(label, HostNic.class);
    }
    return labels;
}
Also used : NetworkLabels(org.ovirt.engine.api.model.NetworkLabels) NetworkLabel(org.ovirt.engine.api.model.NetworkLabel)

Example 2 with NetworkLabel

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

the class BackendNetworkLabelsResourceTest method testAddIncompleteParameters.

@Test
public void testAddIncompleteParameters() throws Exception {
    NetworkLabel model = new NetworkLabel();
    setUriInfo(setUpBasicUriExpectations());
    try {
        collection.add(model);
        fail("expected WebApplicationException on incomplete parameters");
    } catch (WebApplicationException wae) {
        verifyIncompleteException(wae, "NetworkLabel", "add", "id");
    }
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) NetworkLabel(org.ovirt.engine.api.model.NetworkLabel) Test(org.junit.Test)

Example 3 with NetworkLabel

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

the class BackendNetworkLabelsResource method mapCollection.

private NetworkLabels mapCollection(List<org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel> networkLabels) {
    NetworkLabels labels = new NetworkLabels();
    for (org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel networkLabel : networkLabels) {
        NetworkLabel label = new NetworkLabel();
        label.setId(networkLabel.getId());
        labels.getNetworkLabels().add(label);
        addLinks(label, Network.class);
    }
    return labels;
}
Also used : NetworkLabels(org.ovirt.engine.api.model.NetworkLabels) NetworkLabel(org.ovirt.engine.api.model.NetworkLabel)

Example 4 with NetworkLabel

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

the class BackendHostNicLabelsResourceTest method getModel.

private NetworkLabel getModel(int i) {
    NetworkLabel model = new NetworkLabel();
    model.setId(LABELS[i]);
    return model;
}
Also used : NetworkLabel(org.ovirt.engine.api.model.NetworkLabel)

Example 5 with NetworkLabel

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

the class BackendHostNicLabelsResourceTest method testAddIncompleteParameters.

@Test
public void testAddIncompleteParameters() throws Exception {
    NetworkLabel model = new NetworkLabel();
    setUriInfo(setUpBasicUriExpectations());
    try {
        collection.add(model);
        fail("expected WebApplicationException on incomplete parameters");
    } catch (WebApplicationException wae) {
        verifyIncompleteException(wae, "NetworkLabel", "add", "id");
    }
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) NetworkLabel(org.ovirt.engine.api.model.NetworkLabel) Test(org.junit.Test)

Aggregations

NetworkLabel (org.ovirt.engine.api.model.NetworkLabel)13 Test (org.junit.Test)6 NetworkLabels (org.ovirt.engine.api.model.NetworkLabels)3 WebApplicationException (javax.ws.rs.WebApplicationException)2 Response (javax.ws.rs.core.Response)2 HostNic (org.ovirt.engine.api.model.HostNic)1 Network (org.ovirt.engine.api.model.Network)1 CreateOrUpdateBond (org.ovirt.engine.core.common.action.CreateOrUpdateBond)1 HostSetupNetworksParameters (org.ovirt.engine.core.common.action.HostSetupNetworksParameters)1 Bond (org.ovirt.engine.core.common.businessentities.network.Bond)1 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)1 NicLabel (org.ovirt.engine.core.common.businessentities.network.NicLabel)1 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)1 Guid (org.ovirt.engine.core.compat.Guid)1