feat(per-instance-hook-scoping): scope observability + backup hooks by instance
This commit is contained in:
@@ -129,9 +129,10 @@ def post_backup_start(
|
||||
|
||||
@router.get("/jobs")
|
||||
def get_backup_jobs(
|
||||
service_id: str | None = None,
|
||||
store: SettingsStore = Depends(get_settings_store),
|
||||
) -> list[dict[str, Any]]:
|
||||
jobs = store.list_backup_jobs()
|
||||
jobs = store.list_backup_jobs(service_id=service_id)
|
||||
return jobs
|
||||
|
||||
|
||||
@@ -155,9 +156,10 @@ def get_backup_runs(
|
||||
job_id: str | None = None,
|
||||
status: str | None = None,
|
||||
limit: int = 50,
|
||||
service_id: str | None = None,
|
||||
store: SettingsStore = Depends(get_settings_store),
|
||||
) -> list[BackupRunResponse]:
|
||||
runs = store.list_backup_runs(job_id=job_id, status=status, limit=limit)
|
||||
runs = store.list_backup_runs(job_id=job_id, status=status, limit=limit, service_id=service_id)
|
||||
return [BackupRunResponse(**run) for run in runs]
|
||||
|
||||
|
||||
@@ -177,9 +179,12 @@ def get_backup_alerts(
|
||||
job_id: str | None = None,
|
||||
acknowledged: bool | None = None,
|
||||
severity: str | None = None,
|
||||
service_id: str | None = None,
|
||||
store: SettingsStore = Depends(get_settings_store),
|
||||
) -> list[BackupAlertResponse]:
|
||||
alerts = store.list_backup_alerts(job_id=job_id, acknowledged=acknowledged, severity=severity)
|
||||
alerts = store.list_backup_alerts(
|
||||
job_id=job_id, acknowledged=acknowledged, severity=severity, service_id=service_id,
|
||||
)
|
||||
return [BackupAlertResponse(**alert) for alert in alerts]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user