@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 47 lines 1.73 KB
Raw
1 import type * as emrc from "@distilled.cloud/aws/emr-containers";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { VirtualCluster } from "./VirtualCluster.ts";
5
6 /**
7 * Runtime binding for `emr-containers:StartJobRun`.
8 *
9 * Submits a Spark job run to the bound {@link VirtualCluster}. The virtual
10 * cluster ID is injected from the binding; pass a `jobDriver` +
11 * `executionRoleArn` + `releaseLabel` directly, or a `jobTemplateId` (+
12 * `jobTemplateParameters`) to start from a {@link JobTemplate}. Returns the
13 * new job run's `id`/`arn` for use with `DescribeJobRun` / `CancelJobRun`.
14 * Provide the implementation with
15 * `Effect.provide(AWS.EMRContainers.StartJobRunHttp)`.
16 * ### Running Jobs
17 * **Example:** Start A Templated Spark Job
18 * ```typescript
19 * // init — bind the operation to the virtual cluster
20 * const startJobRun = yield* AWS.EMRContainers.StartJobRun(virtualCluster);
21 *
22 * // runtime
23 * const { id } = yield* startJobRun({
24 * jobTemplateId: templateId,
25 * jobTemplateParameters: { EntryPoint: "s3://my-bucket/etl.py" },
26 * });
27 * yield* Effect.log(`job run started: ${id}`);
28 * ```
29 *
30 * @binding
31 */
32 export interface StartJobRun extends Binding.Service<
33 StartJobRun,
34 "AWS.EMRContainers.StartJobRun",
35 (virtualCluster: VirtualCluster) => Effect.Effect<
36 (
37 request: Omit<emrc.StartJobRunRequest, "virtualClusterId" | "clientToken"> & {
38 /**
39 * Idempotency token for the job run submission.
40 * @default auto-generated per call
41 */
42 clientToken?: string;
43 },
44 ) => Effect.Effect<emrc.StartJobRunResponse, emrc.StartJobRunError>
45 >
46 > {}
47 export const StartJobRun = Binding.Service<StartJobRun>("AWS.EMRContainers.StartJobRun");