| 1 | import type * as efs from "@distilled.cloud/aws/efs"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { FileSystem } from "./FileSystem.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `DescribeFileSystems` operation scoped to one file |
| 8 | * system (IAM action `elasticfilesystem:DescribeFileSystems` on the file |
| 9 | * system ARN). |
| 10 | * |
| 11 | * Reads the bound {@link FileSystem}'s live description — lifecycle state, |
| 12 | * size in each storage class, throughput mode, mount target count — from |
| 13 | * inside a function runtime. Useful for storage dashboards and capacity |
| 14 | * monitors. Provide the implementation with |
| 15 | * `Effect.provide(AWS.EFS.DescribeFileSystemHttp)`. |
| 16 | * ### Inspecting File Systems |
| 17 | * **Example:** Read the file system's size and state |
| 18 | * ```typescript |
| 19 | * // init — bind the operation to the file system |
| 20 | * const describeFileSystem = yield* AWS.EFS.DescribeFileSystem(files); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const response = yield* describeFileSystem(); |
| 24 | * const fs = response.FileSystems?.[0]; |
| 25 | * yield* Effect.log(`${fs?.LifeCycleState}: ${fs?.SizeInBytes?.Value} bytes`); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface DescribeFileSystem extends Binding.Service< |
| 31 | DescribeFileSystem, |
| 32 | "AWS.EFS.DescribeFileSystem", |
| 33 | ( |
| 34 | fileSystem: FileSystem, |
| 35 | ) => Effect.Effect< |
| 36 | () => Effect.Effect< |
| 37 | efs.DescribeFileSystemsResponse, |
| 38 | efs.DescribeFileSystemsError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const DescribeFileSystem = Binding.Service<DescribeFileSystem>( |
| 43 | "AWS.EFS.DescribeFileSystem", |
| 44 | ); |