Search code examples
pythontimeoutcouchbase

How to check and set up the Couchbase timeout using the Python SDK?


I'm searching a way how to check the current value of Couchbase cluster timeout, and how to set up a desired timeout using the Python SDK.

I know the method to set up a timeout using ClusterTimeoutOptions but it doesn't work.

There are no problems with timeouts if I disable it using couchbase-cli: couchbase-cli setting-query --set --timeout -1


Solution

  • I resolve it and it works as I expected. I converted cURL commands which I found at the Couchbase documentation website to Python's requests, and I was able to check timeout and update it.

    To check: requests.get('http://localhost:8093/admin/settings', auth=(user, password))

    To update: requests.post('http://localhost:8091/settings/querySettings', headers=headers, data=data, auth=(user, password))