consulconsul-kv

How do I get the same result of consul kv get -recurse with consul http api?


I want to retrieve all saved keys and values of consul servers using its http api. Or at least how to get all saved keys using http api?


Solution

  • I used python-consul library. Here's the example

    import consul
    consul_server = consul.Consul(host='127.0.0.1', port=8500)
    consul_kv = consul_server.kv.get(key='', recurse=True)