use of org.onosproject.kubevirtnetworking.api.KubevirtRouter in project onos by opennetworkinglab.
the class KubevirtNetworkHandler method setGatewayIcmpRulesForTenantNetwork.
private void setGatewayIcmpRulesForTenantNetwork(KubevirtNode node, KubevirtNetwork network) {
KubevirtRouter router = getRouterForKubevirtNetwork(kubevirtRouterService, network);
if (router == null) {
return;
}
KubevirtNode electedGw = gatewayNodeForSpecifiedRouter(nodeService, router);
if (electedGw == null) {
return;
}
setGatewayIcmpRuleForTenantInternalNetwork(router, network, TENANT_ICMP_TABLE, electedGw.intgBridge(), network.tenantDeviceId(node.hostname()), true);
}
use of org.onosproject.kubevirtnetworking.api.KubevirtRouter in project onos by opennetworkinglab.
the class KubevirtListRouterCommand method json.
private String json(List<KubevirtRouter> routers) {
ObjectMapper mapper = new ObjectMapper();
ArrayNode result = mapper.createArrayNode();
for (KubevirtRouter router : routers) {
result.add(jsonForEntity(router, KubevirtRouter.class));
}
return prettyJson(mapper, result.toString());
}
use of org.onosproject.kubevirtnetworking.api.KubevirtRouter in project onos by opennetworkinglab.
the class KubevirtRouterWebResource method getRouters.
/**
* Returns set of all routers.
*
* @return 200 OK with set of all routers
* @onos.rsModel KubevirtRouters
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getRouters() {
KubevirtRouterService service = get(KubevirtRouterService.class);
final Iterable<KubevirtRouter> routers = service.routers();
return ok(encodeArray(KubevirtRouter.class, ROUTERS, routers)).build();
}
Aggregations