GetSearchJob
Source:
src/AWS/BackupSearch/GetSearchJob.ts
Runtime binding for backup-search:GetSearchJob.
Retrieves the bound search job’s metadata and progress — its Status
(RUNNING, COMPLETED, STOPPED, FAILED), item/backup counts, and
completion time. BackupSearch emits no EventBridge events, so polling this
operation until Status is terminal is how a consumer knows the results
returned by ListSearchJobResults are final. Provide the implementation
with Effect.provide(AWS.BackupSearch.GetSearchJobHttp).
Polling Search Progress
Section titled “Polling Search Progress”// init — bind the operation to the search jobconst getSearchJob = yield* AWS.BackupSearch.GetSearchJob(search);
// runtime — poll until the job reaches a terminal statusconst job = yield* getSearchJob().pipe( Effect.repeat({ schedule: Schedule.spaced("5 seconds"), until: (j) => j.Status !== "RUNNING", times: 24, }),);console.log(job.Status, job.SearchProgress?.ItemsMatchedCount);