Search in sources :

Example 1 with OpticalConnectivity

use of org.onosproject.newoptical.OpticalConnectivity in project onos by opennetworkinglab.

the class ListOpticalConnectivityCommand method doExecute.

@Override
protected void doExecute() {
    OpticalPathService opticalPathService = get(OpticalPathService.class);
    Collection<OpticalConnectivity> connectivities = opticalPathService.listConnectivity();
    for (OpticalConnectivity connectivity : connectivities) {
        print("Optical connectivity ID: %s", connectivity.id().id());
        print(" links: %s", connectivity.links().stream().map(LinkKey::linkKey).map(lk -> lk.src() + "-" + lk.dst()).collect(Collectors.joining(", ")));
        print(" Bandwidth: %s, Latency: %s", connectivity.bandwidth(), connectivity.latency());
        print(" Intent Keys: %s", opticalPathService.listIntents(connectivity.id()));
    }
}
Also used : OpticalConnectivity(org.onosproject.newoptical.OpticalConnectivity) OpticalPathService(org.onosproject.newoptical.api.OpticalPathService)

Aggregations

OpticalConnectivity (org.onosproject.newoptical.OpticalConnectivity)1 OpticalPathService (org.onosproject.newoptical.api.OpticalPathService)1