add server api handlers. Fix bug with cmd output

This commit is contained in:
2026-06-24 13:49:12 +03:00
parent fe2db1b6e9
commit 7ebfea097d
12 changed files with 612 additions and 25 deletions
+31
View File
@@ -53,6 +53,37 @@ stays local to the client config.
- Client behavior notes: [docs/client.md](docs/client.md)
- Server behavior notes: [docs/server.md](docs/server.md)
## Server API
The server uses SQLite through SQLAlchemy by default:
```bash
NEXUS_SYNC_DATABASE_URL="sqlite:///nexus-sync.db"
```
Useful server-side handlers:
```text
POST /api/v1/client/heartbeat
GET /api/v1/server/clients
GET /api/v1/server/clients/{client_id}
POST /api/v1/server/clients/{client_id}/commands
GET /api/v1/server/commands/{command_id}
```
Queue command example:
```json
{
"name": "hostname",
"args": {},
"timeout_seconds": 30
}
```
Clients receive queued commands on their next heartbeat and report results in a
later heartbeat.
### To build
```