Example #1
0
    def compact_bucket(self, bucket="default"):
        api = self.baseUrl + 'pools/default/buckets/{0}/controller/compactBucket'.format(bucket)
        status, content, header = self._http_request(api, 'POST')
        if status:
            log.info('bucket compaction successful')
        else:
            raise BucketCompactionException(bucket)

        return True
Example #2
0
 def cancel_bucket_compaction(self, bucket="default"):
     self.log.debug("Stopping bucket compaction for '%s'" % bucket)
     api = self.baseUrl \
           + 'pools/default/buckets/{0}/controller/cancelBucketCompaction' \
             .format(bucket)
     status, _, _ = self._http_request(api, 'POST')
     if status:
         self.log.debug('Cancel bucket compaction successful')
     else:
         raise BucketCompactionException(bucket)
     return True
 def cancel_bucket_compaction(self, bucket="default"):
     api = self.baseUrl \
           + 'pools/default/buckets/{0}/controller/cancelBucketCompaction' \
             .format(bucket)
     status, _, _ = self._http_request(api, 'POST')
     self.log.info("Status is {0}".format(status))
     if status:
         self.log.info('Cancel bucket compaction successful')
     else:
         raise BucketCompactionException(bucket)
     return True
Example #4
0
 def cancel_bucket_compaction(self, bucket="default"):
     api = self.baseUrl + 'pools/default/buckets/{0}/controller/cancelBucketCompaction'.format(bucket)
     if isinstance(bucket, Bucket):
         api = self.baseUrl + 'pools/default/buckets/{0}/controller/cancelBucketCompaction'.format(bucket.name)
     status, content, header = self._http_request(api, 'POST')
     log.info("Status is {0}".format(status))
     if status:
         log.info('Cancel bucket compaction successful')
     else:
         raise BucketCompactionException(bucket)
     return True
    def compact_bucket(self, bucket="default"):
        self.log.debug("Triggering bucket compaction for '%s'" % bucket)
        api = self.baseUrl \
              + 'pools/default/buckets/{0}/controller/compactBucket' \
                .format(urllib.quote_plus("%s" % bucket))
        status, _, _ = self._http_request(api, 'POST')
        if status:
            self.log.debug('Bucket compaction successful')
        else:
            raise BucketCompactionException(bucket)

        return True