This directory contains comprehensive API documentation for HyperSDK.
Total Endpoints: 51+ REST endpoints
API Version: v1
Base URL: http://localhost:8080
Format: JSON
Test Coverage: 40.8% (daemon/api package)
Currently, the API endpoints are accessible without authentication. For production deployments:
# Future: Authentication will be required
curl -H "Authorization: Bearer <token>" \
http://localhost:8080/api/v1/jobs
See Security Best Practices for credential management.
# Using binary
./hypervisord
# Using systemd
sudo systemctl start hypervisord
# Check it's running
curl http://localhost:8080/api/v1/status
# Submit single VM export
curl -X POST http://localhost:8080/api/v1/jobs/submit \
-H "Content-Type: application/json" \
-d '{
"vm_path": "/datacenter/vm/my-vm",
"output_path": "/tmp/export"
}'
# Get job status
curl http://localhost:8080/api/v1/jobs/{job_id}
# List all jobs
curl http://localhost:8080/api/v1/jobs
# Watch job progress with ETA
curl http://localhost:8080/api/v1/jobs/{job_id}/progress
# Open dashboard in browser
xdg-open http://localhost:8080/web/dashboard/
# View VM console
xdg-open http://localhost:8080/web/dashboard/vm-console.html
curl http://localhost:8080/api/v1/vms/discover
# Get running jobs
curl http://localhost:8080/api/v1/jobs/query?status=running
# Get failed jobs
curl http://localhost:8080/api/v1/jobs/query?status=failed
curl -X POST http://localhost:8080/api/v1/schedules \
-H "Content-Type: application/json" \
-d '{
"name": "daily-backup",
"cron": "0 2 * * *",
"job_definition": {
"vm_path": "/datacenter/vm/prod/web01",
"output_path": "/backup/daily"
}
}'
# List domains
curl http://localhost:8080/api/v1/libvirt/domains
# Start a VM
curl -X POST http://localhost:8080/api/v1/libvirt/domain/start \
-d '{"name": "my-vm"}'
# Create snapshot
curl -X POST http://localhost:8080/api/v1/libvirt/snapshot/create \
-d '{
"domain_name": "my-vm",
"snapshot_name": "backup-2026-01-26",
"description": "Pre-update backup"
}'
Real-time updates via WebSocket:
const ws = new WebSocket('ws://localhost:8080/api/v1/ws/metrics');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Metrics update:', data);
};
All API errors return JSON with standard format:
{
"error": "job not found",
"status": 404,
"timestamp": "2026-01-26T10:30:00Z"
}
Common HTTP status codes:
200 OK - Success201 Created - Resource created400 Bad Request - Invalid input404 Not Found - Resource not found405 Method Not Allowed - Wrong HTTP method500 Internal Server Error - Server errorAPI endpoints implement rate limiting:
X-RateLimit-Limit, X-RateLimit-Remaining# Run all API handler tests
go test -v ./daemon/api
# Test specific handlers
go test -v ./daemon/api -run TestHandle.*Libvirt
# With coverage
go test -coverprofile=coverage.out ./daemon/api
# Test 79+ endpoints
./scripts/test-api.sh
# Test dashboard endpoints
./test-dashboard-endpoints.sh
Current Version: v1
HyperSDK uses semantic versioning:
Breaking changes will result in a new API version while maintaining backward compatibility for existing versions.
OpenAPI/Swagger spec available at:
http://localhost:8080/openapi.yaml
http://localhost:8080/swagger-ui/
scripts/test-api.sh for endpoint validationAPI documentation is licensed under LGPL-3.0-or-later.