Details
-
Task
-
Resolution: Fixed
-
Major
-
2.0.9
-
None
-
None
Description
When using the admin API to create a bucket, it looks like the 'flush_enabled' parameter is completely ignored, always having flush disabled upon bucket creation.
Looks like it does this via rest, so I first checked doing this via the REST API directly:
curl -X POST -u Administrator:password -d name=test -d ramQuotaMB=100 -d authType=sasl -d replicaNumber=0 -d flushEnabled=1 http://10.112.111.101:8091/pools/default/buckets
|
This appropriately created the bucket with flush enabled, so I checked out the source code for the bucket creation method and saw this:
https://github.com/couchbase/couchbase-python-client/blob/master/couchbase/admin.py#L190
params = {
|
'name': name,
|
'type': bucket_type,
|
'authType': 'sasl',
|
'saslPassword': bucket_password if bucket_password else '',
|
'flush_enabled': int(flush_enabled),
|
'ramQuotaMB': ram_quota
|
}
|
if bucket_type in ('couchbase', 'membase'):
|
params['replicaNumber'] = replicas
|
|
return self.http_request(
|
path='/pools/default/buckets', method='POST',
|
content=self._mk_formstr(params),
|
content_type='application/x-www-form-urlencoded')
|
If you compare the name of the flush_enabled parameter in the 'params' and compare it to the one used in the successful REST command, it looks like it has been misnamed and should instead be 'flushEnabled'.
Attachments
For Gerrit Dashboard: PYCBC-346 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
64274,2 | PYCBC-346: Fix flush_enabled param in 'bucket_create' | master | couchbase-python-client | Status: MERGED | +2 | +1 |