Using > TicTac AAE Fold:
List Buckets
Returns a list of bucket names stored in Riak.
See the TicTac AAE aae_folds
documentation for configuration, tuning and troubleshootings help.
The list_buckets
function
Run this using riak attach
.
riak_client:aae_fold({
list_buckets,
assumed_nval
}, Client).
There are no available filters for this method.
assumed_nval
should ideally be set to your cluster’s default nval, but can be safely set to 1
for this purpose. Do not set it to below 1
or above your highest nval.
This will list all buckets:
riak_client:aae_fold({
list_buckets,
3
}, Client).
How to get the value for Client
is detailed in The Riak Client.
The response
The response will be an array of bucket names, or tuples of bucket types and bucket names, as Erlang binaries. It looks something like this:
{ok,[{<<"animals">>,<<"dogs">>},
<<"cars">>]}
This shows that there are two buckets:
- “dogs” of bucket type “animals”
- “cars” with no bucket type