API Reference — Developer Guide
Referensi endpoint REST API generik Visionaire4 — streams, sistem & node, visualisasi, analytics registry, smart search, dan konfigurasi platform.
← Kembali ke Developer Guide
Panduan konsep, quick start, dan referensi WebSocket.
Face Recognition API
Endpoint pipeline NFV4-FR, enrollment, dan pencarian wajah.
Semua endpoint pada halaman ini memanggil Visionaire4 API — basis URL dikonfigurasi melalui variabel VISIONAIRE_API_URL (default: http://localhost:4004). Tidak diperlukan otentikasi secara default.
Halaman ini tidak mencakup endpoint pipeline spesifik modul (NFV4-FR, NFV4-LPR3, NFV4-MPA, NFV4-MVA) — endpoint tersebut didokumentasikan di halaman API masing-masing modul.
Streams
Operasi CRUD untuk mengelola stream video pada node Visionaire4. Stream adalah sumber video (RTSP, file, USB) yang dapat menjalankan satu atau lebih pipeline analitik secara paralel.
Daftar Semua Stream
curl -X GET "http://localhost:4004/streams"{ "stream_number": 3, "streams": [ { "stream_id": "5136c6c0916cd30c", "stream_name": "Camera Lobby", "stream_address": "rtsp://10.7.2.50:554/VOD/stream.mp4", "stream_node_num": 0, "stream_latitude": -6.261376, "stream_longitude": 106.823648, "stream_custom_data": {} } ]}Daftar Stream per Node
Authorization
bearerAuth In: header
Path Parameters
Nomor node dalam cluster. Gunakan 0 untuk deployment single node.
Response Body
application/json
application/json
curl -X GET "http://localhost:4004/streams/0"{ "stream_number": 3, "streams": [ { "stream_id": "5136c6c0916cd30c", "stream_name": "Camera Lobby", "stream_address": "rtsp://10.7.2.50:554/VOD/stream.mp4", "stream_node_num": 0, "stream_latitude": -6.261376, "stream_longitude": 106.823648, "stream_custom_data": {} } ]}{ "code": 404, "message": "node not found"}Buat Stream Baru
Authorization
bearerAuth In: header
Path Parameters
Nomor node dalam cluster. Gunakan 0 untuk deployment single node.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "http://localhost:4004/streams/0" \ -H "Content-Type: application/json" \ -d '{ "stream_address": "rtsp://10.7.2.50:554/VOD/command.mp4", "stream_name": "Command Center", "stream_latitude": -6.261376, "stream_longitude": 106.823648 }'{ "code": 200, "ok": true, "message": "stream successfully created", "node_num": 0, "stream_id": "5136c6c0916cd30c", "stream_address": "rtsp://10.7.2.50:554/VOD/command.mp4", "stream_name": "Command Center"}{ "code": 400, "message": "Invalid stream_address"}Detail Stream
Authorization
bearerAuth In: header
Path Parameters
Nomor node dalam cluster.
ID unik stream yang dikembalikan saat pembuatan.
Response Body
application/json
application/json
curl -X GET "http://localhost:4004/streams/0/5136c6c0916cd30c"{ "stream_id": "5136c6c0916cd30c", "stream_name": "Camera Lobby", "stream_address": "rtsp://10.7.2.50:554/VOD/stream.mp4", "stream_node_num": 0, "stream_latitude": -6.261376, "stream_longitude": 106.823648, "stream_custom_data": {}, "pipelines": [ "NFV4-FR", "NFV4-LPR3" ], "seats": [ { "analytic_id": "NFV4-FR", "serial_number": "NFV4-FR6K-XXXX-YYYY" } ], "stream_stats": { "fps": 30, "frame_width": 1280, "frame_height": 720, "state": "RUNNING", "last_error_msg": "Stream is running.." }}{ "code": 404, "message": "stream not found"}Perbarui Stream
Authorization
bearerAuth In: header
Path Parameters
Nomor node dalam cluster.
ID unik stream yang dikembalikan saat pembuatan.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PUT "http://localhost:4004/streams/0/5136c6c0916cd30c" \ -H "Content-Type: application/json" \ -d '{}'{ "code": 200, "message": "stream successfully updated", "node_num": 0, "stream_id": "5136c6c0916cd30c", "stream_address": "rtsp://10.7.2.50:554/VOD/new_stream.mp4", "stream_name": "Command Center Updated"}{ "code": 404, "message": "stream not found"}Hapus Stream
Authorization
bearerAuth In: header
Path Parameters
Nomor node dalam cluster.
ID unik stream yang dikembalikan saat pembuatan.
Response Body
application/json
application/json
curl -X DELETE "http://localhost:4004/streams/0/5136c6c0916cd30c"{ "code": 200, "message": "stream successfully deleted", "node_num": 0, "stream_id": "5136c6c0916cd30c"}{ "code": 404, "message": "stream not found"}Sistem & Node
Endpoint untuk memantau kesehatan sistem dan cluster — informasi versi, status node, statistik resource (CPU/GPU/RAM), restart graceful, dan Prometheus metrics.
Informasi Sistem
curl -X GET "http://localhost:4004"{ "name": "Visionaire4", "version": { "major": 4, "minor": 50, "patch": 0 }, "deployment_key": "my-deployment-abc123"}Status Node Cluster
curl -X GET "http://localhost:4004/node_status"{ "node_number": 2, "nodes": [ { "node_num": 0, "status": "online", "running_time_sec": 3600, "ip_address": "192.168.1.100", "run_mode": "GPU" }, { "node_num": 1, "status": "online", "running_time_sec": 3598, "ip_address": "192.168.1.101", "run_mode": "GPU" } ]}Statistik Resource
curl -X GET "http://localhost:4004/resource_stats"{ "devices": [ { "node_num": 0, "data": { "cpu_percent": 12.44, "ram_percent": 27.46, "swap_memory_percent": 0, "gpus": [ { "gpu_id": 0, "gpu_name": "Tesla P4", "gpu_utilization": 85, "gpu_temperature": 72, "gpu_memory_total": 7981694976, "gpu_memory_used": 5451022336, "gpu_memory_free": 2530672640, "services": [ { "service_name": "visionaire::face_extraction", "service_number": 1 } ] } ] } } ]}Statistik Resource v2 (dengan IP)
curl -X GET "http://localhost:4004/v2/resource_stats"{ "devices": [ { "node_num": 0, "ip_address": "192.168.1.100", "data": { "cpu_percent": 12.44, "ram_percent": 27.46, "swap_memory_percent": 0, "gpus": [ { "gpu_id": 0, "gpu_name": "Tesla P4", "gpu_utilization": 85, "gpu_temperature": 72, "gpu_memory_total": 7981694976, "gpu_memory_used": 5451022336, "gpu_memory_free": 2530672640, "services": [ { "service_name": "visionaire::face_extraction", "service_number": 1 } ] } ] } } ]}Restart Sistem
curl -X POST "http://localhost:4004/system/restart"{ "code": 200, "message": "System restart initiated"}Prometheus Metrics
curl -X GET "http://localhost:4004/metrics""# HELP visionaire_streams_total Total streams\n# TYPE visionaire_streams_total gauge\nvisionaire_streams_total 5\n"Visualization
Endpoint untuk visualisasi stream video — MJPEG live stream (dengan atau tanpa overlay analitik), tangkapan frame JPEG tunggal, dan halaman embed HTML. Endpoint MJPEG dapat langsung digunakan sebagai src pada tag <img> di browser.
MJPEG Live Stream
Authorization
bearerAuth In: header
Path Parameters
Nomor node dalam cluster.
ID unik stream.
Query Parameters
Batas frame rate output. 0 = tidak terbatas.
0Tinggi output dalam piksel.
320Kualitas JPEG (1–100).
601 <= value <= 100Response Body
multipart/x-mixed-replace
application/json
curl -X GET "http://localhost:4004/mjpeg/0/5136c6c0916cd30c?fps=10&height=480&jpeg_quality=70""string"{ "code": 404, "message": "stream not found"}MJPEG Live Stream dengan Overlay Analitik
Authorization
bearerAuth In: header
Path Parameters
ID analitik untuk overlay visualisasi. Harus sesuai pipeline yang aktif pada stream.
Query Parameters
Batas frame rate output.
0Tinggi output dalam piksel.
320Kualitas JPEG (1–100).
601 <= value <= 100Response Body
multipart/x-mixed-replace
application/json
curl -X GET "http://localhost:4004/mjpeg/0/5136c6c0916cd30c/NFV4-FR?fps=10&height=480&jpeg_quality=70""string"{ "code": 404, "message": "stream or analytic not found"}Tangkap Frame JPEG Tunggal
Authorization
bearerAuth In: header
Path Parameters
Response Body
image/jpeg
application/json
curl -X GET "http://localhost:4004/stream_jpeg/0/5136c6c0916cd30c""string"{ "code": 404, "message": "stream not found"}Halaman Embed Visual Stream
Authorization
bearerAuth In: header
Path Parameters
Response Body
text/html
curl -X GET "http://localhost:4004/visual/0/5136c6c0916cd30c""string"Halaman Embed Visual Stream dengan Overlay Analitik
Authorization
bearerAuth In: header
Path Parameters
ID analitik untuk overlay pada halaman embed.
Response Body
text/html
curl -X GET "http://localhost:4004/visual/0/5136c6c0916cd30c/NFV4-FR""string"Analytics Registry
Endpoint untuk menjelajahi modul analitik yang terinstal — daftar analitik dengan lisensi seat, skema konfigurasi pipeline, aturan logika (rules), dan preset konfigurasi.
Daftar Analitik Tersedia
curl -X GET "http://localhost:4004/analytic_list"{ "code": 200, "message": "success", "analytic_num": 2, "deployment_key": "my-deployment", "version": { "major": 4, "minor": 50, "patch": 0 }, "analytics": [ { "id": "NFV4-FR", "name": "Face Recognition", "major_version": 2, "minor_version": 0, "publisher": "Nodeflux", "description": "Realtime face detection and face recognition", "type": "recognition", "seats": [ { "serial_number": "NFV4-FR12-XXXX-XXXX", "active_status": true } ] } ]}Skema Konfigurasi Pipeline
Authorization
bearerAuth In: header
Path Parameters
ID modul analitik (misalnya NFV4-FR, NFV4-LPR3, NFV4-MPA).
Response Body
application/json
application/json
curl -X GET "http://localhost:4004/config/pipeline/NFV4-FR"{ "type": "object", "properties": { "score_threshold": { "type": "number", "default": 0.5 }, "areas": { "type": "array" } }}{ "code": 404, "message": "analytic not found"}Skema Konfigurasi Pipeline v2 (dengan Sub-analitik)
Authorization
bearerAuth In: header
Path Parameters
ID modul analitik.
Response Body
application/json
application/json
curl -X GET "http://localhost:4004/v2/config/pipeline/NFV4-FR"{ "type": "object", "properties": { "score_threshold": { "type": "number", "default": 0.5 }, "areas": { "type": "array" } }}{ "code": 404, "message": "analytic not found"}Skema Rules Pipeline
Authorization
bearerAuth In: header
Path Parameters
ID modul analitik.
Response Body
application/json
application/json
curl -X GET "http://localhost:4004/rules/pipeline/NFV4-FR"{}{ "code": 404, "message": "analytic not found"}Preset Konfigurasi Pipeline
Authorization
bearerAuth In: header
Path Parameters
ID modul analitik.
Response Body
application/json
application/json
curl -X GET "http://localhost:4004/config/preset/NFV4-FR"{}{ "code": 404, "message": "analytic not found"}Smart Search
Endpoint untuk pencarian visual dan tekstual berbasis kemiripan (similarity search) terhadap database event, serta pengiriman payload eksternal ke pipeline Smart Search.
Pencarian Visual / Tekstual
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "http://localhost:4004/smart-search" \ -H "Content-Type: application/json" \ -d '{ "type": "image", "query": "/9j/4AAQSkZJRgAB..." }'{ "code": 200, "message": "success", "results": [ { "stream_id": "5136c6c0916cd30c", "analytic_id": "NFV4-FR", "node_num": 0, "timestamp_ms": 1674123456789, "similarity": 0.92, "image_jpeg": "/9j/4AAQ...", "primary_text": "John Doe", "secondary_text": "Employee" } ]}{ "code": 400, "message": "invalid query type"}Push Payload ke Pipeline Smart Search
Authorization
bearerAuth In: header
Path Parameters
Nomor node tempat pipeline Smart Search berjalan.
ID stream tempat pipeline Smart Search terpasang.
ID pipeline Smart Search yang menjadi tujuan payload.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "http://localhost:4004/extract/0/5136c6c0916cd30c/NFV4-SS" \ -H "Content-Type: application/json" \ -d '{ "image": "/9j/4AAQSkZJRgAB...", "metadata": { "source": "external-api" } }'{ "code": 200, "message": "payload successfully pushed to pipeline", "node_num": 0, "stream_id": "5136c6c0916cd30c", "pipeline_id": "NFV4-SS"}{ "code": 404, "message": "pipeline not found"}Konfigurasi Platform
Endpoint untuk mengelola konfigurasi platform Visionaire4, pengaturan retensi database, statistik disk, dan manajemen lisensi check-in.
Ambil Konfigurasi Platform
curl -X GET "http://localhost:4004/config/platform"{ "code": 200, "message": "success", "config": { "max_streams_per_node": 16, "event_retention_days": 30, "enable_cors": true, "log_level": "info" }}Perbarui Konfigurasi Platform
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "http://localhost:4004/config/platform" \ -H "Content-Type: application/json" \ -d '{ "max_streams_per_node": 16, "event_retention_days": 30, "enable_cors": true, "log_level": "info" }'{ "code": 200, "message": "success", "config": { "max_streams_per_node": 16, "event_retention_days": 30, "enable_cors": true, "log_level": "info" }}{ "code": 400, "message": "invalid configuration value"}Statistik Penggunaan Database
curl -X GET "http://localhost:4004/database/stats"{ "code": 200, "message": "success", "total_size_bytes": 10737418240, "used_size_bytes": 5368709120, "free_size_bytes": 5368709120, "event_count": 1250000}Ambil Konfigurasi Database
curl -X GET "http://localhost:4004/config/database"{ "code": 200, "message": "success", "config": { "retention_days": 30, "max_events_per_stream": 100000 }}Perbarui Konfigurasi Database
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PUT "http://localhost:4004/config/database" \ -H "Content-Type: application/json" \ -d '{ "retention_days": 30 }'{ "code": 200, "message": "success", "config": { "retention_days": 30, "max_events_per_stream": 100000 }}Status Check-in Lisensi
curl -X GET "http://localhost:4004/config/checkin"{ "code": 200, "message": "success", "checkin": { "status": "active", "deployment_key": "my-deployment-abc123", "last_checkin_at": "2025-01-15T08:00:00Z", "expires_at": "2026-01-15T08:00:00Z" }}Check-in Lisensi
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "http://localhost:4004/config/checkin" \ -H "Content-Type: application/json" \ -d '{ "access_key": "AKID-XXXX-YYYY-ZZZZ", "secret_key": "sk-XXXX-YYYY-ZZZZ" }'{ "code": 200, "message": "checkin successful", "checkin": { "status": "active", "deployment_key": "my-deployment-abc123", "last_checkin_at": "2025-01-15T08:00:00Z", "expires_at": "2026-01-15T08:00:00Z" }}{ "code": 400, "message": "invalid license credentials"}Hapus Kredensial Check-in
curl -X DELETE "http://localhost:4004/config/checkin"{ "code": 200, "message": "checkin credentials cleared"}Developer Guide
Panduan pengembang untuk mengintegrasikan dan menggunakan Visionaire4 API — mencakup manajemen stream, pipeline analitik, visualisasi real-time, konfigurasi platform, dan komunikasi berbasis WebSocket.
Face Recognition
Deteksi wajah real-time, pengenalan identitas, dan pencocokan dengan database wajah terdaftar untuk access control, absensi, identifikasi VIP, dan monitoring keamanan.