1import type * as fsx from "@distilled.cloud/aws/fsx";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5/**
6 * Runtime binding for the `RestoreVolumeFromSnapshot` operation (IAM action
7 * `fsx:RestoreVolumeFromSnapshot` on `*`).
8 *
9 * Rolls an FSx for OpenZFS volume back to the state saved by a snapshot —
10 * the undo half of the runtime snapshot pattern built with
11 * {@link CreateSnapshot}. Pass `Options: ["DELETE_INTERMEDIATE_SNAPSHOTS"]`
12 * to roll back past newer snapshots. Provide the implementation with
13 * `Effect.provide(AWS.FSx.RestoreVolumeFromSnapshotHttp)`.
14 * ### Managing Snapshots at Runtime
15 * **Example:** Roll back a failed batch of writes
16 * ```typescript
17 * const restoreVolumeFromSnapshot =
18 * yield* AWS.FSx.RestoreVolumeFromSnapshot();
19 *
20 * const response = yield* restoreVolumeFromSnapshot({
21 * VolumeId: volumeId,
22 * SnapshotId: snapshot.SnapshotId!,
23 * });
24 * yield* Effect.log(`volume ${response.VolumeId} restoring`);
25 * ```
26 *
27 * @binding
28 */
29export interface RestoreVolumeFromSnapshot extends Binding.Service<
30 RestoreVolumeFromSnapshot,
31 "AWS.FSx.RestoreVolumeFromSnapshot",
32 () => Effect.Effect<
33 (
34 request: fsx.RestoreVolumeFromSnapshotRequest,
35 ) => Effect.Effect<
36 fsx.RestoreVolumeFromSnapshotResponse,
37 fsx.RestoreVolumeFromSnapshotError
38 >
39 >
40> {}
41export const RestoreVolumeFromSnapshot =
42 Binding.Service<RestoreVolumeFromSnapshot>(
43 "AWS.FSx.RestoreVolumeFromSnapshot",
44 );