add server api handlers. Fix bug with cmd output
This commit is contained in:
@@ -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
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user