| 1 | import type * as deadline from "@distilled.cloud/aws/deadline"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Queue } from "./Queue.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `deadline:GetSessionAction`. |
| 8 | * |
| 9 | * Reads one session action's detail (status, timing, exit code, progress, |
| 10 | * definition) for a job in the bound {@link Queue}. The queue's |
| 11 | * `farmId`/`queueId` are injected from the binding. Provide the |
| 12 | * implementation with `Effect.provide(AWS.Deadline.GetSessionActionHttp)`. |
| 13 | * ### Monitoring Sessions |
| 14 | * **Example:** Inspect A Session Action |
| 15 | * ```typescript |
| 16 | * // init — bind the operation to the queue |
| 17 | * const getSessionAction = yield* AWS.Deadline.GetSessionAction(queue); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const action = yield* getSessionAction({ jobId, sessionActionId }); |
| 21 | * if (action.processExitCode !== undefined && action.processExitCode !== 0) { |
| 22 | * yield* Effect.logError(`action failed: ${action.processExitCode}`); |
| 23 | * } |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetSessionAction extends Binding.Service< |
| 29 | GetSessionAction, |
| 30 | "AWS.Deadline.GetSessionAction", |
| 31 | ( |
| 32 | queue: Queue, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request: Omit<deadline.GetSessionActionRequest, "farmId" | "queueId">, |
| 36 | ) => Effect.Effect< |
| 37 | deadline.GetSessionActionResponse, |
| 38 | deadline.GetSessionActionError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const GetSessionAction = Binding.Service<GetSessionAction>( |
| 43 | "AWS.Deadline.GetSessionAction", |
| 44 | ); |