Nodeflux Central
Developer Guide

API Reference — Developer Guide

Referensi endpoint REST API generik Visionaire4 — streams, sistem & node, visualisasi, analytics registry, smart search, dan konfigurasi platform.

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

GET
/streams

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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

GET
/streams/{node_num}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

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

POST
/streams/{node_num}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

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

GET
/streams/{node_num}/{stream_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node dalam cluster.

stream_id*string

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

PUT
/streams/{node_num}/{stream_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node dalam cluster.

stream_id*string

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

DELETE
/streams/{node_num}/{stream_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node dalam cluster.

stream_id*string

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

GET
/

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "http://localhost:4004"
{  "name": "Visionaire4",  "version": {    "major": 4,    "minor": 50,    "patch": 0  },  "deployment_key": "my-deployment-abc123"}

Status Node Cluster

GET
/node_status

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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

GET
/resource_stats

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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)

GET
/v2/resource_stats

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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

POST
/system/restart

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X POST "http://localhost:4004/system/restart"
{  "code": 200,  "message": "System restart initiated"}

Prometheus Metrics

GET
/metrics

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

text/plain

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

GET
/mjpeg/{node_num}/{stream_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node dalam cluster.

stream_id*string

ID unik stream.

Query Parameters

fps?integer

Batas frame rate output. 0 = tidak terbatas.

Default0
height?integer

Tinggi output dalam piksel.

Default320
jpeg_quality?integer

Kualitas JPEG (1–100).

Default60
Range1 <= value <= 100

Response 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

GET
/mjpeg/{node_num}/{stream_id}/{analytic_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer
stream_id*string
analytic_id*string

ID analitik untuk overlay visualisasi. Harus sesuai pipeline yang aktif pada stream.

Query Parameters

fps?integer

Batas frame rate output.

Default0
height?integer

Tinggi output dalam piksel.

Default320
jpeg_quality?integer

Kualitas JPEG (1–100).

Default60
Range1 <= value <= 100

Response 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

GET
/stream_jpeg/{node_num}/{stream_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer
stream_id*string

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

GET
/visual/{node_num}/{stream_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer
stream_id*string

Response Body

text/html

curl -X GET "http://localhost:4004/visual/0/5136c6c0916cd30c"
"string"

Halaman Embed Visual Stream dengan Overlay Analitik

GET
/visual/{node_num}/{stream_id}/{analytic_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer
stream_id*string
analytic_id*string

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

GET
/analytic_list

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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

GET
/config/pipeline/{analytic_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

analytic_id*string

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)

GET
/v2/config/pipeline/{analytic_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

analytic_id*string

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

GET
/rules/pipeline/{analytic_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

analytic_id*string

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

GET
/config/preset/{analytic_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

analytic_id*string

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

Endpoint untuk pencarian visual dan tekstual berbasis kemiripan (similarity search) terhadap database event, serta pengiriman payload eksternal ke pipeline Smart Search.

Pencarian Visual / Tekstual

POST
/smart-search

Authorization

bearerAuth
AuthorizationBearer <token>

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"}
POST
/extract/{node_num}/{stream_id}/{pipeline_id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

node_num*integer

Nomor node tempat pipeline Smart Search berjalan.

stream_id*string

ID stream tempat pipeline Smart Search terpasang.

pipeline_id*string

ID pipeline Smart Search yang menjadi tujuan payload.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[key: string]?any

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

GET
/config/platform

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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

POST
/config/platform

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[key: string]?any

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

GET
/database/stats

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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

GET
/config/database

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "http://localhost:4004/config/database"
{  "code": 200,  "message": "success",  "config": {    "retention_days": 30,    "max_events_per_stream": 100000  }}

Perbarui Konfigurasi Database

PUT
/config/database

Authorization

bearerAuth
AuthorizationBearer <token>

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

GET
/config/checkin

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

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

POST
/config/checkin

Authorization

bearerAuth
AuthorizationBearer <token>

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

DELETE
/config/checkin

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X DELETE "http://localhost:4004/config/checkin"
{  "code": 200,  "message": "checkin credentials cleared"}

On this page