| 1 | import type * as dms from "@distilled.cloud/aws/database-migration-service"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `dms:DescribeTableStatistics`. |
| 7 | * |
| 8 | * Bind this operation (account-level) to read per-table migration progress |
| 9 | * for a replication task — rows inserted/updated/deleted, full-load |
| 10 | * completion, validation state. The data behind migration progress |
| 11 | * dashboards and cut-over gates. Provide the implementation with |
| 12 | * `Effect.provide(AWS.DMS.DescribeTableStatisticsHttp)`. |
| 13 | * ### Monitoring Migration Progress |
| 14 | * **Example:** Gate a Cut-Over on Full-Load Completion |
| 15 | * ```typescript |
| 16 | * // init — account-level, no target resource |
| 17 | * const describeTableStatistics = yield* AWS.DMS.DescribeTableStatistics(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { TableStatistics } = yield* describeTableStatistics({ |
| 21 | * ReplicationTaskArn: taskArn, |
| 22 | * }); |
| 23 | * const pending = TableStatistics?.filter( |
| 24 | * (table) => table.FullLoadEndTime === undefined, |
| 25 | * ); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface DescribeTableStatistics extends Binding.Service< |
| 31 | DescribeTableStatistics, |
| 32 | "AWS.DMS.DescribeTableStatistics", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request: dms.DescribeTableStatisticsMessage, |
| 36 | ) => Effect.Effect< |
| 37 | dms.DescribeTableStatisticsResponse, |
| 38 | dms.DescribeTableStatisticsError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const DescribeTableStatistics = Binding.Service<DescribeTableStatistics>( |
| 44 | "AWS.DMS.DescribeTableStatistics", |
| 45 | ); |