Scripting: fill in get contexts REST API (#48319)#48602
Merged
stu-elastic merged 2 commits intoelastic:7.xfrom Oct 29, 2019
Merged
Scripting: fill in get contexts REST API (#48319)#48602stu-elastic merged 2 commits intoelastic:7.xfrom
stu-elastic merged 2 commits intoelastic:7.xfrom
Conversation
* Scripting: fill in get contexts REST API
Updates response for `GET /_script_context`, returning a `contexts`
object with a list of context description objects. The description
includes the context name and a list of methods available. The
methods list has the signature for the `execute` mathod and any
getters. eg.
```
{
"contexts": [
{
"name" : "moving-function",
"methods" : [
{
"name" : "execute",
"return_type" : "double",
"params" : [
{
"type" : "java.util.Map",
"name" : "params"
},
{
"type" : "double[]",
"name" : "values"
}
]
}
]
},
{
"name" : "number_sort",
"methods" : [
{
"name" : "execute",
"return_type" : "double",
"params" : [ ]
},
{
"name" : "getDoc",
"return_type" : "java.util.Map",
"params" : [ ]
},
{
"name" : "getParams",
"return_type" : "java.util.Map",
"params" : [ ]
},
{
"name" : "get_score",
"return_type" : "double",
"params" : [ ]
}
]
},
...
]
}
```
fixes: elastic#47411
Collaborator
|
Pinging @elastic/es-core-infra (:Core/Infra/Scripting) |
Contributor
Author
|
@elasticmachine run elasticsearch-ci/packaging-sample-matrix |
jdconrad
approved these changes
Oct 29, 2019
Contributor
There was a problem hiding this comment.
LGTM! Please add the version you're going to backport to as a label. 7.5, right? Also, were you able to test this locally against Java 8? I did my best to look through this carefully, but a compiler is definitely better than my eyes for detecting something that might not be J8 compatible.
Edit: NM, CI passed which should test the compatility.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates response for
GET /_script_context, returning acontextsobject with a list of context description objects. The description
includes the context name and a list of methods available. The
methods list has the signature for the
executemathod and anygetters. eg.
fixes: #47411