tams-server — API & Store
tams-server — API & Store
Section titled “tams-server — API & Store”The hub everything else talks to: a REST API that stores the metadata (what sources, flows, and segments exist) and hands out signed URLs to the media objects in object storage. It implements the BBC/AMWA TAMS specification.
- Language: Rust (Axum + sqlx, MySQL) · Default port:
4010 - API docs:
http://<host>:4010/docs(OpenAPI/Swagger)
Configuration (environment)
Section titled “Configuration (environment)”- Database (required):
DB_HOST,DB_PORT(3306),DB_USER(openapi_server),DB_PASSWORD,DB_NAME, plusDB_POOL_SIZE/DB_MAX_OVERFLOWtuning. - Authentication:
SECURITY_PROVIDER(keycloak/basic/noop) and, for Keycloak,KEYCLOAK_SERVER_URL/_REALM/_CLIENT_ID/_CLIENT_SECRET(KEYCLOAK_VERIFY_SSL=falsefor self-signed). - Object storage:
STORAGE_TYPE(noop/minio/s3),STORAGE_ENDPOINT,STORAGE_ACCESS_KEY/_SECRET_KEY,STORAGE_BUCKET(tams),STORAGE_REGION/STORAGE_SECURE. - Server:
PORT(4010),RUST_LOG(info),OTEL_EXPORTER_OTLP_ENDPOINT(optional tracing).
The API
Section titled “The API”~83 endpoints (see Swagger for the authoritative list):
| Group | Covers |
|---|---|
/service | service info / capabilities, /service/webhooks |
/sources | source CRUD, properties, collections |
/flows | flow CRUD, properties, tags, collections |
/flows/{id}/segments | list / add / delete flow segments |
/flows/{id}/storage | allocate storage → signed PUT URLs |
/flow-delete-requests | async deletion tracking |
/objects | media object metadata / instances |
Time ranges use the seconds:nanoseconds bracket notation from the
TAMS overview. Playback segments carry get_urls (signed downloads).
Build & notes
Section titled “Build & notes”./phrame-make.sh <TAG> build-image (or cargo build --release). Migrations in
migrations/ run on startup (sqlx migrate … to manage manually). Stack:
axum, tokio, sqlx (async MySQL), utoipa (OpenAPI), rust-s3,
jsonwebtoken, OpenTelemetry. Storage and auth are trait-based
(ObjectStorage, AuthProvider) with S3-compatible and no-op implementations.
