Self-service — catalogs and runtime overrides¶
Goal: operators and administrators can add new cloud endpoints, sites / factories, cabinet variants, and adjust line parameters without code changes and without a service restart.
Related docs: ARCHITECTURE.ru.md §17,
API_REFERENCE.md, ROLLOUT.md.
Architecture¶
Three configuration layers merge at runtime:
- Base
edge-service.yaml— shipping defaults, read once at start. - Overrides in the
configtable with prefixl2.override.— everything the admin / operator changes over REST. - Catalogs hosted on the factory server — fleet-wide lists of cloud endpoints, sites and cabinet variants.
Precedence: base YAML → runtime overrides → explicit catalog selection. The last step wins for fields set on both sides.
Factory-side catalogs¶
Hosted on the factory server, exposed as three REST resources under
/api/v1/catalog/.
| Resource | Key fields |
|---|---|
cloud-endpoints |
id (snake_case), displayName/displayNameRu, baseUrl (ends /), isProduction, active |
sites |
code (2-16 chars, uppercased), name/nameRu, region, timezone, factoryServerHost, contact, active |
variants |
code, name/nameRu, requiresUps, requiresPlcCabinet, colorHex, active |
Reads are public so edge devices can populate dropdowns without
credentials. Writes require the ADMIN or MANAGER JWT role.
REST¶
GET /api/v1/catalog/cloud-endpoints
POST /api/v1/catalog/cloud-endpoints # upsert
DELETE /api/v1/catalog/cloud-endpoints/{id}
GET /api/v1/catalog/sites
POST /api/v1/catalog/sites
DELETE /api/v1/catalog/sites/{code}
GET /api/v1/catalog/variants
POST /api/v1/catalog/variants
DELETE /api/v1/catalog/variants/{code}
Validation:
cloud_endpoints.idmatches^[a-z0-9_\-]{2,64}$.baseUrlstarts withhttp(s)://and ends with/.sites.codeandline_variants.codematch^[A-Za-z0-9_\-]{2,16}$.
Edge-side runtime overrides¶
Stored in the existing config table under keys prefixed
l2.override.. Served by ConfigOverridesService.
GET /api/v1/config # snapshot of current overrides
PUT /api/v1/config # { set: {…}, unset: [...], actor }
DELETE /api/v1/config # drop all overrides
POST /api/v1/config/reload # re-read DB, re-apply drivers
Key convention:
| Key | Value |
|---|---|
line.variant |
Variant code (DRY / WET / custom) |
line.site |
Site code |
line.plcVisualisationUrl |
Iframe URL for the PLC HMI |
cloud.endpointId |
A cloud_endpoints.id |
scanners |
JSON array of ScannerConfig |
printers |
JSON array of PrinterConfig |
plcs |
JSON array of PlcConfig |
batchAccounting.enabled |
true / false |
POST /config/reload after updating scanners / printers / plcs
atomically rebuilds the corresponding managers without restarting the
JVM. All other keys take effect on the next boot.
Device metadata catalog¶
/api/v1/catalog/scanners, /catalog/printers, /catalog/plc-protocols
expose the per-model parameter schema so the UI can render typed forms
dynamically. Adding a new printer driver requires nothing but a new
entry in DeviceCatalogService — no frontend change is needed.
UI¶
Management dashboard — Catalogs¶
New /catalogs page under the Settings navigation group. Three tabs:
- Cloud — CRUD cloud endpoints (picker fallback for all terminals).
- Sites — CRUD sites / factories.
- Variants — CRUD cabinet variants (DRY / WET / HYBRID / …).
Changes propagate to every terminal on its next poll (60s by default).
Operator terminal — L2 Settings → Other¶
Three sections inside the "Other" tab:
- Line parameters —
Cabinet variantandSitedropdowns populated from the factory catalogs, plusPLC visualisation URLtext input. - Cloud integration — cloud endpoint picker from
cloud_endpoints. - Configuration overrides — live table of every
l2.override.*key in theconfigtable, with per-key delete,Reload, andClear allbuttons.
Edits are sent to PUT /api/v1/config as soon as an input loses focus,
so values survive restarts automatically.
Playbooks¶
Onboard a new factory¶
- Sign in to the management dashboard with the
ADMINrole. - Catalogs → Sites → Add site.
- Fill
code,name,nameRu,timezone,factoryServerHost(optional). - Save.
- On each cabinet at the new site: Terminal → L2 Settings → Other →
Site → pick the code → click Reload. The choice is persisted
in
l2.override.line.site. - Optionally mass-push the override via
POST /api/v1/devices/{id}/config.
Add a new cloud environment (e.g. a staging subdomain)¶
- Catalogs → Cloud → Add with a unique
id,baseUrlending in/api/v1/, andisProductionflag. - Pickers on every terminal refresh automatically.
Introduce a new cabinet variant (e.g. HYBRID)¶
- Catalogs → Variants → Add, set
requiresUps/requiresPlcCabinet. - Fleet filters and the terminal's variant dropdown will show it.
Change the scanner list on a live line¶
- Terminal → L2 Settings → Scanners, edit rows, Save.
PUT /api/v1/scannersrebuilds theScannerManageron the spot and persists the whole list tol2.override.scanners— so the change survives a reboot.- To reset to the YAML defaults: L2 Settings → Other → Clear all.
Audit trail¶
- Catalog mutations are recorded in the factory server
audit_logtable (actor,action,entity_type,entity_id,timestamp). - Edge-side override updates are logged by
ConfigOverridesServiceatINFOlevel (Config override updated: <key> by <actor>) and forwarded to theeventsjournal (SYSTEMcategory) whenEventServiceis wired.
Last updated: April 2026.