use of org.onosproject.k8snetworking.api.K8sNetwork in project onos by opennetworkinglab.
the class K8sNetworkWebResource method hasNetwork.
/**
* Checks whether the network exists with given network id.
*
* @param id network identifier
* @return 200 OK with true/false result
*/
@GET
@Path("exist/{id}")
public Response hasNetwork(@PathParam("id") String id) {
log.trace(String.format(MESSAGE, "QUERY " + id));
ObjectNode root = mapper().createObjectNode();
K8sNetwork network = adminService.network(id);
if (network == null) {
root.put(RESULT, false);
} else {
root.put(RESULT, true);
}
return Response.ok(root).build();
}
Aggregations