What is the API to get all the keys (not values) in etcd3?
See original GitHub issueThe get_all()
API returns the values of all the keys, but not the keys themselves.
After putting the following keys and values, what is the API to get a list of just the keys /foo
, /bar
, /baz
and /qux
?
>>> etcd.put("/foo", "a")
>>> etcd.put("/bar", "b")
>>> etcd.put("/baz", "c")
>>> etcd.put("/qux", "d")
I was not able to find this in the documentation in https://python-etcd3.readthedocs.io/en/latest/usage.html.
It is possible to get just the keys in etcd3
using etcdctl
the following way:
ETCDCTL_API=3 etcdctl get --prefix=true "" | grep '/'
/bar
/baz
/foo
/qux
But, I wasn’t able to find the python API to do the above. Let me know if I’m missing anything.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
etcd3 API | etcd
All Responses from etcd API have an attached response header which includes cluster ... Keys_Only - return only the keys and not the...
Read more >API Usage — python-etcd3 0.8.1 documentation
Get all keys currently stored in etcd. Returns: sequence of (value, metadata) tuples. put (key, ...
Read more >In etcd v3.0.x, how do I request all keys with a given prefix?
If the range_end is one bit larger than the given key, then the range requests get the all keys with the prefix (the...
Read more >Using etcd3 Features - Compose Help
If you are running etcd3 on your deployment, you can only use v3 of the API. The v2 API is not supported. Prefixes....
Read more >etcd3 API
etcd3 API. NOTE: this doc is not finished! Response header. All Responses from etcd API have a response header attached. The response header...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There isn’t a method to do this, but you can get all and extract only the keys:
Thanks @kragniz, that works!