Files
cloudlysis/docs/usage/api.md
Vlad Durnea e9a0142396
Some checks failed
ci / ui (push) Failing after 28s
images / build-and-push (push) Failing after 19s
ci / rust (push) Failing after 2m26s
docs: add docs folder (architecture, developer, usage); update README; wire probe TTL cache + concurrency notes into docs
2026-03-30 14:32:47 +03:00

1.2 KiB

Usage: API Examples

Projection Query via Gateway (HTTP → gRPC)

curl -sS -X POST \
  -H "x-tenant-id: tenant-a" \
  -H "x-correlation-id: demo" \
  -H "traceparent: 00-00000000000000000000000000000001-0000000000000001-01" \
  http://localhost:8080/v1/query/User \
  -d '{"uqf":"{\"eq\":{\"id\":\"u1\"}}"}'

Projection Query via gRPC (direct, internal)

grpcurl -d '{"tenant_id":"tenant-a","view_type":"User","uqf":"{}"}' \
  -H 'x-tenant-id: tenant-a' \
  -H 'x-correlation-id: demo' \
  -H 'traceparent: 00-00000000000000000000000000000001-0000000000000001-01' \
  -plaintext localhost:9090 projection.gateway.v1.QueryService/ExecuteQuery

Aggregate Command via Gateway (HTTP → gRPC)

curl -sS -X POST \
  -H "x-tenant-id: tenant-a" \
  -H "x-correlation-id: demo" \
  -H "traceparent: 00-00000000000000000000000000000001-0000000000000001-01" \
  http://localhost:8080/v1/aggregate/BankAccount/command \
  -d '{"id":"acc-1","command_type":"Open","payload":{"owner":"Alice"}}'

Runner Admin via Gateway (HTTP → gRPC)

curl -sS -X POST \
  -H "x-tenant-id: tenant-a" \
  -H "authorization: Bearer <token>" \
  http://localhost:8080/admin/runner/drain?wait_ms=0