REST API Reference
The ai_nn_controller AIC Server exposes a REST API for managing applications and sending commands.
Base URL
Default: http://localhost:8000
Global Endpoints
Health Check
List Applications
Application Endpoints
Get Application Info
Get Application State
Update Application State
Get Measurements
Send Manual Control
Error Responses
Code |
Description |
|---|---|
200 |
Success |
400 |
Bad request (invalid input) |
404 |
Application not found |
500 |
Internal server error |
Example Usage
Using curl
# List all apps
curl http://localhost:8000/apps
# Start an app
curl -X PUT http://localhost:8000/apps/NetworkControlApp/state \
-H "Content-Type: application/json" \
-d '{"state": "running"}'
# Get measurements
curl http://localhost:8000/apps/NetworkControlApp/measurements
# Send command
curl -X POST http://localhost:8000/apps/NetworkControlApp/control \
-H "Content-Type: application/json" \
-d '{
"node_id": 8,
"command": "SET_GAIN",
"payload": {"amp_type": "preamp", "target_gain": 15.0}
}'
Using Python
import requests
BASE_URL = "http://localhost:8000"
# List apps
response = requests.get(f"{BASE_URL}/apps")
apps = response.json()
# Start app
response = requests.put(
f"{BASE_URL}/apps/NetworkControlApp/state",
json={"state": "running"}
)
# Get measurements
response = requests.get(f"{BASE_URL}/apps/NetworkControlApp/measurements")
measurements = response.json()
# Send command
response = requests.post(
f"{BASE_URL}/apps/NetworkControlApp/control",
json={
"node_id": 8,
"command": "SET_GAIN",
"payload": {"amp_type": "preamp", "target_gain": 15.0}
}
)
API Documentation
Interactive API documentation is available at:
Swagger UI: http://localhost:8000/docs
ReDoc: http://localhost:8000/redoc