use of org.onosproject.portloadbalancer.api.PortLoadBalancerService in project onos by opennetworkinglab.
the class PortLoadBalancerListCommand method doExecute.
@Override
public void doExecute() {
PortLoadBalancerService service = get(PortLoadBalancerService.class);
// Get port load balancers and reservations
Map<PortLoadBalancerId, PortLoadBalancer> portLoadBalancerStore = service.getPortLoadBalancers();
Map<PortLoadBalancerId, ApplicationId> portLoadBalancerResStore = service.getReservations();
// Print id -> ports, mode, reservation
portLoadBalancerStore.forEach((portLoadBalancerId, portLoadBalancer) -> print("%s -> %s, %s, %s", portLoadBalancerId, portLoadBalancer.ports(), portLoadBalancer.mode(), portLoadBalancerResStore.get(portLoadBalancerId) == null ? AVAILABLE : portLoadBalancerResStore.get(portLoadBalancerId).name()));
}
Aggregations