How to call lock APIs using call with request

Hello Team,
Could you please help me understand how can we call lock create/ delete APIs using callwithrequest.
For example
PUT /FS/lock/<index_name>/_create

DELETE /FS/lock/<index_name>/

I'm referring to the Solving Concurrency Issues

Thanks for your help and support.

Thank you,
Aditya

This is more of a Elasticsearch question. What is your exact question ?
Instead of locking the whole filesystem, we could lock individual documents by using the same technique. Am moving this to ES forum so that folks from that team can give you more detailed answer.

Thanks
Rashmi

Hello Rashmi,

I want to lock index and I got the APIs to achieve that, the problem I am facing here is I am using callwithrequest client in Kibana custom visualisation, so just wanted to understand how can we execute these APIs from JavaScript using callwithrequest client.

Kibana version : 6.7
Moving it back to Kibana.

Thank you,
Aditya

You could try using transport.request, which allows you full control over the URL, query, and params:

      return callWithRequest(req, 'transport.request', {
        path: '/lock/{index}/_create',
        method: 'PUT',
        query,
        body
      });