Is there possibility to read/set Auto-Compaction setting through Python SDK or N1QL?
If Yes, Please share me the steps.
Actually I am using below code snippet to get all buckets information. Here I’m unable to get Auto-Compaction settings and documents count per a bucket. Kindly help me ASAP.
bucket_manager = client.buckets() result = list(bucket_manager.get_all_buckets())
Thank you very much @nithishr for your suggestions.
Actually I have tried lot to make RESTful API calls to Couchbase on Capella. But I have not yet succeeded.
Could you please suggest me how to make REST API calls (especially for GET pools/default/buckets) to Couchbase Server which is in Capella?
NOTE: I will be more happy, if SDK handles all bucket properties(including Auto-Compaction Setting) which are shown in the bucket property editor on Couchbase console at least in up coming versions.
Thanks for the feedback regarding the SDK support for the management APIs. I would suggest creating an issue on the Python project as suggested by Perry so that it can be considered for future development.
I did not realize that you were on Capella. On Capella, we do have some restrictions on the Couchbase Server REST APIs (mainly due to the nature of managed services). Some of the endpoints requiring Admin privileges will not work. In some cases, it would be possible for them to be changed on a cluster by contacting the Support in Capella.
I can give you a general way to connect to the Couchbase Server running in Capella.
Once you have that, you should be able to connect to the allowed REST APIs using port 18091 on the host. Note that you might have to pass in the certificate downloaded from the UI or ignore the certificate validation.
You can send your REST API requests to :18091
Here is an example of the pools/default/buckets endpoint that you wanted using curl. You can achieve the same in any language of your choice.
curl -k -u <db-username>:<password> -X GET https://<hostname>:18091/pools/default/buckets/
Note that I have ignored the validation of the certificate for simplicity.
Thank you very much @nithishr for your valuable information.
In my application, we are using Python 3.11.x. With this I am unable to disable SSL certificate validation.
If possible, Could you please suggest me how to make a RESTful api request along with ssl certificate. I have downloaded certificate from Capella.
I am very sorry for this kind of question. I am expecting help, since I am very new to SSL.
I need to check how to pass the certificate from Capella. If you want a faster response to that problem, it would be easiest to contact support via Capella.
To disable the certificate validation in the requests library in Python, you can pass a parameter, verify as False to the request.
For example, this is something you can do in Python using the requests library