Skip to content

Unified API

unified-api CI License: Apache 2.0 Rust

Lightweight infrastructure inventory aggregation and caching middleware, written in Rust.

Unified API ingests inventory from sources of truth like Device42, VMware, Pure Storage, ad-hoc scripts or SSH facts, caches and enriches it in memory, and serves it over a fast REST API.

Consumers like AWX and AnsibleForms query that cache, never the sources. A hundred job runs cost Device42, VMware or Pure Storage exactly what one does, and every one of them sees the same inventory.


✨ Features

  • Pluggable sources: any executable that prints inventory JSON is a connector
  • SSH connector: gathers Ansible facts from whole fleets in parallel
  • In-memory cache with TTLs: per-dataset, per-host and per-group freshness, no database
  • Gzip responses: a client that accepts gzip transfers about a tenth of the bytes
  • Enrichers: post-process cached data on a schedule or on demand
  • Output endpoints: turn cached datasets into the format each consumer needs
  • Federation: one instance per datacenter, one central aggregating them, real ages intact
  • Views: one id over several sources, routing each host to the member that owns it
  • Scheduled + on-demand sync: interval sync per source, plus scoped sync over the API
  • Refresh: a read can bring the hosts it names up to date, bounded by the source's TTL
  • Configuration API: a pipeline pushes the config directory and reloads it live, no restart
  • Swagger UI: interactive OpenAPI docs served at /swagger-ui/
  • Single static binary: axum + tokio, hexagonal architecture, ~11k lines

📚 Documentation

Document What it covers
API All routes with authentication, status code semantics and curl examples
Architecture The four layers, the dependency rule and the concurrency model
CLI Environment variables, log tuning, health checks and common curl operations
Configuration Every YAML file field by field, env vars and startup validation
Configuration API Pushing the config directory over HTTP, validating it and reloading it live
Connectors Script contracts for connectors, enrichers and output transformers
Deployment Container image, worked config example, CI/CD, Kubernetes and ArgoCD
Enrichers Post-processing cached data: modes, triggers, freshness rules, health
Federation One instance per datacenter, one central federating them, no WAN SSH
Observability Scheduling, structured logs and the metrics worth alerting on
Output endpoints Consumer-facing transformers: contract, GET vs POST, permissions
Projects Git checkouts: sync styles, script resolution, virtualenvs, health
Refresh Bringing a named host up to date at its origin, and what bounds the cost
Secrets Credential backends, the resolution cache and rotation, native Vault
Testing Running the suite, what the tests cover, and where new ones belong
Troubleshooting Symptom first: what to check when data is stale or a read refuses
TTL The three-level freshness model, sync modes and TTL overrides
Views Several sources as one id, and how a host is routed to its owner

🤝 Contributing

Contributions are welcome: CONTRIBUTING.md covers the PR workflow, commit style, CI gates and architecture rules.

Security issues: see SECURITY.md for private reporting.


👥 Authors


⚖️ License

Apache 2.0

About

Unified API to consume sot information across organizations and enrich endpoints

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages