the-moby-effect
Version:
Moby/Docker API client built using effect-ts
292 lines • 15.5 kB
TypeScript
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Schema from "effect/Schema";
import * as HttpClient from "effect/unstable/http/HttpClient";
import * as HttpApi from "effect/unstable/httpapi/HttpApi";
import * as HttpApiEndpoint from "effect/unstable/httpapi/HttpApiEndpoint";
import * as HttpApiGroup from "effect/unstable/httpapi/HttpApiGroup";
import * as HttpApiSchema from "effect/unstable/httpapi/HttpApiSchema";
import { VolumeClusterVolumeSpec as ClusterVolumeSpec, VolumeVolume as Volume, VolumeCreateOptions } from "../generated/index.ts";
import { DockerError } from "./circular.ts";
import { BadRequest, Conflict, InternalServerError, NotFound, ServiceUnavailable } from "./errors.ts";
/** @since 1.0.0 */
export declare const ListFilters: Schema.fromJsonString<Schema.Struct<{
readonly name: Schema.optional<Schema.$Array<Schema.String>>;
readonly driver: Schema.optional<Schema.$Array<Schema.String>>;
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
readonly dangling: Schema.optional<Schema.$Array<Schema.Literals<readonly ["true", "false", "1", "0"]>>>;
}>>;
/** @since 1.0.0 */
export declare const PruneFilters: Schema.fromJsonString<Schema.Struct<{
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
readonly all: Schema.optional<Schema.$Array<Schema.Literals<readonly ["true", "false", "1", "0"]>>>;
}>>;
/**
* @since 1.0.0
* @category HttpApi
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Volume
*/
export declare const VolumesApi: HttpApi.HttpApi<"VolumesApi", HttpApiGroup.HttpApiGroup<"volumes", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", "/volumes/create", never, never, Schema.toCodecJson<typeof VolumeCreateOptions>, never, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<Volume, {
readonly ClusterVolume?: {
readonly Version?: {
readonly Index?: string | undefined;
} | null | undefined;
readonly CreatedAt?: string | null | undefined;
readonly UpdatedAt?: string | null | undefined;
readonly ID: string;
readonly Spec: {
readonly Group?: string | undefined;
readonly AccessMode?: {
readonly Scope?: "multi" | "single" | undefined;
readonly Sharing?: "all" | "none" | "onewriter" | "readonly" | undefined;
readonly MountVolume?: {
readonly FsType?: string | undefined;
readonly MountFlags?: readonly string[] | null | undefined;
} | null | undefined;
readonly BlockVolume?: {} | null | undefined;
} | null | undefined;
readonly AccessibilityRequirements?: {
readonly Requisite?: readonly ({
readonly Segments?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
readonly Preferred?: readonly ({
readonly Segments?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
} | null | undefined;
readonly CapacityRange?: {
readonly RequiredBytes: string;
readonly LimitBytes: string;
} | null | undefined;
readonly Secrets?: readonly ({
readonly Key: string;
readonly Secret: string;
} | null)[] | null | undefined;
readonly Availability?: "active" | "drain" | "pause" | undefined;
} | null;
readonly PublishStatus?: readonly ({
readonly NodeID?: string | undefined;
readonly State?: "pending-controller-unpublish" | "pending-node-unpublish" | "pending-publish" | "published" | undefined;
readonly PublishContext?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
readonly Info?: {
readonly CapacityBytes?: string | undefined;
readonly VolumeContext?: {
readonly [x: string]: string;
} | null | undefined;
readonly VolumeID?: string | undefined;
readonly AccessibleTopology?: readonly ({
readonly Segments?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
} | null | undefined;
} | null | undefined;
readonly CreatedAt?: string | undefined;
readonly Driver: string;
readonly Labels: {
readonly [x: string]: string;
} | null;
readonly Mountpoint: string;
readonly Name: string;
readonly Options: {
readonly [x: string]: string;
} | null;
readonly Scope: string;
readonly Status?: {
readonly [x: string]: object;
} | null | undefined;
readonly UsageData?: {
readonly RefCount: string;
readonly Size: string;
} | null | undefined;
}, readonly [Schema.Struct<{
readonly ClusterVolume: Schema.optional<Schema.NullOr<typeof import("../generated/VolumeClusterVolume.generated.ts").VolumeClusterVolume>>;
readonly CreatedAt: Schema.optional<Schema.DateFromString>;
readonly Driver: Schema.String;
readonly Labels: Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>;
readonly Mountpoint: Schema.String;
readonly Name: Schema.brand<Schema.String, "VolumeId">;
readonly Options: Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>;
readonly Scope: Schema.String;
readonly Status: Schema.optional<Schema.NullOr<Schema.$Record<Schema.String, Schema.ObjectKeyword>>>;
readonly UsageData: Schema.optional<Schema.NullOr<typeof import("../generated/VolumeUsageData.generated.ts").VolumeUsageData>>;
}>], {
readonly ClusterVolume?: {
readonly Version?: {
readonly Index?: bigint | undefined;
} | null | undefined;
readonly CreatedAt?: Date | null | undefined;
readonly UpdatedAt?: Date | null | undefined;
readonly ID: string;
readonly Spec: {
readonly Group?: string | undefined;
readonly AccessMode?: {
readonly Scope?: "multi" | "single" | undefined;
readonly Sharing?: "all" | "none" | "onewriter" | "readonly" | undefined;
readonly MountVolume?: {
readonly FsType?: string | undefined;
readonly MountFlags?: readonly string[] | null | undefined;
} | null | undefined;
readonly BlockVolume?: {} | null | undefined;
} | null | undefined;
readonly AccessibilityRequirements?: {
readonly Requisite?: readonly ({
readonly Segments?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
readonly Preferred?: readonly ({
readonly Segments?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
} | null | undefined;
readonly CapacityRange?: {
readonly RequiredBytes: bigint;
readonly LimitBytes: bigint;
} | null | undefined;
readonly Secrets?: readonly ({
readonly Key: string;
readonly Secret: string;
} | null)[] | null | undefined;
readonly Availability?: "active" | "drain" | "pause" | undefined;
} | null;
readonly PublishStatus?: readonly ({
readonly NodeID?: (string & import("effect/Brand").Brand<"NodeId">) | undefined;
readonly State?: "pending-controller-unpublish" | "pending-node-unpublish" | "pending-publish" | "published" | undefined;
readonly PublishContext?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
readonly Info?: {
readonly CapacityBytes?: bigint | undefined;
readonly VolumeContext?: {
readonly [x: string]: string;
} | null | undefined;
readonly VolumeID?: string | undefined;
readonly AccessibleTopology?: readonly ({
readonly Segments?: {
readonly [x: string]: string;
} | null | undefined;
} | null)[] | null | undefined;
} | null | undefined;
} | null | undefined;
readonly CreatedAt?: Date | undefined;
readonly Driver: string;
readonly Labels: {
readonly [x: string]: string;
} | null;
readonly Mountpoint: string;
readonly Name: string & import("effect/Brand").Brand<"VolumeId">;
readonly Options: {
readonly [x: string]: string;
} | null;
readonly Scope: string;
readonly Status?: {
readonly [x: string]: object;
} | null | undefined;
readonly UsageData?: {
readonly RefCount: bigint;
readonly Size: bigint;
} | null | undefined;
}>, Schema.Struct<{
readonly ClusterVolume: Schema.optional<Schema.NullOr<typeof import("../generated/VolumeClusterVolume.generated.ts").VolumeClusterVolume>>;
readonly CreatedAt: Schema.optional<Schema.DateFromString>;
readonly Driver: Schema.String;
readonly Labels: Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>;
readonly Mountpoint: Schema.String;
readonly Name: Schema.brand<Schema.String, "VolumeId">;
readonly Options: Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>;
readonly Scope: Schema.String;
readonly Status: Schema.optional<Schema.NullOr<Schema.$Record<Schema.String, Schema.ObjectKeyword>>>;
readonly UsageData: Schema.optional<Schema.NullOr<typeof import("../generated/VolumeUsageData.generated.ts").VolumeUsageData>>;
}>, never, never>>, Schema.toCodecJson<typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", "/volumes/:name", Schema.toCodecStringTree<Schema.Struct<{
name: Schema.String;
}>>, Schema.toCodecStringTree<Schema.Struct<{
force: Schema.optional<Schema.Boolean>;
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof NotFound | typeof Conflict | typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"inspect", "GET", "/volumes/:name", Schema.toCodecStringTree<Schema.Struct<{
name: Schema.String;
}>>, never, never, never, Schema.toCodecJson<typeof Volume>, Schema.toCodecJson<typeof NotFound | typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", "/volumes/", never, Schema.toCodecStringTree<Schema.Struct<{
filters: Schema.optional<Schema.fromJsonString<Schema.Struct<{
readonly name: Schema.optional<Schema.$Array<Schema.String>>;
readonly driver: Schema.optional<Schema.$Array<Schema.String>>;
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
readonly dangling: Schema.optional<Schema.$Array<Schema.Literals<readonly ["true", "false", "1", "0"]>>>;
}>>>;
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
readonly Volumes: Schema.$Array<typeof Volume>;
readonly Warnings: Schema.NullOr<Schema.$Array<Schema.String>>;
}>>, Schema.toCodecJson<typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"prune", "POST", "/volumes/prune", never, Schema.toCodecStringTree<Schema.Struct<{
filters: Schema.optional<Schema.fromJsonString<Schema.Struct<{
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
readonly all: Schema.optional<Schema.$Array<Schema.Literals<readonly ["true", "false", "1", "0"]>>>;
}>>>;
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
readonly VolumesDeleted: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "VolumeId">>>;
readonly SpaceReclaimed: Schema.BigIntFromString;
}>>, Schema.toCodecJson<typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"update", "PUT", "/volumes/:name", Schema.toCodecStringTree<Schema.Struct<{
name: Schema.String;
}>>, Schema.toCodecStringTree<Schema.Struct<{
version: Schema.Number;
}>>, Schema.toCodecJson<typeof ClusterVolumeSpec>, never, Schema.toCodecJson<Schema.Void>, Schema.toCodecJson<typeof BadRequest | typeof NotFound | typeof InternalServerError | typeof ServiceUnavailable>, never, never>, false>>;
declare const Volumes_base: Context.ServiceClass<Volumes, "@the-moby-effect/endpoints/Volumes", {
list: (filters?: Schema.Schema.Type<typeof ListFilters>) => Effect.Effect<{
readonly Volumes: readonly Volume[];
readonly Warnings: readonly string[] | null;
}, DockerError, never>;
create: (options: (typeof VolumeCreateOptions)["~type.make.in"]) => Effect.Effect<Volume, DockerError, never>;
inspect: (name: string) => Effect.Effect<Volume, DockerError, never>;
delete: (name: string, options?: {
force?: boolean | undefined;
} | undefined) => Effect.Effect<void, DockerError, never>;
update: (name: string, version: number, spec: (typeof ClusterVolumeSpec)["~type.make.in"]) => Effect.Effect<void, DockerError, never>;
prune: (filters?: Schema.Schema.Type<typeof PruneFilters>) => Effect.Effect<{
readonly VolumesDeleted?: readonly (string & import("effect/Brand").Brand<"VolumeId">)[] | undefined;
readonly SpaceReclaimed: bigint;
}, DockerError, never>;
}> & {
readonly make: Effect.Effect<{
list: (filters?: Schema.Schema.Type<typeof ListFilters>) => Effect.Effect<{
readonly Volumes: readonly Volume[];
readonly Warnings: readonly string[] | null;
}, DockerError, never>;
create: (options: (typeof VolumeCreateOptions)["~type.make.in"]) => Effect.Effect<Volume, DockerError, never>;
inspect: (name: string) => Effect.Effect<Volume, DockerError, never>;
delete: (name: string, options?: {
force?: boolean | undefined;
} | undefined) => Effect.Effect<void, DockerError, never>;
update: (name: string, version: number, spec: (typeof ClusterVolumeSpec)["~type.make.in"]) => Effect.Effect<void, DockerError, never>;
prune: (filters?: Schema.Schema.Type<typeof PruneFilters>) => Effect.Effect<{
readonly VolumesDeleted?: readonly (string & import("effect/Brand").Brand<"VolumeId">)[] | undefined;
readonly SpaceReclaimed: bigint;
}, DockerError, never>;
}, never, HttpClient.HttpClient>;
};
/**
* @since 1.0.0
* @category Services
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Volume
*/
export declare class Volumes extends Volumes_base {
}
/**
* @since 1.0.0
* @category Layers
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Volume
*/
export declare const VolumesLayer: Layer.Layer<Volumes, never, HttpClient.HttpClient>;
/**
* @since 1.0.0
* @category Layers
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Volume
*/
export declare const VolumesLayerLocalSocket: Layer.Layer<Volumes, never, HttpClient.HttpClient>;
export {};
//# sourceMappingURL=volumes.d.ts.map