Search in sources :

Example 1 with GnpyService

use of org.onosproject.odtn.GnpyService in project onos by opennetworkinglab.

the class ConnectGnpyCommand method doExecute.

@Override
protected void doExecute() {
    GnpyService service = get(GnpyService.class);
    String msg;
    if (disconnect) {
        msg = service.disconnectGnpy() ? "gnpy disconnect" : "error in disconnecting gnpy";
    } else {
        Preconditions.checkNotNull(ip, "Ip must be specified");
        Preconditions.checkNotNull(password, "password must be specified");
        msg = service.connectGnpy(protocol, ip, port, username, password) ? "gnpy connected" : "error in connecting gnpy, please check logs";
    }
    print(msg);
}
Also used : GnpyService(org.onosproject.odtn.GnpyService)

Example 2 with GnpyService

use of org.onosproject.odtn.GnpyService in project onos by opennetworkinglab.

the class GnpyConnectionRequestCommand method doExecute.

@Override
protected void doExecute() {
    GnpyService service = get(GnpyService.class);
    if (!service.isConnected()) {
        print("gNPY is not connected, please issue `odtn-connect-gnpy-command` first");
        return;
    }
    ConnectPoint ingress = createConnectPoint(ingressString);
    ConnectPoint egress = createConnectPoint(egressString);
    Pair<IntentId, Double> intentIdAndOsnr = service.obtainConnectivity(ingress, egress, bidirectional);
    if (intentIdAndOsnr != null) {
        print("Optical Connectivity from %s to %s submitted through GNPy. \n", ingress, egress);
        print("Expected GSNR %.2f dB", intentIdAndOsnr.getRight().doubleValue());
        print("Intent: %s", intentIdAndOsnr.getLeft());
    } else {
        print("Error in submitting Optical Connectivity submitted through GNPy, please see logs");
    }
}
Also used : GnpyService(org.onosproject.odtn.GnpyService) ConnectPoint(org.onosproject.net.ConnectPoint) IntentId(org.onosproject.net.intent.IntentId)

Aggregations

GnpyService (org.onosproject.odtn.GnpyService)2 ConnectPoint (org.onosproject.net.ConnectPoint)1 IntentId (org.onosproject.net.intent.IntentId)1