Flushing buckets
To flush all buckets, use the POST /pools/default/buckets/default/controller/doFlush HTTP method and URI.
Description
The doFlush operation empties the contents of the specified bucket, deleting all stored data. The operation only succeeds if flush is enabled on configured bucket.
Parameters and payload data are ignored, but the request must including the authorization header if the system has been secured.
Couchbase Server returns a HTTP 404 response if the URI is invalid or if it does not correspond to an active bucket in the system.
HTTP method and URI
POST /pools/default/buckets/default/controller/doFlush
Syntax
Curl request syntax:
curl -X POST -u [admin]:[password]
http://[localhost]:8091/pools/default/buckets/default/controller/doFlush
Raw HTTP request syntax:
POST /pools/default/buckets/default/controller/doFlush
Host: localhost:8091
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Example
Curl request example:
curl -X POST 'http://admin:password@localhost:8091/pools/default/buckets/default/controller/doFlush'
Raw HTTP request example:
POST /pools/default/buckets/default/controller/doFlush
Host: 10.5.2.54:8091
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Response codes
If the flush is successful, the HTTP response code is 200 is returned.
HTTP/1.1 200 OK
If flushing is disable for the specified bucket, a 400 response code is returned with the bucket status. For example:
{"_":"Flush is disabled for the bucket"}
If the bucket does not exist, a 404 response code is returned.
404 Not Found