Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

DescribeFileSystem.ts

37 lines1.4 KB

1import type * as fsx from "@distilled.cloud/aws/fsx";
2import * as Binding from "alchemy/Binding";
3import type * as Effect from "effect/Effect";
4import type { FileSystem } from "./FileSystem.ts";
5​
6/**
7 * Runtime binding for the `DescribeFileSystems` operation scoped to one file
8 * system (IAM action `fsx:DescribeFileSystems` on the file system ARN).
9 *
10 * Reads the bound {@link FileSystem}'s live description — lifecycle state,
11 * storage capacity, DNS name, engine configuration — from inside a function
12 * runtime. Useful for storage dashboards and capacity monitors. Provide the
13 * implementation with `Effect.provide(AWS.FSx.DescribeFileSystemHttp)`.
14 * ### Inspecting File Systems
15 * **Example:** Read the file system's state and capacity
16 * ```typescript
17 * // init — bind the operation to the file system
18 * const describeFileSystem = yield* AWS.FSx.DescribeFileSystem(files);
19 *
20 * // runtime
21 * const response = yield* describeFileSystem();
22 * const fs = response.FileSystems?.[0];
23 * yield* Effect.log(`${fs?.Lifecycle}: ${fs?.StorageCapacity} GiB`);
24 * ```
25 *
26 * @binding
27 */
28export interface DescribeFileSystem extends Binding.Service<
29 DescribeFileSystem,
30 "AWS.FSx.DescribeFileSystem",
31 (
32 fileSystem: FileSystem,
33 ) => Effect.Effect<
34 () => Effect.Effect<fsx.DescribeFileSystemsResponse, fsx.DescribeFileSystemsError>
35 >
36> {}
37export const DescribeFileSystem = Binding.Service<DescribeFileSystem>("AWS.FSx.DescribeFileSystem");