Search in sources :

Example 1 with ScalableGatewayService

use of org.onosproject.scalablegateway.api.ScalableGatewayService in project onos by opennetworkinglab.

the class ScalableGatewayDeleteCommand method doExecute.

@Override
protected void doExecute() {
    ScalableGatewayService service = get(ScalableGatewayService.class);
    GatewayNode gatewayNode = service.getGatewayNode(DeviceId.deviceId(deviceId));
    if (gatewayNode == null) {
        print(UNKNOWN);
        return;
    }
    if (service.deleteGatewayNode(gatewayNode)) {
        print(SUCCESS);
    } else {
        print(FAIL);
    }
}
Also used : GatewayNode(org.onosproject.scalablegateway.api.GatewayNode) ScalableGatewayService(org.onosproject.scalablegateway.api.ScalableGatewayService)

Example 2 with ScalableGatewayService

use of org.onosproject.scalablegateway.api.ScalableGatewayService in project onos by opennetworkinglab.

the class ScalableGatewayAddCommand method doExecute.

@Override
protected void doExecute() {
    ScalableGatewayService service = get(ScalableGatewayService.class);
    GatewayNode gatewayNode = GatewayNode.builder().gatewayDeviceId(DeviceId.deviceId(deviceId)).dataIpAddress(Ip4Address.valueOf(ipAddress)).uplinkIntf(interfaceName).build();
    if (service.addGatewayNode(gatewayNode)) {
        print(SUCCESS);
    } else {
        print(FAIL);
    }
}
Also used : GatewayNode(org.onosproject.scalablegateway.api.GatewayNode) ScalableGatewayService(org.onosproject.scalablegateway.api.ScalableGatewayService)

Example 3 with ScalableGatewayService

use of org.onosproject.scalablegateway.api.ScalableGatewayService in project onos by opennetworkinglab.

the class ScalableGatewayListCommand method doExecute.

@Override
protected void doExecute() {
    ScalableGatewayService service = get(ScalableGatewayService.class);
    service.getGatewayNodes().forEach(node -> print(FORMAT, node.getGatewayDeviceId().toString(), node.getDataIpAddress().toString(), node.getUplinkIntf().toString()));
}
Also used : ScalableGatewayService(org.onosproject.scalablegateway.api.ScalableGatewayService)

Aggregations

ScalableGatewayService (org.onosproject.scalablegateway.api.ScalableGatewayService)3 GatewayNode (org.onosproject.scalablegateway.api.GatewayNode)2