| 1 | import type * as osis from "@distilled.cloud/aws/osis"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Pipeline } from "./Pipeline.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `osis:GetPipeline`. |
| 8 | * |
| 9 | * Reads the bound {@link Pipeline}'s live detail — status, capacity, ingest |
| 10 | * endpoint URLs, and destinations — so an ops function can health-check the |
| 11 | * pipeline or discover its ingest endpoints at runtime. The pipeline name is |
| 12 | * injected from the binding. Provide the implementation with |
| 13 | * `Effect.provide(AWS.OSIS.GetPipelineHttp)`. |
| 14 | * ### Monitoring a Pipeline |
| 15 | * **Example:** Check the Pipeline's Status |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the pipeline |
| 18 | * const getPipeline = yield* AWS.OSIS.GetPipeline(pipeline); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Pipeline } = yield* getPipeline(); |
| 22 | * if (Pipeline?.Status !== "ACTIVE") { |
| 23 | * yield* Effect.logWarning(`pipeline is ${Pipeline?.Status}`); |
| 24 | * } |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface GetPipeline extends Binding.Service< |
| 30 | GetPipeline, |
| 31 | "AWS.OSIS.GetPipeline", |
| 32 | ( |
| 33 | pipeline: Pipeline, |
| 34 | ) => Effect.Effect< |
| 35 | () => Effect.Effect<osis.GetPipelineResponse, osis.GetPipelineError> |
| 36 | > |
| 37 | > {} |
| 38 | export const GetPipeline = Binding.Service<GetPipeline>("AWS.OSIS.GetPipeline"); |