API Reference: Monitoring & Sistem
Endpoint health, versi, resource host, konfigurasi gabungan, metrik dan log proses ingest, proses on-demand, dan WebSocket monitoring.
← Kembali ke Monitoring & Sistem
Cara membaca health, debug kamera, dan dashboard web.
Devices
Endpoint siklus hidup device.
Liodra tidak memiliki otentikasi API sendiri; batasi akses port 9080 di tingkat jaringan atau reverse proxy. Basis URL memakai variabel LIODRA_API_URL (default http://localhost:9080); untuk WebSocket ganti skema menjadi ws:// atau wss://. Endpoint /monitor/* dan WebSocket hanya tersedia pada backend standar.
Status Layanan
Health Check
Response Body
application/json
curl -X GET "http://localhost:9080/api/v1/health"{ "success": true, "data": { "status": "healthy", "timestamp": "2026-09-15T10:30:00Z", "version": "3.9.0", "uptime": "24h30m15s", "backend": "srs", "backend_ip": "127.0.0.1", "backend_health": true, "srs_summary": { "ok": true, "self": { "version": "7.0.159", "mem_kbyte": 45120, "cpu_percent": 5.3 }, "system": { "cpu_percent": 15.2, "mem_ram_percent": 25, "cpus": 4 } }, "cache_stats": { "device_cache": { "hits": 12345, "misses": 12, "hit_ratio": 0.999, "evictions": 0, "size": 87 }, "process_cache": { "hits": 9876, "misses": 5, "hit_ratio": 0.999, "evictions": 0, "size": 87 }, "streams_cache": { "hits": 54321, "misses": 8, "hit_ratio": 0.999, "evictions": 3, "size": 84 } }, "ondemand": { "active": 3, "max": 32 } }}Informasi Versi
Response Body
application/json
curl -X GET "http://localhost:9080/api/v1/version"{ "success": true, "data": { "version": "3.9.0", "build_time": "2026-09-15T05:37:30Z", "go_version": "go1.25.7", "git_commit": "24e833d0c1f2a3b4c5d6e7f8091a2b3c4d5e6f70", "backend": "srs", "srs_version": { "major": 7, "minor": 0, "revision": 159, "build": 0, "version": "7.0.159" } }}Statistik Resource Host
Response Body
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/resource-stat"{ "success": true, "data": { "cpu_percent": 15.5, "memory_mb": 1024.5, "disk_usage_percent": 45.2 }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Konfigurasi
Konfigurasi Aplikasi
Response Body
application/json
application/json
curl -X GET "http://localhost:9080/api/v1/config"{ "success": true, "data": { "playback_enabled": true, "vod_enabled": true, "broadcast_enabled": true, "devices_enabled": true, "retention_enabled": true, "version": "1.0.0", "last_updated": "2026-09-15T14:09:10Z", "devices": [ { "name": "camera_front", "url": "rtsp://admin:***@192.168.1.100:554/stream1", "scheme": "rtsp", "channel": "live", "silent_audio": true } ], "cleanup_schedule": { "time": "02:00:00", "default_retention": { "duration_days": 7, "disk_quota_mb": 0 }, "channel_policies": [] } }}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Perbarui Konfigurasi Aplikasi
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PUT "http://localhost:9080/api/v1/config" \ -H "Content-Type: application/json" \ -d '{ "cleanup_schedule": { "time": "02:00:00", "default_retention": { "duration_days": 7 } }, "devices": [] }'{ "success": true, "message": "Configuration updated successfully"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Proses Ingest
Daftar Proses Ingest
Response Body
application/json
curl -X GET "http://localhost:9080/api/v1/monitor/processes"[ { "device_id": "live/camera_front", "type": "ingest", "pid": 1234, "status": "active", "cpu": 1.5, "memory": 25.3 }]Log Proses Ingest Device
Path Parameters
Identitas device channel/name.
Query Parameters
Jumlah baris terakhir. Default mengikuti MAX_LOG_LINES (500).
Response Body
text/plain
curl -X GET "http://localhost:9080/api/v1/monitor/processes/live/camera_front/logs?lines=200""string"Perintah Proses Ingest Device
curl -X GET "http://localhost:9080/api/v1/monitor/processes/live/camera_front/command"{ "device_id": "live/camera_front", "command": "<perintah ingest lengkap>"}Restart Proses Ingest
curl -X POST "http://localhost:9080/api/v1/monitor/processes/live/camera_front/restart"{ "status": "restarted", "device_id": "string"}Sistem dan Proses On-Demand
Statistik Sistem
Response Body
application/json
curl -X GET "http://localhost:9080/api/v1/monitor/system"{ "cpu": { "usage_percent": 12.4, "cores": 18 }, "memory": { "total_mb": 32768, "used_mb": 8192 }, "disk": { "total_mb": 1048576, "used_mb": 524288 }, "network": {}, "uptime": 259200, "platform": "linux", "host_id": "abc123", "timestamp": "2026-09-15T10:30:00Z", "cache_stats": { "device_cache": { "hits": 12345, "misses": 12, "hit_ratio": 0.999, "evictions": 0, "size": 87 } }}Daftar Proses On-Demand
Response Body
application/json
curl -X GET "http://localhost:9080/api/v1/monitor/ondemand"[ { "device_id": "ondemand/a1b2c3d4", "type": "ondemand", "command": [ "string" ], "pid": 2345, "started_at": "2019-08-24T14:15:22Z", "status": "running", "resource_stats": {}, "ffmpeg_stats": {}, "request_url": "/api/v1/playbacks/live/camera_front?start=2026-09-15T02:30:00Z&duration=60" }]Log Proses On-Demand
Path Parameters
ID sesi on-demand.
Query Parameters
Jumlah baris terakhir. Default mengikuti MAX_LOG_LINES (500).
Response Body
text/plain
curl -X GET "http://localhost:9080/api/v1/monitor/ondemand/a1b2c3d4/logs?lines=200""string"Hentikan Proses On-Demand
curl -X DELETE "http://localhost:9080/api/v1/monitor/ondemand/a1b2c3d4"{ "status": "killed", "session_id": "string"}WebSocket
Status Device
curl -X GET "http://localhost:9080/ws/v1/monitor/devices"Metrik Proses
curl -X GET "http://localhost:9080/ws/v1/monitor/processes"Proses On-Demand
curl -X GET "http://localhost:9080/ws/v1/monitor/ondemand"Monitoring & Sistem
Health check, versi, konfigurasi, metrik proses ingest, log per device, proses on-demand, WebSocket real-time, dan dashboard web bawaan.
Transcode Ingest (Eksperimental)
Mengecilkan bitrate kamera saat masuk dengan encoder hardware GPU terintegrasi, kalibrasi kualitas per kamera, dan anggaran encoder terukur.