2.1 KiB
2.1 KiB
API Surface
Health
GET /health
Registry
GET /assetsPOST /assetsGET /registry/assets/{id}PUT /registry/assets/{id}DELETE /registry/assets/{id}GET /componentsPOST /componentsGET /registry/components/{id}PUT /registry/components/{id}
Registry invariants:
- Assets do not carry
project_idin request/response contracts.
Ingest
POST /ingest/hardwarePOST /ingest/manual/csvGET /ingest/manual/csv/jobs/{id}
Manual CSV ingest contract:
POST /ingest/manual/csvis asynchronous and returns202 Acceptedwithjob_id.- Final result is read from
GET /ingest/manual/csv/jobs/{id}.
Timeline
GET /assets/{id}/timelineGET /components/{id}/timeline
Failures
GET /failuresPOST /failures
UI Routes
GET /uiGET /ui/assetsGET /ui/assets/{id}GET /ui/componentsGET /ui/components/{id}GET /ui/failuresGET /ui/ingestGET /ui/ingest/manual-template.csv
CSV Export Contract
Route: GET /ui/ingest/manual-template.csv
Rules:
- Encoding: UTF-8.
- UTF-8 BOM is included at file start for Excel compatibility.
- Delimiter:
;. - Line endings:
\r\n. - Escaping: RFC4180-compatible (fields with
;,",\n,\rare quoted; inner"is doubled). - Header row is always present.
- Stable column order (deterministic, no map-driven order).
- Exported header order:
дата_осмотрасерийный_номер_серверавендорp/n_устройстваs/n_устройствалокейшн_в_сервереверсия_прошивкисостояние_оборудования
- Identifier-like columns are exported with Excel-safe text protection (to preserve leading zeros/codes).
- Empty values are exported as empty cells (no
null/undefined). - HTTP headers:
Content-Type: text/csv; charset=utf-8Content-Disposition: attachment; filename="manual-import-template.csv"
Routing Notes
- API router is registered in
internal/api/server.go. - Registry, ingest, failures, asset/component pages, and UI routes are attached to
http.ServeMux.