This file contains hidden or 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
| newValue = transformField(newValue, fieldName, displayName) |
This file contains hidden or 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
| def getExceptionTemplateByEnv(templateId: String) = Action { | |
| Core.getExceptionTemplatesByEnv(templateId).fold ( | |
| outputDataStoreResponse, | |
| (templates) => Ok(Json.toJson(templates)) | |
| ) | |
| } | |
| def outputDataStoreResponse: (DataStoreResponse) => Result = { | |
| (dataStoreResponse) => NotFound(dataStoreResponse.jsValue) | |
| } |
This file contains hidden or 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
| def getEntitiesByKeyFromDatastore[T]( | |
| entityName: String, | |
| lookupKey: (String, String), | |
| reads: Reads[T]): Either[DataStoreResponse, List[T]] |
This file contains hidden or 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
| { | |
| "CA_ELEM_1": [ | |
| { | |
| "ruleId": "235c8202-4f3f-11e4-9e35-164230d1df67", | |
| "type": "regex", | |
| "expression": "[0-9].*", | |
| "description": "must be a valid number" | |
| }, | |
| { | |
| "ruleId": "5186bc7e-4f3f-11e4-9e35-164230d1df67", |
This file contains hidden or 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
| [ | |
| { | |
| "CA_ELEM_1": "{value}" | |
| }, | |
| { | |
| "CA_ELEM_2": "{value}" | |
| } | |
| ] |
This file contains hidden or 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
| { | |
| "CA_ELEM_1": [ | |
| { | |
| "ruleId": "{uuid}", | |
| "valid": true | |
| }, | |
| { | |
| "ruleId": "{uuid}", | |
| "valid": false, | |
| "message": "must be a valid number" |
This file contains hidden or 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
| curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 3de837bf-3f1a-4882-c538-22025f1e1c3f" -d '{ | |
| "aggs" : { | |
| "name" : { | |
| "terms" : { "field" : "Invoice.InvNorm.LspRootOrgName.raw" } | |
| } | |
| } | |
| }' http://elasticsearch.s03.filex.com/fps-exceptions_c94c36b8-e425-4bb8-b291-4b34f96d74ca_b/_search?size=0 | |
| { | |
| "took": 2, |
This file contains hidden or 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
| import org.elasticsearch.monitor.jvm.HotThreads | |
| import play.api.mvc._ | |
| object HotThreadsController extends BaseController { | |
| def getHotThreads = Action { | |
| Ok(new HotThreads().detect()) | |
| } | |
| } |
This file contains hidden or 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
| @annotation.tailrec | |
| final def retry[T](n: Int)(fn: => T): T = { | |
| util.Try { fn } match { | |
| case util.Success(x) => x | |
| case _ if n > 1 => retry(n - 1)(fn) | |
| case util.Failure(e) => throw e | |
| } | |
| } |
This file contains hidden or 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
| retry(10) { | |
| // to some stuff that might need a few kicks in the butt before it works | |
| } |