Echo REST API¶
The Echo API module exposes the Echo Service as a Spring Boot REST API. It provides HTTP endpoints for state management, metrics, lineage, events, and quality results.
Running the API¶
The API starts on port 8080 by default. Health check available at /actuator/health.
Endpoints¶
State Management¶
Get Pipeline State¶
Response (200):
{
"success": true,
"data": {
"key": {"tenancy": "acme", "namespace": "prod", ...},
"currentState": "RUNNING",
"lastTransitionAt": "2024-01-15T10:30:00Z",
"lastEvent": "pipeline-submitted"
},
"timestamp": "2024-01-15T10:30:05Z"
}
Response (404 — state not found):
Transition State¶
POST /api/v1/state/transition
Content-Type: application/json
{
"tenancy": "acme",
"namespace": "production",
"dataset": "orders",
"pipeline": "daily-ingest",
"businessDate": "2024-01-15",
"runId": "run-001",
"targetState": "RUNNING",
"event": "pipeline-submitted"
}
Response (200):
{
"success": true,
"data": {
"success": true,
"previousState": null,
"currentState": "RUNNING",
"message": "Initial state set to 'RUNNING'"
}
}
Response (409 — invalid transition):
{
"success": false,
"error": "Invalid state transition from 'COMPLETED' to 'RUNNING'",
"timestamp": "..."
}
Get Recovery Metadata¶
Metrics¶
Persist Metric¶
POST /api/v1/metrics
Content-Type: application/json
{
"tenancy": "acme",
"namespace": "production",
"dataset": "orders",
"pipeline": "daily-ingest",
"runId": "run-001",
"executionMode": "BATCH",
"provider": "spark-provider",
"stage": "transform",
"metricName": "records.processed",
"metricValue": 150000,
"metricUnit": "COUNT",
"timestamp": 1705312200000,
"dimensions": {"partition": "2024-01-15"}
}
Query Metrics¶
GET /api/v1/metrics?tenancy=acme&namespace=production&pipeline=daily-ingest&metricName=records.processed&pageSize=20
Lineage¶
Persist Lineage Event¶
Query Lineage¶
Direction values: FORWARD, BACKWARD, IMPACT
Events¶
Publish Event¶
Query Events¶
GET /api/v1/events?tenancy=acme&namespace=production&pipeline=daily-ingest&eventType=state.transition&pageSize=50
Quality¶
Persist Quality Result¶
Query Quality Results¶
Error Handling¶
| HTTP Status | Cause |
|---|---|
| 200 | Success |
| 400 | Validation error (blank fields, invalid format) |
| 404 | State not found |
| 409 | Invalid state transition |
All error responses follow the ApiResponse format:
Configuration¶
The API uses DefaultEchoService (in-memory) by default. To use a persistent store, provide a custom EchoService bean.