Search in sources :

Example 11 with OpenstackVtap

use of org.onosproject.openstackvtap.api.OpenstackVtap in project onos by opennetworkinglab.

the class OpenstackVtapAddCommand method doExecute.

@Override
protected void doExecute() {
    OpenstackVtapCriterion criterion = makeVtapCriterion(srcIp, dstIp, ipProto, srcTpPort, dstTpPort);
    OpenstackVtap.Type type = getVtapTypeFromString(vtapTypeStr);
    if (type == null) {
        print("Invalid vtap type");
        return;
    }
    OpenstackVtap vtap = vtapService.createVtap(type, criterion);
    if (vtap != null) {
        print("Created OpenstackVtap with id { %s }", vtap.id().toString());
    } else {
        print("Failed to create OpenstackVtap");
    }
}
Also used : OpenstackVtap(org.onosproject.openstackvtap.api.OpenstackVtap) OpenstackVtapCriterion(org.onosproject.openstackvtap.api.OpenstackVtapCriterion)

Aggregations

OpenstackVtap (org.onosproject.openstackvtap.api.OpenstackVtap)11 Test (org.junit.Test)4 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 Produces (javax.ws.rs.Produces)2 DeviceId (org.onosproject.net.DeviceId)2 OpenstackVtapCriterion (org.onosproject.openstackvtap.api.OpenstackVtapCriterion)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 Consumes (javax.ws.rs.Consumes)1 GET (javax.ws.rs.GET)1 POST (javax.ws.rs.POST)1 UriBuilder (javax.ws.rs.core.UriBuilder)1 OpenstackVtapUtil.getVtapTypeFromString (org.onosproject.openstackvtap.util.OpenstackVtapUtil.getVtapTypeFromString)1