#228 OpenAPI: Worker & Scheduling Endpoints (16 endpoints)

closed medium Created 2025-12-02 08:14 · Updated 2025-12-02 09:03

Description

Edit
## Scope Document worker management and scheduling endpoints: - `api/blueprints/v1/workers.py` (9 endpoints) - `api/blueprints/v1/schedules.py` (7 endpoints) ## Workers Endpoints (9) 1. GET /workers - List workers 2. GET /workers/{id} - Get worker details 3. POST /workers/{id}/pause - Pause worker 4. POST /workers/{id}/resume - Resume worker 5. POST /workers/{id}/drain - Drain worker 6. DELETE /workers/{id} - Remove worker 7. GET /workers/stats - Get worker statistics 8. GET /workers/queues - List queues 9. GET /workers/health - Worker health check ## Schedules Endpoints (7) 1. POST /schedules - Create schedule 2. GET /schedules - List schedules 3. GET /schedules/{id} - Get schedule 4. PUT /schedules/{id} - Update schedule 5. DELETE /schedules/{id} - Delete schedule 6. POST /schedules/{id}/pause - Pause schedule 7. POST /schedules/{id}/resume - Resume schedule ## Pydantic Models ```python class WorkerStatus(str, Enum): ONLINE = 'online' OFFLINE = 'offline' PAUSED = 'paused' DRAINING = 'draining' class WorkerResponse(BaseModel): worker_id: str hostname: str status: WorkerStatus queue: str current_tasks: int tasks_completed: int last_heartbeat: datetime class ScheduleCreateRequest(BaseModel): workflow_definition: dict cron_expression: str timezone: str = 'UTC' inputs: dict = {} enabled: bool = True class ScheduleResponse(BaseModel): schedule_id: str workflow_name: str cron_expression: str next_run: datetime | None last_run: datetime | None status: str ``` ## Depends On - #224 (Infrastructure Setup) ## Acceptance Criteria - [ ] All 16 endpoints documented - [ ] Worker states explained - [ ] Cron expression format documented

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...