LinkO'Star

Data Pipelines (V16 — endpoint catalog)

A pipeline routes windowed BLE events through optional filter/aggregate/threshold rules and forwards the result to one or more endpoints. V16 introduces a named endpoint catalog per pipeline; the rules' forward op picks which endpoint key gets each payload. The reserved linkostar key resolves to the LinkOStar backend windowed endpoint, so suppliers can mirror events back without configuring our URL.

Endpoint shape

{
  "primary":  { "url": "https://...", "query": { "apiKey": "..." },
                 "headers": { "Authorization": "..." },
                 "signing_secret_b64": "<base64>" },
  "linkostar": { "builtin": "linkostar" }
}

forward op

{ "op": "forward", "endpoint": "primary" }
{ "op": "forward", "endpoint": "linkostar",
  "when": { "field": "alert", "eq": "FIRE" } }

Multiple forward ops fan out to multiple endpoints. If the chain never reaches a forward (or none of the whens match) the event is dropped.

Quick start

{
  "endpointsJson": {
    "primary":  { "url": "https://api.example.com/ingest",
                   "query": { "apiKey": "secret" } },
    "linkostar": { "builtin": "linkostar" }
  },
  "pipelineRulesJson": [
    { "op": "filter", "field": "deviceName", "eq": "Temp Sensor" },
    { "op": "round", "field": "temperature", "decimals": 1 },
    { "op": "forward", "endpoint": "primary" },
    { "op": "threshold", "field": "temperature", "gte": 70,
      "then": { "alert": "FIRE" } },
    { "op": "forward", "endpoint": "linkostar",
      "when": { "field": "alert", "eq": "FIRE" } }
  ]
}

Body shape

POST <endpoint.url>?<endpoint.query>
Content-Type: application/json
X-Signature-HMAC-SHA256: <hex>

{
  "_hubUuid": "...", "_windowStart": "ISO-8601", "_windowEnd": "ISO-8601",
  "_eventCount": 7,
  "deviceName": "Temp Sensor", "bdAddr": "C1:9F:...", "identity": "258:772",
  "temperature": 23, "rssi": -72, "alert": "FIRE"   // rules 결과
}

Debugging

  • Nothing arrives — scan-config response's pipelines count.
  • endpoint not defined — agent log forward target endpoint not defined.
  • HMAC mismatch — sign the raw body bytes, never reparse.
  • Duplicate delivery — use _hubUuid + _windowStart + _windowEnd as idempotency key.

Legacy model (deprecated)

Pre-V16 used pipeline_layer ∈ {HUB, SERVER} with a singledestinationUrl or directDeliveryUrl. Kept compatible for one release window; new pipelines should use endpoints + forward only.