Skip to content

Scripting: add available languages & contexts API (#49652)#49815

Merged
stu-elastic merged 5 commits intoelastic:7.xfrom
stu-elastic:7.x-backport-script-languages
Dec 4, 2019
Merged

Scripting: add available languages & contexts API (#49652)#49815
stu-elastic merged 5 commits intoelastic:7.xfrom
stu-elastic:7.x-backport-script-languages

Conversation

@stu-elastic
Copy link
Copy Markdown
Contributor

Adds GET /_script_language to support Kibana dynamic scripting
language selection.

Response contains whether inline and/or stored scripts are
enabled as determined by the script.allowed_types settings.

For each scripting language registered, such as painless,
expression, mustache or custom, available contexts for the language
are included as determined by the script.allowed_contexts setting.

Response format:

{
  "types_allowed": [
    "inline",
    "stored"
  ],
  "language_contexts": [
    {
      "language": "expression",
      "contexts": [
        "aggregation_selector",
        "aggs"
        ...
      ]
    },
    {
      "language": "painless",
      "contexts": [
        "aggregation_selector",
        "aggs",
        "aggs_combine",
        ...
      ]
    }
...
  ]
}

Fixes: #49463

Backport

Adds `GET /_script_language` to support Kibana dynamic scripting
language selection.

Response contains whether `inline` and/or `stored` scripts are
enabled as determined by the `script.allowed_types` settings.

For each scripting language registered, such as `painless`,
`expression`, `mustache` or custom, available contexts for the language
are included as determined by the `script.allowed_contexts` setting.

Response format:
```
{
  "types_allowed": [
    "inline",
    "stored"
  ],
  "language_contexts": [
    {
      "language": "expression",
      "contexts": [
        "aggregation_selector",
        "aggs"
        ...
      ]
    },
    {
      "language": "painless",
      "contexts": [
        "aggregation_selector",
        "aggs",
        "aggs_combine",
        ...
      ]
    }
...
  ]
}
```

Fixes: elastic#49463
@stu-elastic stu-elastic added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache backport v7.6.0 labels Dec 4, 2019
@stu-elastic stu-elastic requested a review from jdconrad December 4, 2019 02:08
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Scripting)

@jdconrad
Copy link
Copy Markdown
Contributor

jdconrad commented Dec 4, 2019

Looks like a missed Map.of which isn't available in Java 8 is causing the issue.

Copy link
Copy Markdown
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the compiler errors are resolved.

@stu-elastic
Copy link
Copy Markdown
Contributor Author

@elasticmachine run elasticsearch-ci/1

@stu-elastic stu-elastic merged commit 426c7a5 into elastic:7.x Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v7.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants