A new Elasticsearch plugin with endpoint e.g. /_pql is installed. I'm developing a new kibana plugin, How to send a request to this url through kibana
I have tried:
init: function (server) {
server.route({
method: ['POST', 'GET'],
path: '/api/_pql',
handler: async (request, reply) => {
console.log(request);
const { callWithRequest } = server.plugins.elasticsearch.getCluster('admin');
return callWithRequest(request, '/_pql', {"quey:":"example'"})
.then(function (resp) {
reply(response);
});
}
});
},
and I'm getting
server error [09:14:58.081] [warning][process] Error: called with an invalid endpoint: /_pql
at callAPI