Creating a bucket with all the settings input

Hi All,
My question is like,
How can I create the bucket with all the settings like Bucket Name, Type, Flush, Minimum Durability Level, Bucket Priority, Ejection Method, Replicas and Memory Quota.

the data like this,
bucket_data = {
“name”: bucket_name,
“bucketType”: bucket_type,
“ramQuotaMB”: ram,
‘flushEnabled’: 1,
‘durabilityMinLevel’: ‘persistToMajority’,
}
def create_bucket(self, bucket_data):
url = f’http://{self.ip_address}:{self.port_rest_api}/pools/default/buckets’
self._http_request(“POST”, url, data=bucket_data, auth=(self.username, self.password))
return “success”
If I send like this, it is showing an 400 bad request error

The documentation for the REST API can be found at Create a Bucket | Couchbase Docs

Alternatively, ou can use the BucketManager of the Couchbase SDK.

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