1import type * as SVC from "@distilled.cloud/aws/finspace";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { KxEnvironment } from "./KxEnvironment.ts";
5
6/**
7 * Runtime binding for `finspace:GetKxVolume` — reads a volume's status, NAS configuration, and the clusters attached to it in the bound environment.
8 * Provide the implementation with
9 * `Effect.provide(AWS.FinSpace.GetKxVolumeHttp)`.
10 * ### Managing Volumes
11 * **Example:** Poll a Volume to Active
12 * ```typescript
13 * const getVolume = yield* AWS.FinSpace.GetKxVolume(kdb);
14 *
15 * const volume = yield* getVolume({ volumeName: "tp-logs" });
16 * if (volume.status === "ACTIVE") {
17 * yield* Effect.log(`attached: ${volume.attachedClusters?.length ?? 0}`);
18 * }
19 * ```
20 *
21 * @binding
22 */
23export interface GetKxVolume extends Binding.Service<
24 GetKxVolume,
25 "AWS.FinSpace.GetKxVolume",
26 <K extends KxEnvironment>(
27 environment: K,
28 ) => Effect.Effect<
29 (
30 request: Omit<SVC.GetKxVolumeRequest, "environmentId">,
31 ) => Effect.Effect<SVC.GetKxVolumeResponse, SVC.GetKxVolumeError>
32 >
33> {}
34export const GetKxVolume = Binding.Service<GetKxVolume>(
35 "AWS.FinSpace.GetKxVolume",
36);