use of org.onosproject.newoptical.api.OpticalPathService in project onos by opennetworkinglab.
the class AddOpticalConnectivityCommand method doExecute.
@Override
protected void doExecute() {
OpticalPathService opticalPathService = get(OpticalPathService.class);
ConnectPoint ingress = readConnectPoint(ingressStr);
ConnectPoint egress = readConnectPoint(egressStr);
if (ingress == null || egress == null) {
print("Invalid connect points: %s, %s", ingressStr, egressStr);
return;
}
Bandwidth bandwidth = (bandwidthStr == null || bandwidthStr.isEmpty()) ? null : Bandwidth.bps(Long.valueOf(bandwidthStr));
print("Trying to setup connectivity between %s and %s.", ingress, egress);
OpticalConnectivityId id = opticalPathService.setupConnectivity(ingress, egress, bandwidth, null);
if (id == null) {
print("Failed. See ONOS log for more details.");
print(" log:set TRACE org.onosproject.newoptical.OpticalPathProvisioner");
return;
}
// FIXME This is the last chance to know the Optical path ID.
// there's no other way to know existing Optical Path ID
print("Optical path ID : %s", id.id());
log.info("Optical path ID {} for connectivity between {} and {}", id.id(), ingress, egress);
}
use of org.onosproject.newoptical.api.OpticalPathService in project onos by opennetworkinglab.
the class RemoveOpticalConnectivityCommand method doExecute.
@Override
protected void doExecute() {
OpticalPathService opticalPathService = get(OpticalPathService.class);
OpticalConnectivityId id = OpticalConnectivityId.of(Long.valueOf(idStr));
print("Trying to remove connectivity with id %s.", idStr);
if (opticalPathService.removeConnectivity(id)) {
print(" -- success");
} else {
print(" -- failed");
}
}
use of org.onosproject.newoptical.api.OpticalPathService 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()));
}
}
Aggregations