Complete REST API documentation for the OS Simulator backend.
Base URL: http://localhost:8000
API Documentation: http://localhost:8000/docs (Swagger UI)
POST /api/scheduler/runRequest Body:
{
"algorithm": "fcfs",
"processes": [
{"pid": 1, "arrival_time": 0, "burst_time": 5, "priority": 1}
],
"time_quantum": 4,
"preemptive": false
}Response:
{
"gantt_chart": [{"pid": 1, "start": 0, "end": 5, "duration": 5}],
"completed_processes": [...],
"metrics": {
"average_waiting_time": 2.5,
"average_turnaround_time": 7.5,
"average_response_time": 2.5,
"cpu_utilization": 100.0,
"throughput": 0.4,
"total_context_switches": 3
},
"explanations": [...]
}POST /api/scheduler/compareGET /api/scheduler/algorithmsGET /api/memory/contiguous/statePOST /api/memory/contiguous/allocate{
"process_id": 1,
"size": 100,
"algorithm": "first_fit",
"total_memory": 1000
}POST /api/memory/contiguous/deallocatePOST /api/memory/contiguous/resetPOST /api/memory/create-page-tablePOST /api/memory/access-pagePOST /api/memory/page-replacementPOST /api/memory/segmentation/createPOST /api/memory/segmentation/allocatePOST /api/memory/segmentation/translatePOST /api/filesystem/create-filePOST /api/filesystem/read-filePOST /api/filesystem/write-fileDELETE /api/filesystem/deleteGET /api/scenarios/listGET /api/scenarios/load/{scenario_id}All endpoints return errors in this format:
{
"detail": "Error message description"
}Common Status Codes:
200- Success400- Bad Request (validation error)404- Not Found500- Internal Server Error