Referencia SDK

KVNode incluye un SDK local Python configservice en kvnode/sdk/python/configservice.py. Usa la misma API REST /v1/collections... y el stream de replicacion del servicio.

Paquete

Lenguaje Paquete Notas
Python ConfigServiceClient de kvnode/sdk/python/configservice.py Paquete local del repositorio, no paquete externo publicado

Conexion

1from configservice import ConfigServiceClient
2
3client = ConfigServiceClient(
4    base_url="https://api.hola.cloud",
5    mode="http",
6    node="sdk-python",
7)

Operaciones

1out = client.set("my-collection", "user:alice", {"role": "admin"})
2# {"ok": true, "seq": 1, "version": 1}
3
4entry = client.get("my-collection", "user:alice")
5keys = client.list_keys("my-collection", prefix="user:", limit=100)
6# {"items": [...], "next": "..."}
7
8out = client.delete("my-collection", "user:alice")
9# {"ok": true, "seq": 2, "version": 2}

Sincronizacion

sync lee POST /v1/replicate como NDJSON y aplica comandos en mayusculas como SET, DELETE, BASELINE_BEGIN y BASELINE_END.

Autenticacion

El servicio acepta solicitudes si esta presente X-Glue-Authentication o si estan presentes apikey y secret. Si faltan los headers de autenticacion devuelve 403 forbidden.

Comentarios

Deja un comentario