feat: add graceful shutdown endpoint for UVM API server and update documentation

This commit is contained in:
2026-09-23 06:30:58 +05:30
parent 0f72ac693a
commit eb6119c797
7 changed files with 119 additions and 9 deletions
+13
View File
@@ -303,6 +303,7 @@ The server exposes these routes:
| `GET` | `/` | Redirect to the local dashboard |
| `GET` | `/dashboard` | Serve the local management dashboard |
| `GET` | `/health` | Unauthenticated liveness response |
| `POST` | `/exit` | Gracefully stop the UVM API server |
| `GET` | `/diagnostics` | Run host readiness checks for the dashboard/system view |
| `POST` | `/install` | Install or refresh host assets; body: `{ "force": false }` |
| `GET` | `/vms` | List VM records and observed status |
@@ -364,6 +365,18 @@ curl \
http://127.0.0.1:8000/vms
```
Stop the API server without stopping its managed VMs:
```sh
curl -X POST \
-H "X-UVM-Token: $UVM_API_TOKEN" \
http://127.0.0.1:8000/exit
```
The endpoint returns `202 {"status":"stopping"}` and then gracefully terminates
the UVM API process. It is a protected management endpoint; it does not stop or
delete managed VMs.
Do not expose this server directly to an untrusted network. For remote access,
keep TLS enabled and consider placing it behind an additional authenticated
reverse proxy.