Files
kiddo/docs/_archive/update-api.md

1.5 KiB
Raw Blame History

ID: DOC_000006 | Version: 0.2.1 | Status: Draft Archived – superseded by new documentation. By: Codex (GPT-5)

Update API (Kiddo Backend)

Purpose

Definiert interne API-Endpunkte fuer Update-Status, Check, Apply, Rollback und Logs.

Endpoints

POST /update/enroll

Body (optional):

{ "enroll_token": "<one-time-token>" }

Antwort:

{ "enrolled": true, "message": "Enrollment successful" }

GET /update/status

Antwort:

{
  "current_version": "0.1.2",
  "last_status": "success|failed|unknown",
  "last_error": "<optional>",
  "last_timestamp": "2025-12-28T12:34:56Z",
  "enrolled": true
}

POST /update/check

Antwort:

{
  "available": true,
  "latest_version": "0.1.3",
  "artifact_url": "https://update.wlkns.org/kiddo/kiddo-0.1.3.tar.gz",
  "sha256": "<hex>",
  "message": "<optional>"
}

POST /update/apply

Body (optional):

{ "version": "0.1.3" }

Antwort:

{ "started": true, "message": "update started" }

POST /update/rollback

Antwort:

{ "started": true, "message": "rollback started" }

GET /update/logs

Antwort:

[
  {
    "timestamp": "2025-12-28T12:34:56Z",
    "status": "success",
    "message": "updated to 0.1.2",
    "version": "0.1.2",
    "device_id": "kiddo-001",
    "error": null
  }
]

Notes

  • Alle Endpunkte erfordern Auth (Session-Cookie oder Authorization: Bearer <token>).
  • Apply/Rollback starten async; UI pollt /update/status.
  • /update/enroll speichert das Update-Token lokal (siehe SKD_UPDATE_TOKEN_FILE).