如何使用http get获取riak中的所有桶类型

时间:2016-02-22 10:54:26

标签: riak riak-2i

我知道如何使用命令行列出所有存储桶类型。参考http://stackoverflow.com/questions/30785431/how-to-list-all-the-bucket-types-in-riak

但我需要使用HTTP调用

1 个答案:

答案 0 :(得分:1)

目前无法通过HTTP列出存储桶类型。我可以提出两个选择:

  1. riak-admin bucket-types list命令包装在一个简单的Web服务中,并通过HTTP公开。
  2. 安装实验Riak Explorer,将其指向您的群集,然后使用 bucket_types 端点列出存储桶类型。例如,curl -X GET http://127.0.0.1:9000/explore/clusters/default/bucket_types应该为您提供类似
  3. 的内容
    {
        "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"
        }
    }
    
相关问题