List of available endpoints/params when using callWithRequest method

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.

Hey @alah64,

You can checkout the API reference here for the list of available endpoints/params: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html

That's what I wanted.
Thankful

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.