API Reference#
The APM blueprint exposes REST
APIs through two services that are accessible via the NGINX reverse proxy at
http://localhost:8080.
Storage Service#
The storage service manages detection data written by the agent service and queried by the agent pipeline.
Base URL: http://localhost:8080/api/storage/
Method |
Path |
Description |
|---|---|---|
|
|
Insert a single detection record |
|
|
Bulk insert multiple detections |
|
|
Query detections — supports |
|
|
Per-class detection statistics |
|
|
Clear all stored detections |
|
|
Health check endpoint |
|
|
Prometheus metrics |
Example: Insert a Detection#
curl -X POST http://localhost:8080/api/storage/detections \
-H "Content-Type: application/json" \
-d '{
"label": "Rupture",
"confidence": 0.87,
"bbox": [120, 45, 300, 200],
"frame_id": 42,
"timestamp": "2026-06-25T10:00:00Z"
}'
Example: Query Detections by Label#
curl "http://localhost:8080/api/storage/detections?label=Rupture&min_confidence=0.7&limit=20"
Example: Get Detection Summary#
curl http://localhost:8080/api/storage/detections/summary
Sample response:
{
"total": 120,
"by_class": {
"Rupture": 30,
"Deformation": 55,
"Disconnect": 10,
"Obstacle": 25
},
"avg_confidence": 0.74
}
Agent Service#
The agent service triggers the multi-agent LangGraph pipeline and tracks run results.
Base URL: http://localhost:8080/api/agents/
Method |
Path |
Description |
|---|---|---|
|
|
Trigger a new agent pipeline run (asynchronous) |
|
|
List all agent runs |
|
|
Get the status and result of a specific run |
|
|
Health check endpoint |
|
|
Prometheus metrics |
Example: Trigger an Agent Run#
curl -X POST http://localhost:8080/api/agents/runs \
-H "Content-Type: application/json" \
-d '{}'
Response:
{
"run_id": "abc123",
"status": "started"
}
Example: Check Run Status#
curl http://localhost:8080/api/agents/runs/abc123
When the run completes, the response includes the full ticket generated by the Ticketing Agent:
{
"run_id": "abc123",
"status": "completed",
"ticket": {
"priority": "HIGH",
"title": "Rupture detected in pipeline segment A3",
"description": "Multiple high-confidence Rupture detections observed over 30 frames.",
"affected_component": "segment-A3",
"recommended_action": "HALT_PIPELINE",
"estimated_resolution_time": "4 hours",
"tags": ["Rupture", "Disconnect"]
}
}
Prometheus Metrics#
The metrics-manager service collects metrics from both services and makes them available at:
Storage service:
http://localhost:9091/metrics— exposesapm_storage_detections_totalAgent service:
http://localhost:9091/metrics— exposesapm_agent_runs_totalandapm_agent_runs_completedPrometheus UI:
http://localhost:9090