Product tutorials, how-tos, and fully-documented APIs.

HTTP Bucket Properties

    Sets bucket properties like “n_val” and “allow_mult”.

    Request

    PUT /riak/bucket                # Old format
    PUT /buckets/bucket/props       # New format
    

    Important headers:

    The body of the request should be a JSON object with a single entry “props”. Unmodified bucket properties may be omitted.

    Available properties:

    Other properties do exist but are not commonly modified.

    Property types

    Make sure you use the proper types for attributes like n_val and allow_mult. If you use strings instead of integers and booleans respectively, you may see some odd errors in your logs, saying something like "{badarith,[{riak_kv_util,normalize_rw_value,2},]}".

    Response

    Normal status codes:

    Typical error codes:

    If successful, no content will be returned in the response body.

    Example

    $ curl -v -XPUT -H "Content-Type: application/json" -d '{"props":{"n_val":5}}'
    http://127.0.0.1:8098/riak/test
    * About to connect() to 127.0.0.1 port 8098 (#0)
    *   Trying 127.0.0.1... connected
    * Connected to 127.0.0.1 (127.0.0.1) port 8098 (#0)
    > PUT /riak/test HTTP/1.1
    > User-Agent: curl/7.19.4 (universal-apple-darwin10.0) libcurl/7.19.4
    OpenSSL/0.9.8l zlib/1.2.3
    > Host: 127.0.0.1:8098
    > Accept: */*
    > Content-Type: application/json
    > Content-Length: 21
    >
    < HTTP/1.1 204 No Content
    < Vary: Accept-Encoding
    < Server: MochiWeb/1.1 WebMachine/1.9.0 (participate in the frantic)
    < Date: Fri, 30 Sep 2011 15:24:35 GMT
    < Content-Type: application/json
    < Content-Length: 0
    <
    * Connection #0 to host 127.0.0.1 left intact
    * Closing connection #0