This operation is data destructive. The service makes no
attempt to confirm or double check the request. Client
applications using this are advised to double check with the
end user before sending such a request. You can control and
limit the ability to flush individual buckets by setting the
flushEnabled parameter on a bucket in
Couchbase Web Console or via cbepctl
flush_param.
For information about changing this setting in the Web Console, see Section 6.3, “Viewing Data Buckets”. For information about flushing data buckets via REST, see Section 8.6.12, “Flushing a Bucket”.
The doFlush operation empties the contents of
the specified bucket, deleting all stored data. The operation
will only succeed if flush is enabled on configured bucket. The
format of the request is the URL of the REST endpoint using the
POST HTTP operation:
http://localhost:8091/pools/default/buckets/default/controller/doFlushFor example, using curl:
shell> curl -X POST 'http://Administrator:Password@localhost:8091/pools/default/buckets/default/controller/doFlush'The equivalent HTTP protocol request:
POST /pools/default/buckets/default/controller/doFlush Host: localhost:8091 Authorization: Basic xxxxxxxxxxxxxxxxxxx
Parameters and payload data are ignored, but the request must including the authorization header if the system has been secured.
If flushing is disable for the specified bucket, a 400 response will be returned with the bucket status:
{"_":"Flush is disabled for the bucket"}
If the flush is successful, the HTTP response code is
200:
HTTP/1.1 200 OKThe flush request may lead to significant disk activity as the data in the bucket is deleted from the database. The high disk utilization may affect the performance of your server until the data has been successfully deleted.
Also note that the flush request is not transmitted over XDCR replication configurations; the remote bucket will not be flushed.
Couchbase Server will return a HTTP 404 response if the URI is invalid or if it does not correspond to an active bucket in the system.
404 Not FoundYou can configure whether flush is enabled for a bucket by configuring the individual bucket properties, either the REST API (see Section 8.6.7, “Modifying Bucket Parameters”), or through the Admin Console (see Section 6.3.1, “Creating and Editing Data Buckets”).