kragniz / kragniz/python-etcd3
KV metadata in API
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 450
- Fork
- 194
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
The current KV api is nice and simple for getting values:
>>> etcd.get("/key")
b"some-value"
It doesn't allow for retrieving the metadata about keys, however.
We need to figure out a nice api for showing all the data: key, create_revision, mod_revision, version, value, lease.
How other projects do it:
python-etcd
python-etcd returns an object for all reads containing a .value attribute to read the actual value:
client.read('/nodes/n2').value
#recursively read a directory
r = client.read('/nodes', recursive=True, sorted=True)
for child in r.children:
print("%s: %s" % (child.key,child.value))
kazoo (zookeeper)
kazoo returns two values, the data and the node information:
data, stat = zk.get("/my/favorite")
print("Version: %s, data: %s" % (stat.version, data.decode("utf-8")))
python-consul
python-consul is pretty ugly:
index, data = consul.Consul().kv.get('foo', index=index)
print data['Value']
data is a dict that looks like:
{
"CreateIndex": 100,
"ModifyIndex": 200,
"LockIndex": 200,
"Key": "foo",
"Flags": 0,
"Value": "bar",
"Session": "adf4238a-882b-9ddc-4a9d-5b6758e4159e"
}
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non viene indicato alcun file sorgente né alcun test. Inizia individuando l’API Python KV get attuale e confronta il suo valore restituito con i campi dei metadati elencati nell’issue; il lavoro è terminato quando un’API concordata espone key, create_revision, mod_revision, version, value e lease.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- api
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100