forked from lmenezes/cerebro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leonardo Menezes
committed
May 5, 2016
1 parent
ce716d6
commit 1ed0a17
Showing
24 changed files
with
907 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package controllers | ||
|
||
|
||
import models.ClusterMapping | ||
import scala.concurrent.ExecutionContext.Implicits.global | ||
|
||
class GetClusterMappingController extends BaseController { | ||
|
||
def processRequest = (request, client) => client.getClusterMapping(request.host).map { response => | ||
Ok(ClusterMapping(response.body)) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package controllers | ||
|
||
class RestController extends ElasticActionController { | ||
|
||
def processElasticRequest = (request, client) => { | ||
client.executeRequest( | ||
request.get("method"), | ||
request.get("path"), | ||
request.getOpt("data"), | ||
request.host | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package models | ||
|
||
import play.api.libs.json.{Json, JsString, JsObject, JsValue} | ||
|
||
object ClusterMapping { | ||
|
||
def apply(mappings: JsValue) = JsObject(mappings.as[JsObject].value.map { | ||
case (index, indexMappings) => | ||
(index -> Json.obj("types" -> (indexMappings \ "mappings").as[JsObject].keys.map(JsString(_)))) | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.