61 lines
1.1 KiB
Markdown
61 lines
1.1 KiB
Markdown
ID: DOC_000006 | Version: 0.1.0 | Status: Draft
|
|
By: Codex (GPT-5)
|
|
|
|
# Update API (Kiddo Backend)
|
|
|
|
## Purpose
|
|
Definiert interne API-Endpunkte fuer Update-Status, Check, Apply, Rollback und Logs.
|
|
|
|
## Endpoints
|
|
|
|
### 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"
|
|
}
|
|
```
|
|
|
|
### 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"}
|
|
]
|
|
```
|
|
|
|
## Notes
|
|
- Alle Endpunkte erfordern Auth (Session/Bearer).
|
|
- Apply/Rollback starten async; UI pollt /update/status.
|