import type { DockerHost } from './classes.host.js'; import type { TLabels } from './interfaces/label.js'; import type { IDockerGlobalJobCompletionProof, IDockerGlobalJobCompletionProofOptions, IDockerServiceSpecMode, IDockerServiceStopProofOptions, IDockerServiceStoppedImagePinOptions, IDockerServiceTask, IServiceCreationDescriptor } from './interfaces/service.js'; import { DockerResource } from './classes.base.js'; import { DockerImage } from './classes.image.js'; export declare class DockerService extends DockerResource { /** * Internal: Get all services * Public API: Use dockerHost.listServices() instead */ static _list(dockerHost: DockerHost): Promise; /** * Internal: Get service by ID through direct inspection. */ static _fromId(dockerHostArg: DockerHost, idArg: string): Promise; /** * Internal: Get service by name * Public API: Use dockerHost.getServiceByName(name) instead */ static _fromName(dockerHost: DockerHost, networkName: string): Promise; /** * Internal: Create a service * Public API: Use dockerHost.createService(descriptor) instead */ static _create(dockerHost: DockerHost, serviceCreationDescriptor: IServiceCreationDescriptor): Promise; ID: string; Version: { Index: number; }; CreatedAt: string; UpdatedAt: string; Spec: { Name: string; Labels: TLabels; TaskTemplate: { ContainerSpec: { Image: string; Isolation: string; Command?: string[]; Args?: string[]; Mounts?: Array<{ Target?: string; Source?: string; Type?: string; ReadOnly?: boolean; Consistency?: string; BindOptions?: Record; }>; Secrets: Array<{ File: { Name: string; UID: string; GID: string; Mode: number; }; SecretID: string; SecretName: string; }>; Configs?: Array<{ File: { Name: string; UID: string; GID: string; Mode: number; }; ConfigID: string; ConfigName: string; }>; }; ForceUpdate: 0; RestartPolicy?: { Condition?: string; Delay?: number; MaxAttempts?: number; Window?: number; }; Placement?: { Constraints?: string[]; Platforms?: Array<{ Architecture?: string; OS?: string; }>; }; Networks: Array<{ Target: string; Aliases: string[]; }>; }; Mode: IDockerServiceSpecMode; }; JobStatus?: { JobIteration?: { Index?: number; }; LastExecution?: string; }; Endpoint: { Spec: {}; VirtualIPs: [any[]]; }; constructor(dockerHostArg: DockerHost); /** * Refreshes this service's state from the Docker daemon */ refresh(): Promise; /** * Removes this service from the Docker daemon */ remove(): Promise; /** * Re-reads service data from Docker engine * @deprecated Use refresh() instead */ reReadFromDockerEngine(): Promise; /** * Lists tasks for this swarm service. */ listTasks(optionsArg?: { onlyRunning?: boolean; }): Promise; /** * Proves one exact GlobalJob execution completed once on every authoritative target node. */ proveGlobalJobCompletion(optionsArg: IDockerGlobalJobCompletionProofOptions): Promise; private static normalizeGlobalJobProofOptions; private static requireGlobalJobProofSpec; private static requireGlobalJobTaskSpec; /** * Scales an exact replicated service to zero and proves every exact-ID task is terminal. * A vanished service is accepted only after its exact-ID task inventory is also terminal. * Optional version and service-label preconditions are checked on the fresh exact-ID * inspection before either an update or already-stopped proof is accepted. */ stopAndProveStopped(optionsArg?: IDockerServiceStopProofOptions): Promise; /** * Pins a stopped replicated service to an immutable repository digest. */ pinStoppedImage(optionsArg: IDockerServiceStoppedImagePinOptions): Promise; private static requireReplicatedStopSpec; private static requireStoppedImagePinSpec; private static assertExactTerminalTasks; private static listTasksByExactServiceId; private hasExactStoppedProof; /** * Gets image IDs for currently running tasks of this service. */ getRunningTaskImageIds(): Promise; /** * Checks if this service needs an image update. */ needsUpdate(desiredImageArg: DockerImage): Promise; private getTaskContainerImageId; private static normalizeImageId; }