I’m trying to simply create a bucket via python SDK ,
far as i search couldn’t find a working example ,
even on SDK documentation page i could find it:
https://docs.couchbase.com/sdk-api/couchbase-python-client/api/couchbase.html#module-couchbase.bucket
Im sure this is the wrong way -
as ‘Cluster’ object has no attribute ‘bucket_create’
but i couldn’t find something else:
def _ConnectToBucket(self):
try:
bucket = self.curr_con.bucket(self.BUCKET_TARGET)
print("bucket exist")
except Exception as e:
test= self.curr_con.bucket_create('new-bucket-name', bucket_type = 'couchbase', ram_quota=994)
print("here" ,test)
getting:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./main.py", line 74, in <module>
main()
File "./main.py", line 47, in main
name,uuid = obj._CheckRefernece()
File "/xs/mig1/aaa/xdcr_lib.py", line 38, in _CheckRefernece
File "/xs/mig1/aaa/xdcr_lib.py", line 97, in _ConnectToBucket
AttributeError: 'Cluster' object has no attribute 'bucket_create'