Scheduling flows
Scheduling flows (recurring health checks)¶
Create recurring checks to continuously monitor Redis and stream results to threads.
1) Create a schedule (CLI)¶
uv run redis-sre-agent schedule create \
--name "redis-health" \
--interval-type minutes \
--interval-value 15 \
--instructions "Check memory pressure and top slow operations" \
--redis-instance-id <instance_id>
List schedules:
uv run redis-sre-agent schedule list
Trigger a run now:
uv run redis-sre-agent schedule run-now <schedule_id>
2) Create a schedule (API)¶
curl -X POST http://localhost:8000/api/v1/schedules \
-H "Content-Type: application/json" \
-d '{
"name": "redis-health",
"interval_type": "minutes",
"interval_value": 15,
"instructions": "Check memory pressure and top slow operations",
"redis_instance_id": "<instance_id>",
"enabled": true
}'
List schedules:
curl http://localhost:8000/api/v1/schedules/
Get a schedule:
curl http://localhost:8000/api/v1/schedules/{schedule_id}
Trigger a run immediately:
curl -X POST http://localhost:8000/api/v1/schedules/{schedule_id}/trigger
List recent runs:
curl http://localhost:8000/api/v1/schedules/{schedule_id}/runs