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

how to get all bucket types in riak using http get

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

但我需要使用 HTTP 调用

目前无法通过 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 应该给你
{
    "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"
    }
}