Nodeflux Central
Monitoring & Sistem

API Reference: Monitoring & Sistem

Endpoint health, versi, resource host, konfigurasi gabungan, metrik dan log proses ingest, proses on-demand, dan WebSocket monitoring.

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

GET
/api/v1/health

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

GET
/api/v1/version

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

GET
/api/v1/resource-stat

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

GET
/api/v1/config

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

PUT
/api/v1/config

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

GET
/api/v1/monitor/processes

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

GET
/api/v1/monitor/processes/{deviceID}/logs

Path Parameters

deviceID*string

Identitas device channel/name.

Query Parameters

lines?integer

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"
Empty

Perintah Proses Ingest Device

GET
/api/v1/monitor/processes/{deviceID}/command

Path Parameters

deviceID*string

Response Body

application/json

curl -X GET "http://localhost:9080/api/v1/monitor/processes/live/camera_front/command"
{  "device_id": "live/camera_front",  "command": "<perintah ingest lengkap>"}
Empty

Restart Proses Ingest

POST
/api/v1/monitor/processes/{deviceID}/restart

Path Parameters

deviceID*string

Response Body

application/json

curl -X POST "http://localhost:9080/api/v1/monitor/processes/live/camera_front/restart"
{  "status": "restarted",  "device_id": "string"}
Empty
Empty

Sistem dan Proses On-Demand

Statistik Sistem

GET
/api/v1/monitor/system

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

GET
/api/v1/monitor/ondemand

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"  }]
Empty

Log Proses On-Demand

GET
/api/v1/monitor/ondemand/{sessionID}/logs

Path Parameters

sessionID*string

ID sesi on-demand.

Query Parameters

lines?integer

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"
Empty

Hentikan Proses On-Demand

DELETE
/api/v1/monitor/ondemand/{sessionID}

Path Parameters

sessionID*string

Response Body

application/json

curl -X DELETE "http://localhost:9080/api/v1/monitor/ondemand/a1b2c3d4"
{  "status": "killed",  "session_id": "string"}
Empty

WebSocket

Status Device

GET
/ws/v1/monitor/devices

Response Body

curl -X GET "http://localhost:9080/ws/v1/monitor/devices"
Empty

Metrik Proses

GET
/ws/v1/monitor/processes

Response Body

curl -X GET "http://localhost:9080/ws/v1/monitor/processes"
Empty

Proses On-Demand

GET
/ws/v1/monitor/ondemand

Response Body

curl -X GET "http://localhost:9080/ws/v1/monitor/ondemand"
Empty

On this page