hello.
i wrote kibana plugin and i want to use callWithRequest method and communicate with elastic , where can i find the list of available endpoints/params ?
my code sample:
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
server.route({
path: '/api/myplugin/search',
method: 'POST',
async handler(req,res) {
....
return callWithRequest(req, 'search', {
//SearchParams
index: ....,
q:....
}).finally(r => res.response(r));
}
});
or like this :
server.route({
path: '/api/myplugin/post',
method: 'POST',
async handler(req,res) {
return callWithRequest(req, 'index', {
// IndexDocumentParams
}).finally(r => res.response(r));
}
});
thanks.