def es()

in app/controllers/Application.scala [73:81]


  def es(name: String) = authAction.async { implicit req =>
    import scala.concurrent.ExecutionContext.Implicits.global
    (for {
      asg <- estateProvider().asgs if asg.name.exists(_ == name)
      stats <- Random.shuffle(asg.members).headOption map (m => wsClient.url(s"http://${m.instance.publicDns}:9200/_nodes/stats?groups=_all").get())
    } yield stats map { r =>
      Ok(views.html.elasticsearch(ElasticsearchStatsGroups.parse(r.json), estateProvider))
    }).headOption.getOrElse(Future.successful(NotFound))
  }