1.6 KiB
1.6 KiB
drill-cloud-v3
Lightweight Drill Cloud API for an existing PostgreSQL/TimescaleDB database.
What is intentionally absent
- No
tag-translationmodule. - No alarm log writes.
- No automatic
edgeortagupserts during ingest.
Database
Database deployment, edge registration and migrations are described in DATABASE_DEPLOYMENT.md.
The current cloud database schema uses these public tables:
edge(id, name, parent_id)tag(id, name, min, max, comment, unit_of_measurement, precision, tag_group)current(id, edge, tag, value, createdAt, updatedAt)history(edge, timestamp, tag, value, createdAt)camera(edge, protocol, source)
history is expected to be a TimescaleDB hypertable partitioned by timestamp.
API
All routes are served under the /api prefix.
GET /api/healthGET /api/edgeGET /api/tag?edge=edge5&search=pressureGET /api/current?edge=edge5&tags=tag1,tag2GET /api/history?edge=edge5&tags=tag1,tag2&from=2026-06-01T00:00:00Z&to=2026-06-02T00:00:00ZGET /api/camera?edge=edge5POST /api/ingestPOST /api/ingest/:edge
POST /api/ingest accepts one point:
{
"edge": "edge5",
"tag": "hook_weight_1",
"timestamp": "2026-06-19T00:00:00Z",
"value": 12.34
}
value may be null. In that case current is updated, but history is not.
POST /api/ingest/:edge accepts a compact edge payload:
{
"timestamp": "2026-06-19T00:00:00Z",
"values": {
"hook_weight_1": 12.34,
"rotary_rpm": 80
}
}
Local Run
npm install
cp .env.example .env
npm run start:dev
The default port is 3101.