Files
kiddo/docs/_archive/update-api.md
2026-01-15 17:52:21 +01:00

81 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ID: DOC_000006 | Version: 0.2.3 | 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):
```json
{ "enroll_token": "<one-time-token>" }
```
Antwort:
```json
{ "enrolled": true, "message": "Enrollment successful" }
```
### GET /update/status
Antwort:
```json
{
"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:
```json
{
"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):
```json
{ "version": "0.1.3" }
```
Antwort:
```json
{ "started": true, "message": "update started" }
```
### POST /update/rollback
Antwort:
```json
{ "started": true, "message": "rollback started" }
```
### GET /update/logs
Antwort:
```json
[
{
"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`).