Search in sources :

Example 6 with SegmentRoutingService

use of org.onosproject.segmentrouting.SegmentRoutingService in project trellis-control by opennetworkinglab.

the class PseudowireRemoveCommand method doExecute.

@Override
protected void doExecute() {
    SegmentRoutingService srService = AbstractShellCommand.get(SegmentRoutingService.class);
    // remove the pseudowire
    SegmentRoutingManager mngr = (SegmentRoutingManager) srService;
    int pwIntId;
    try {
        pwIntId = parsePwId(pwId);
    } catch (IllegalArgumentException e) {
        log.error("Exception while parsing pseudowire id : \n\t %s", e.getMessage());
        print("Exception while parsing pseudowire id : \n\t %s", e.getMessage());
        return;
    }
    log.info("Removing pseudowire {} from the command line.", pwIntId);
    L2TunnelHandler.Result res = mngr.removePseudowire(pwIntId);
    switch(res) {
        case WRONG_PARAMETERS:
            error("Pseudowire could not be removed , wrong parameters: \n\t %s\n", res.getSpecificError());
            break;
        case INTERNAL_ERROR:
            error("Pseudowire could not be removed, internal error : \n\t %s\n", res.getSpecificError());
            break;
        case SUCCESS:
            break;
        default:
            break;
    }
}
Also used : SegmentRoutingService(org.onosproject.segmentrouting.SegmentRoutingService) L2TunnelHandler(org.onosproject.segmentrouting.pwaas.L2TunnelHandler) SegmentRoutingManager(org.onosproject.segmentrouting.SegmentRoutingManager)

Example 7 with SegmentRoutingService

use of org.onosproject.segmentrouting.SegmentRoutingService in project trellis-control by opennetworkinglab.

the class ShouldProgramCommand method doExecute.

@Override
protected void doExecute() {
    SegmentRoutingService srService = AbstractShellCommand.get(SegmentRoutingService.class);
    Map<DeviceId, NodeId> shouldProgram = srService.getShouldProgramLeaders();
    print("shouldProgram");
    shouldProgram.forEach((k, v) -> print("%s -> %s", k, v));
}
Also used : SegmentRoutingService(org.onosproject.segmentrouting.SegmentRoutingService) DeviceId(org.onosproject.net.DeviceId) NodeId(org.onosproject.cluster.NodeId)

Example 8 with SegmentRoutingService

use of org.onosproject.segmentrouting.SegmentRoutingService in project trellis-control by opennetworkinglab.

the class VerifyGroupsCommand method doExecute.

@Override
protected void doExecute() {
    DeviceService deviceService = get(DeviceService.class);
    SegmentRoutingService srService = AbstractShellCommand.get(SegmentRoutingService.class);
    if (uri != null) {
        Device dev = deviceService.getDevice(DeviceId.deviceId(uri));
        if (dev != null) {
            srService.verifyGroups(dev.id());
        }
    }
}
Also used : SegmentRoutingService(org.onosproject.segmentrouting.SegmentRoutingService) Device(org.onosproject.net.Device) DeviceService(org.onosproject.net.device.DeviceService)

Example 9 with SegmentRoutingService

use of org.onosproject.segmentrouting.SegmentRoutingService in project trellis-control by opennetworkinglab.

the class EcmpGraphCommand method doExecute.

@Override
protected void doExecute() {
    SegmentRoutingService srService = AbstractShellCommand.get(SegmentRoutingService.class);
    printEcmpGraph(srService.getCurrentEcmpSpg());
}
Also used : SegmentRoutingService(org.onosproject.segmentrouting.SegmentRoutingService)

Example 10 with SegmentRoutingService

use of org.onosproject.segmentrouting.SegmentRoutingService in project trellis-control by opennetworkinglab.

the class McastFilterListCommand method doExecute.

@Override
protected void doExecute() {
    // Get SR service
    SegmentRoutingService srService = get(SegmentRoutingService.class);
    // Get the filt objs
    Map<DeviceId, List<McastFilteringObjStoreKey>> filteringObjKeys = srService.getMcastFilters();
    filteringObjKeys.forEach(this::printMcastFilter);
}
Also used : SegmentRoutingService(org.onosproject.segmentrouting.SegmentRoutingService) DeviceId(org.onosproject.net.DeviceId) List(java.util.List)

Aggregations

SegmentRoutingService (org.onosproject.segmentrouting.SegmentRoutingService)31 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)11 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)10 Consumes (javax.ws.rs.Consumes)7 L2TunnelHandler (org.onosproject.segmentrouting.pwaas.L2TunnelHandler)7 List (java.util.List)5 IpAddress (org.onlab.packet.IpAddress)5 JsonNode (com.fasterxml.jackson.databind.JsonNode)4 ArrayList (java.util.ArrayList)4 DELETE (javax.ws.rs.DELETE)4 POST (javax.ws.rs.POST)4 Pair (org.apache.commons.lang3.tuple.Pair)4 DeviceId (org.onosproject.net.DeviceId)4 DefaultL2TunnelDescription (org.onosproject.segmentrouting.pwaas.DefaultL2TunnelDescription)4 Collectors (java.util.stream.Collectors)3 Path (javax.ws.rs.Path)3 Tunnel (org.onosproject.segmentrouting.Tunnel)3 L2Tunnel (org.onosproject.segmentrouting.pwaas.L2Tunnel)3 L2TunnelDescription (org.onosproject.segmentrouting.pwaas.L2TunnelDescription)3 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)2