Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-346

flush_enabled param is ignored when creating a bucket via the admin API

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 2.1.0
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            matt.carabine Matt Carabine (Inactive)
            matt.carabine Matt Carabine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty