Skip to content

Commit

Permalink
Add list-buckets API info to REST API.
Browse files Browse the repository at this point in the history
  • Loading branch information
seancribbs committed Jan 3, 2011
1 parent ce83d16 commit 58c3bb8
Showing 1 changed file with 40 additions and 3 deletions.
43 changes: 40 additions & 3 deletions pages/REST-API.textile
Expand Up @@ -7,8 +7,6 @@ This is an overview of the operations you can perform over the HTTP interface to

<div class="note"><div class="title">URL Escaping</div>Buckets, keys, and link specifications may not contain unescaped slashes. Use a URL-escaping library or replace slashes with %2F.</div>



<div id="toc"></div>


Expand All @@ -20,6 +18,46 @@ Buckets in Riak are a virtual concept. They exist primarily as a namespace mecha
<div class="note"><div class="title">Delete Buckets</div>At the moment there is no straightforward way to delete an entire Bucket. There is, however, an open ticket for the feature. To delete all the keys in a bucket, you'll need to delete them all individually.</div>


h3. List buckets

Lists all known buckets (ones that have keys stored in them). *This feature is new in Riak 0.14.*

<div class="note"><div class="title">Not for production use</div>Similar to the list keys operation, this requires traversing all keys stored in the cluster and should not be used in production.</div>

h4. Request

```bash
GET /riak?buckets=true
```

Required query parameter:
* *buckets=true* - required to invoke the list-buckets functionality

h4. Response

Normal status codes:
* 200 OK

Important headers:
* Content-Type - application/json

The JSON object in the response will contain a single entry, "buckets", which will be an array of bucket names.

h4. Example

```bash
$ curl -i http://localhost:8098/riak?buckets=true
HTTP/1.1 200 OK
Vary: Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.7.3 (participate in the frantic)
Link: </riak/files>; rel="contained"
Date: Mon, 03 Jan 2011 19:21:00 GMT
Content-Type: application/json
Content-Length: 21

{"buckets":["files"]}
```

h3. Read bucket information

Reads the bucket properties and/or keys.
Expand All @@ -31,7 +69,6 @@ h4. Request
GET /riak/bucket
```


Optional query parameters:
* *props=[true|false]* - whether to return the bucket properties (true is the default)
* *keys=[true|false|stream]* - whether to return the keys stored in the bucket. (false is the default)
Expand Down

0 comments on commit 58c3bb8

Please sign in to comment.