kragniz / kragniz/python-etcd3
KV metadata in API
- Vorherrschende Sprache
- Python
- Sterne
- 450
- Forks
- 194
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
The current KV api is nice and simple for getting values:
```python
>>> 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:
```python
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:
```python
data, stat = zk.get("/my/favorite")
print("Version: %s, data: %s" % (stat.version, data.decode("utf-8")))
```
python-consul
-------------------
python-consul is pretty ugly:
```python
index, data = consul.Consul().kv.get('foo', index=index)
print data['Value']
```
data is a dict that looks like:
```python
{
"CreateIndex": 100,
"ModifyIndex": 200,
"LockIndex": 200,
"Key": "foo",
"Flags": 0,
"Value": "bar",
"Session": "adf4238a-882b-9ddc-4a9d-5b6758e4159e"
}
```
Beitragsleitfaden
Rechercherichtung
Keine Quelldatei oder kein Test wird genannt. Beginne damit, die aktuelle Python-KV-get-API zu finden, und vergleiche ihren Rückgabewert mit den im Issue aufgeführten Metadatenfeldern; fertig ist die Aufgabe, wenn eine vereinbarte API key, create_revision, mod_revision, version, value und lease bereitstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100