Search in sources :

Example 11 with KubevirtRouter

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);
}
Also used : KubevirtNode(org.onosproject.kubevirtnode.api.KubevirtNode) KubevirtRouter(org.onosproject.kubevirtnetworking.api.KubevirtRouter)

Example 12 with KubevirtRouter

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());
}
Also used : KubevirtRouter(org.onosproject.kubevirtnetworking.api.KubevirtRouter) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 13 with KubevirtRouter

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();
}
Also used : KubevirtRouter(org.onosproject.kubevirtnetworking.api.KubevirtRouter) KubevirtRouterService(org.onosproject.kubevirtnetworking.api.KubevirtRouterService) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

KubevirtRouter (org.onosproject.kubevirtnetworking.api.KubevirtRouter)13 DefaultKubevirtRouter (org.onosproject.kubevirtnetworking.api.DefaultKubevirtRouter)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 KubevirtPeerRouter (org.onosproject.kubevirtnetworking.api.KubevirtPeerRouter)3 KubevirtRouterJsonMatcher.matchesKubevirtRouter (org.onosproject.kubevirtnetworking.codec.KubevirtRouterJsonMatcher.matchesKubevirtRouter)3 KubevirtNode (org.onosproject.kubevirtnode.api.KubevirtNode)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)2 Test (org.junit.Test)2 KubevirtRouterService (org.onosproject.kubevirtnetworking.api.KubevirtRouterService)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 HashSet (java.util.HashSet)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 IpAddress (org.onlab.packet.IpAddress)1 MacAddress (org.onlab.packet.MacAddress)1 KubevirtNetworkingUtil.genFormatString (org.onosproject.kubevirtnetworking.util.KubevirtNetworkingUtil.genFormatString)1