Search code examples
riakriak-2i

how to get all bucket types in riak using http get


I know how to list all bucket types using command line .reference http://stackoverflow.com/questions/30785431/how-to-list-all-the-bucket-types-in-riak

But I need it using HTTP call


Solution

  • There is currently no way to list bucket types via HTTP. I can suggest two options:

    1. Wrap the riak-admin bucket-types list command in a simple Web service and expose it via HTTP.
    2. Install the experimental Riak Explorer, point it to your cluster, and use the bucket_types endpoint to list bucket types. For example, curl -X GET http://127.0.0.1:9000/explore/clusters/default/bucket_types should give you something like
    {
        "bucket_types": [{
            "id": "default",
            "props": {
                "active": true,
                "allow_mult": true,
                "basic_quorum": false,
                "big_vclock": 50,
                "chash_keyfun": "{riak_core_util,chash_std_keyfun}",
                "dvv_enabled": false,
                "dw": "quorum",
                "last_write_wins": false,
                "linkfun": "{modfun,riak_kv_wm_link_walker,mapreduce_linkfun}",
                "n_val": 3,
                "notfound_ok": true,
                "old_vclock": 86400,
                "postcommit": [],
                "pr": 0,
                "precommit": [],
                "pw": 0,
                "r": "quorum",
                "rw": "quorum",
                "small_vclock": 50,
                "w": "quorum",
                "write_once": false,
                "young_vclock": 20
            }
        }],
        "links": {
            "self": "/explore/clusters/default/bucket_types"
        }
    }