| .. | .. |
|---|
| 22 | 22 | source: str, |
|---|
| 23 | 23 | dry_run: bool, |
|---|
| 24 | 24 | ) -> AsyncGenerator[str, None]: |
|---|
| 25 | | - """ |
|---|
| 26 | | - Async generator that drives the restore workflow and yields SSE events. |
|---|
| 27 | | - """ |
|---|
| 25 | + """Async generator that drives the restore workflow and yields SSE events.""" |
|---|
| 28 | 26 | base_args = ["restore", project, env] |
|---|
| 29 | 27 | if dry_run: |
|---|
| 30 | 28 | base_args.append("--dry-run") |
|---|
| 31 | 29 | |
|---|
| 32 | 30 | if source == "offsite": |
|---|
| 33 | | - download_args = ["offsite", "download", project, env] |
|---|
| 31 | + # ops offsite restore <project> <env> — downloads from offsite storage |
|---|
| 32 | + download_args = ["offsite", "restore", project, env] |
|---|
| 34 | 33 | yield _sse_line({"line": f"Downloading {project}/{env} from offsite...", "timestamp": _now()}) |
|---|
| 35 | 34 | |
|---|
| 36 | 35 | download_ok = True |
|---|
| .. | .. |
|---|
| 69 | 68 | """ |
|---|
| 70 | 69 | Restore a backup for the given project/env. |
|---|
| 71 | 70 | |
|---|
| 72 | | - Uses Server-Sent Events (SSE) to stream real-time progress to the client. |
|---|
| 71 | + Uses Server-Sent Events (SSE) to stream real-time progress. |
|---|
| 73 | 72 | Parameters are passed as query strings since EventSource only supports GET. |
|---|
| 74 | 73 | """ |
|---|
| 75 | 74 | return StreamingResponse( |
|---|