Skip to content

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).

// init — bind the operation to the search job
const getSearchJob = yield* AWS.BackupSearch.GetSearchJob(search);
// runtime — poll until the job reaches a terminal status
const 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);