use of org.onosproject.net.topology.PathService in project onos by opennetworkinglab.
the class PathsWebResource method getDisjointPath.
/**
* Gets all shortest disjoint path pairs between any two hosts or devices.
* Returns array of all shortest disjoint path pairs between any two elements.
* @onos.rsModel Paths
* @param src source identifier
* @param dst destination identifier
* @return 200 OK with array of all shortest disjoint path pairs between any two elements
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("{src}/{dst}/disjoint")
public Response getDisjointPath(@PathParam("src") String src, @PathParam("dst") String dst) {
PathService pathService = get(PathService.class);
Set<org.onosproject.net.DisjointPath> paths = pathService.getDisjointPaths(elementId(src), elementId(dst));
return ok(encodeArray(org.onosproject.net.DisjointPath.class, "paths", paths)).build();
}
use of org.onosproject.net.topology.PathService in project onos by opennetworkinglab.
the class PathsWebResource method getPath.
/**
* Gets all shortest paths between any two hosts or devices.
* Returns array of all shortest paths between any two elements.
* @onos.rsModel Paths
* @param src source identifier
* @param dst destination identifier
* @return 200 OK with array of all shortest paths between any two elements
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("{src}/{dst}")
public Response getPath(@PathParam("src") String src, @PathParam("dst") String dst) {
PathService pathService = get(PathService.class);
Set<org.onosproject.net.Path> paths = pathService.getPaths(elementId(src), elementId(dst));
return ok(encodeArray(org.onosproject.net.Path.class, "paths", paths)).build();
}
Aggregations