Skip to content

Commit

Permalink
[scripts] stub scripts/languages api until #11959 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed May 27, 2017
1 parent 948bff2 commit 0b84b99
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
import _ from 'lodash';
import handleESError from '../../../lib/handle_es_error';

export function registerLanguages(server) {
server.route({
path: '/api/kibana/scripts/languages',
method: 'GET',
handler: function (request, reply) {
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');

return callWithRequest(request, 'cluster.getSettings', {
include_defaults: true,
filter_path: '**.script.engine.*.inline'
})
.then((esResponse) => {
const langs = _.get(esResponse, 'defaults.script.engine', {});
const inlineLangs = _.pick(langs, (lang) => lang.inline === 'true');
const supportedLangs = _.omit(inlineLangs, 'mustache');
return _.keys(supportedLangs);
})
.then(reply)
.catch((error) => {
reply(handleESError(error));
});
reply(['painless', 'expression']);
}
});
}

0 comments on commit 0b84b99

Please sign in to comment.