-
Notifications
You must be signed in to change notification settings - Fork 5
Implement batch mode endpoint #94
Copy link
Copy link
Open
Labels
apiTo add to the Flask APITo add to the Flask APIenhancementmvpMinimum Viable ProductMinimum Viable Product
Description
Description
Create POST endpoint to run complete simulation in batch mode.
Tasks
- Create
POST /api/simulation/runendpoint - Accept JSON config in request body (components, routes, tours, trains)
- Validate config against schema
- Create session and call
run_to_completion() - Return results in response
- Handle validation errors (400)
- Handle simulation errors (500)
Acceptance Criteria
- Endpoint accepts valid config JSON
- Returns simulation results with status 200
- Proper error messages for invalid input
- Returns HTTP 400 for bad requests
- Returns HTTP 500 for simulation errors
Time Estimate
3 hours
Dependencies
- Depends on Implement session management #91 (Session management)
- Depends on Create Flask app factory #92 (Flask app)
- Depends on Define API schemas #93 (Schemas)
Files Changed
spur/api/server.py
Testing
curl -X POST http://localhost:5000/api/simulation/run \
-H "Content-Type: application/json" \
-d @examples/api/example_config.jsonReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiTo add to the Flask APITo add to the Flask APIenhancementmvpMinimum Viable ProductMinimum Viable Product