Add SQLite database integration with SQLAlchemy async, migration tooling, and comprehensive CRUD operations for hosts, tasks, schedules, and logs

This commit is contained in:
2025-12-04 21:37:55 -05:00
parent 28276f326b
commit ad3a8a5639
38 changed files with 2503 additions and 388 deletions
+168
View File
@@ -1,5 +1,173 @@
{
"runs": [
{
"id": "run_e16db5ac6f5c",
"schedule_id": "sched_110c001afe0c",
"task_id": "2",
"started_at": "2025-12-05 02:35:00.012993+00:00",
"finished_at": "2025-12-05 02:35:32.549542+00:00",
"status": "success",
"duration_seconds": 32.45821054699991,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_6c434a169263",
"schedule_id": "sched_110c001afe0c",
"task_id": "1",
"started_at": "2025-12-05 02:30:00.004595+00:00",
"finished_at": "2025-12-05 02:30:30.003032+00:00",
"status": "success",
"duration_seconds": 29.95905439800117,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_debf96da90dd",
"schedule_id": "sched_110c001afe0c",
"task_id": "2",
"started_at": "2025-12-05 02:25:00.016354+00:00",
"finished_at": "2025-12-05 02:25:27.580495+00:00",
"status": "success",
"duration_seconds": 27.521959419998893,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_bda871b98a7c",
"schedule_id": "sched_31a7ffb99bfd",
"task_id": "1",
"started_at": "2025-12-05 02:20:00.004169+00:00",
"finished_at": "2025-12-05 02:20:28.118352+00:00",
"status": "success",
"duration_seconds": 28.0753927859987,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_9acaf3ee6040",
"schedule_id": "sched_d5370726086b",
"task_id": "4",
"started_at": "2025-12-05 02:05:01.066895+00:00",
"finished_at": null,
"status": "running",
"duration_seconds": null,
"hosts_impacted": 0,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_25dee59d8f54",
"schedule_id": "sched_178b8e511908",
"task_id": "3",
"started_at": "2025-12-05 02:05:00.942939+00:00",
"finished_at": null,
"status": "running",
"duration_seconds": null,
"hosts_impacted": 0,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_06b2fe4c75f9",
"schedule_id": "sched_d5370726086b",
"task_id": "2",
"started_at": "2025-12-05 02:00:00.048675+00:00",
"finished_at": "2025-12-05 02:00:31.174698+00:00",
"status": "success",
"duration_seconds": 31.10493237799892,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_5a3ada10451e",
"schedule_id": "sched_178b8e511908",
"task_id": "1",
"started_at": "2025-12-05 02:00:00.004396+00:00",
"finished_at": "2025-12-05 02:00:30.956215+00:00",
"status": "success",
"duration_seconds": 30.92840002899902,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_484f67657ee4",
"schedule_id": "sched_d5370726086b",
"task_id": "3",
"started_at": "2025-12-05 01:55:00.084088+00:00",
"finished_at": "2025-12-05 01:55:32.096250+00:00",
"status": "success",
"duration_seconds": 31.975180113000533,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_7c9cbee2fe69",
"schedule_id": "sched_178b8e511908",
"task_id": "2",
"started_at": "2025-12-05 01:55:00.018967+00:00",
"finished_at": "2025-12-05 01:55:32.306141+00:00",
"status": "success",
"duration_seconds": 32.26106233700193,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_a45e3d80323d",
"schedule_id": "sched_d5370726086b",
"task_id": "1",
"started_at": "2025-12-05 01:50:00.003670+00:00",
"finished_at": "2025-12-05 01:50:27.635237+00:00",
"status": "success",
"duration_seconds": 27.58177596600217,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_6ebb5bb47219",
"schedule_id": "sched_d5370726086b",
"task_id": "2",
"started_at": "2025-12-05 01:45:00.003641+00:00",
"finished_at": "2025-12-05 01:45:26.015984+00:00",
"status": "success",
"duration_seconds": 25.9568110279979,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_f07c8820abcf",
"schedule_id": "sched_d5370726086b",
"task_id": "1",
"started_at": "2025-12-05 01:40:00.003609+00:00",
"finished_at": "2025-12-05 01:40:27.800302+00:00",
"status": "success",
"duration_seconds": 27.77215807200264,
"hosts_impacted": 15,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_c831165b16d9",
"schedule_id": "sched_d5370726086b",
"task_id": null,
"started_at": "2025-12-05 01:35:00.003976+00:00",
"finished_at": null,
"status": "running",
"duration_seconds": null,
"hosts_impacted": 0,
"error_message": null,
"retry_attempt": 0
},
{
"id": "run_9eaff32da049",
"schedule_id": "sched_31a7ffb99bfd",
+10 -10
View File
@@ -1,9 +1,9 @@
{
"schedules": [
{
"id": "sched_31a7ffb99bfd",
"id": "sched_110c001afe0c",
"name": "Health-check-5min",
"description": "Health-check-5min",
"description": null,
"playbook": "health-check.yml",
"target_type": "group",
"target": "all",
@@ -19,20 +19,20 @@
"timezone": "America/Montreal",
"start_at": null,
"end_at": null,
"next_run_at": "2025-12-04 15:35:00-05:00",
"last_run_at": "2025-12-04 20:30:00.003138+00:00",
"next_run_at": "2025-12-04T21:40:00-05:00",
"last_run_at": "2025-12-05 02:35:00.012919+00:00",
"last_status": "success",
"enabled": false,
"enabled": true,
"retry_on_failure": 0,
"timeout": 3600,
"tags": [
"Test"
],
"run_count": 22,
"success_count": 19,
"failure_count": 3,
"created_at": "2025-12-04 18:45:18.318152+00:00",
"updated_at": "2025-12-04 20:30:29.181594+00:00"
"run_count": 3,
"success_count": 3,
"failure_count": 0,
"created_at": "2025-12-05 02:24:06.110100+00:00",
"updated_at": "2025-12-05 02:35:32.549928+00:00"
}
]
}