Another way to administrate Couchbase clusters is by using the REST API. It provides all the features we have discussed in the web console. In fact, the REST API is being used behind the scenes for most of the options displayed in the web console. You can perform all administrative functionalities using the REST API too.
You need some REST API tools to use this feature. In our case, we will use curl
. It can be downloaded and installed from http://curl.haxx.se/download.html.
We will see an example as follows. You can refer the Couchbase documentation for comprehensive details on the REST API usages and syntax:
curl -u Administrator:root123 http://localhost:8091/pools/default
This command provides cluster details in a JSON document.
You can get information about a specific bucket that is LearningCouchbase
using the following command:
curl -u Administrator:root123 http://localhost:8091/pools/default/buckets/LearningCouchbase
You need to pass...