feat(api): add /v1/maintenance policies and run endpoints

OpenAPI, httpapi CRUD/run/dry-run, job maintenance_policy_run и audit с policy_id.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-06-12 13:23:10 +07:00
co-authored by Cursor
parent 6510a9ca22
commit f548d0671f
8 changed files with 653 additions and 15 deletions
+3
View File
@@ -61,6 +61,7 @@ const (
KindPostgresAnalyze = "postgres_analyze"
KindPostgresReindex = "postgres_reindex"
KindPostgresCleanup = "postgres_cleanup"
KindMaintenancePolicyRun = "maintenance_policy_run"
)
// Worker executes queued jobs against store.Backend (memory or SQL).
@@ -188,6 +189,8 @@ func (w *Worker) Process(j *Job) {
w.runPostgresMaint(j, "reindex")
case KindPostgresCleanup:
w.runPostgresCleanup(j)
case KindMaintenancePolicyRun:
w.runMaintenancePolicy(j)
default:
j.Fail("unknown job kind")
}