UNPKG

docker-pilot

Version:

A powerful, scalable Docker CLI library for managing containerized applications of any size

128 lines 3.54 kB
/** * Service Manager for Docker Pilot * Manages Docker services and their lifecycle */ import { DockerPilotConfig, ServiceConfig, ServiceStatus, ProjectStatus } from '../types'; import { CommandResult } from '../types'; export interface ServiceManagerOptions { projectName?: string; composeFile?: string; workingDirectory?: string; } export declare class ServiceManager { private config; private logger; private dockerUtils; private options; private i18n; constructor(config: DockerPilotConfig, options?: ServiceManagerOptions); /** * Find Docker Compose file with enhanced search (synchronous for ServiceManager) */ private findComposeFile; /** * Check if directory should be skipped during search */ private shouldSkipDirectory; /** * Create safe options for Docker commands */ private createDockerOptions; /** * Start all services */ startAll(): Promise<CommandResult>; /** * Stop all services */ stopAll(): Promise<CommandResult>; /** * Restart all services */ restartAll(): Promise<CommandResult>; /** * Start specific service */ startService(serviceName: string): Promise<CommandResult>; /** * Stop specific service */ stopService(serviceName: string): Promise<CommandResult>; /** * Restart specific service */ restartService(serviceName: string): Promise<CommandResult>; /** * Build services */ buildServices(serviceName?: string, options?: { noCache?: boolean; pull?: boolean; }): Promise<CommandResult>; /** * Rebuild and start services */ rebuildServices(serviceName?: string): Promise<CommandResult[]>; /** * Get service logs */ getLogs(serviceName?: string, options?: { follow?: boolean; tail?: number; }): Promise<CommandResult>; /** * Execute command in service */ execInService(serviceName: string, command: string[], options?: { interactive?: boolean; user?: string; }): Promise<CommandResult | import("child_process").ChildProcess>; /** * Scale service */ scaleService(serviceName: string, replicas: number): Promise<CommandResult>; /** * Get service status */ getServiceStatus(serviceName?: string): Promise<ServiceStatus[]>; /** * Get project status */ getProjectStatus(): Promise<ProjectStatus>; /** * Display service status in a nice format */ private displayServiceStatus; /** * Check if service is configured */ private isServiceConfigured; /** * Get service configuration */ getServiceConfig(serviceName: string): ServiceConfig | null; /** * Get all configured services */ getConfiguredServices(): string[]; /** * Check if all services are running */ areAllServicesRunning(): Promise<boolean>; /** * Wait for service to be healthy */ waitForServiceHealth(serviceName: string, timeoutMs?: number, intervalMs?: number): Promise<boolean>; /** * Update service manager configuration */ updateConfig(config: DockerPilotConfig): void; /** * Update language for ServiceManager */ updateLanguage(language: string): void; /** * Sleep utility */ private sleep; /** * Get current options */ getOptions(): ServiceManagerOptions; } //# sourceMappingURL=ServiceManager.d.ts.map