lablink_allocator_service.routes.schedules¶
lablink_allocator_service.routes.schedules
¶
Scheduled destruction CRUD.
Writes go through ScheduledDestructionService (it owns the APScheduler
job registration alongside the DB row); reads go straight to
ScheduleDatabase. Both are initialized in main(), so every handler
guards on the service being non-None.
Attributes¶
VALID_STATUS_FILTERS = ['scheduled', 'executing', 'completed', 'failed', 'cancelled']
module-attribute
¶
bp = Blueprint('schedules', __name__)
module-attribute
¶
logger = logging.getLogger(__name__)
module-attribute
¶
Functions:¶
cancel_scheduled_destruction(schedule_id)
¶
Cancel a scheduled destruction.
Source code in packages/allocator/src/lablink_allocator_service/routes/schedules.py
create_scheduled_destruction()
¶
Create a new scheduled destruction.
Request JSON: { "schedule_name": "Friday Tutorial End", "destruction_time": "2025-12-05T17:30:00Z", "recurrence_rule": null // or "FREQ=WEEKLY;BYDAY=FR;BYHOUR=17;BYMINUTE=30" }
Returns:
| Name | Type | Description |
|---|---|---|
Response |
Response | tuple[Response, int]
|
JSON with schedule_id and success status, or error with status code. |
Source code in packages/allocator/src/lablink_allocator_service/routes/schedules.py
get_scheduled_destruction(schedule_id)
¶
Get details of a scheduled destruction.
Source code in packages/allocator/src/lablink_allocator_service/routes/schedules.py
list_scheduled_destructions()
¶
List all scheduled destructions.
Query parameters
status (optional): Filter by status (scheduled, executing, completed, failed, cancelled)
Returns:
| Name | Type | Description |
|---|---|---|
Response |
Response | tuple[Response, int]
|
JSON with list of schedules, or error with status code. |