| 1 | import type * as emr from "@distilled.cloud/aws/emr-serverless"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Application } from "./Application.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request accepted by the {@link GetDashboardForJobRun} runtime callable. |
| 8 | * The `applicationId` is injected from the bound {@link Application}. |
| 9 | */ |
| 10 | export type GetDashboardForJobRunInput = Omit< |
| 11 | emr.GetDashboardForJobRunRequest, |
| 12 | "applicationId" |
| 13 | >; |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `emr-serverless:GetDashboardForJobRun`. |
| 17 | * |
| 18 | * Creates a pre-signed URL to the live Spark/Tez UI (or Spark History |
| 19 | * Server) for a job run on the bound {@link Application} — hand it to an |
| 20 | * on-call engineer to debug a slow or failed job without console access. |
| 21 | * Provide the implementation with |
| 22 | * `Effect.provide(AWS.EMRServerless.GetDashboardForJobRunHttp)`. |
| 23 | * ### Dashboards |
| 24 | * **Example:** Link To A Job's Spark UI |
| 25 | * ```typescript |
| 26 | * // init |
| 27 | * const getDashboardForJobRun = |
| 28 | * yield* AWS.EMRServerless.GetDashboardForJobRun(app); |
| 29 | * |
| 30 | * // runtime |
| 31 | * const { url } = yield* getDashboardForJobRun({ jobRunId }); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface GetDashboardForJobRun extends Binding.Service< |
| 37 | GetDashboardForJobRun, |
| 38 | "AWS.EMRServerless.GetDashboardForJobRun", |
| 39 | ( |
| 40 | application: Application, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: GetDashboardForJobRunInput, |
| 44 | ) => Effect.Effect< |
| 45 | emr.GetDashboardForJobRunResponse, |
| 46 | emr.GetDashboardForJobRunError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const GetDashboardForJobRun = Binding.Service<GetDashboardForJobRun>( |
| 51 | "AWS.EMRServerless.GetDashboardForJobRun", |
| 52 | ); |