UNPKG

@apiclient.xyz/docker

Version:

Provides easy communication with Docker remote API from Node.js, with TypeScript support.

75 lines (74 loc) 2.26 kB
import * as interfaces from './interfaces/index.js'; import { DockerHost } from './classes.host.js'; import { DockerResource } from './classes.base.js'; export declare class DockerService extends DockerResource { /** * Internal: Get all services * Public API: Use dockerHost.listServices() instead */ static _list(dockerHost: DockerHost): Promise<DockerService[]>; /** * Internal: Get service by name * Public API: Use dockerHost.getServiceByName(name) instead */ static _fromName(dockerHost: DockerHost, networkName: string): Promise<DockerService>; /** * Internal: Create a service * Public API: Use dockerHost.createService(descriptor) instead */ static _create(dockerHost: DockerHost, serviceCreationDescriptor: interfaces.IServiceCreationDescriptor): Promise<DockerService>; ID: string; Version: { Index: number; }; CreatedAt: string; UpdatedAt: string; Spec: { Name: string; Labels: interfaces.TLabels; TaskTemplate: { ContainerSpec: { Image: string; Isolation: string; Secrets: Array<{ File: { Name: string; UID: string; GID: string; Mode: number; }; SecretID: string; SecretName: string; }>; }; ForceUpdate: 0; Networks: Array<{ Target: string; Aliases: string[]; }>; }; Mode: {}; }; Endpoint: { Spec: {}; VirtualIPs: [any[]]; }; constructor(dockerHostArg: DockerHost); /** * Refreshes this service's state from the Docker daemon */ refresh(): Promise<void>; /** * Removes this service from the Docker daemon */ remove(): Promise<void>; /** * Re-reads service data from Docker engine * @deprecated Use refresh() instead */ reReadFromDockerEngine(): Promise<void>; /** * Checks if this service needs an update based on image version */ needsUpdate(): Promise<boolean>; }