-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the API to get all the keys (not values) in etcd3? #362
Comments
/cc @kragniz |
/cc @kragniz any thoughts? |
There isn't a method to do this, but you can get all and extract only the keys: >>> c = etcd3.client()
>>> [m.key for (_, m) in c.get_all()]
[b'/bar', b'/baz', b'/foo', b'/qux'] |
Maybe a utility function for this would be useful, if you'd like to submit a pr |
Thanks @kragniz, that works!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
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
?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
usingetcdctl
the following way:But, I wasn't able to find the python API to do the above. Let me know if I'm missing anything.
The text was updated successfully, but these errors were encountered: