Skip to main content

POST /system/stop

Stop the current monitoring session and return to IDLE state. This allows recalibration without restarting the server.

Response

status
string
Action status: stopped
message
string
Human-readable status message
state
string
New system state: IDLE

Example

cURL
curl -X POST "https://predictive-maintenance-uhlb.onrender.com/system/stop"
Response
{
  "status": "stopped",
  "message": "Session stopped. System is now IDLE.",
  "state": "IDLE"
}

Behavior

When you call /system/stop:
  1. Stops background thread - Terminates calibration, monitoring, or fault injection
  2. Transitions to IDLE - System returns to initial state
  3. Resets metrics - Clears training samples and validation metrics
  4. Preserves data - Sensor history and models remain in memory
  5. Allows recalibration - You can now call /system/calibrate again
Non-Destructive: /stop does NOT clear sensor data, baselines, or models. It only stops the active monitoring session. Use /system/purge for a complete reset.

State Requirements

Current StateCan Stop?
IDLE❌ No (already idle)
CALIBRATING❌ No (must complete)
MONITORING_HEALTHY✅ Yes
FAULT_INJECTION✅ Yes
You cannot stop during calibration. Wait for calibration to complete first, then call /stop.

Status Codes

  • 200 - Session stopped successfully
  • 400 - Invalid state (already IDLE or calibrating)

Use Cases

Session Management

End the current demo session cleanly

Recalibration

Prepare for a new calibration run

Testing Workflows

Reset between test scenarios

Dashboard Control

Stop button in the dashboard UI

State Transition Diagram

Comparison with Other Endpoints

EndpointStops Monitoring?Resets DI?Returns to StateClears Data?
/system/stop✅ Yes❌ NoIDLE❌ No
/system/reset✅ Yes❌ NoMONITORING_HEALTHY❌ No
/system/purge✅ Yes✅ YesIDLE✅ Yes
Use /stop when you want to end the current session but keep data for analysis or reuse.

Calibrate

Start a new calibration session

Reset

Return to healthy monitoring

Purge

Complete system reset

System State

Check current state

Build docs developers (and LLMs) love