iop
Version:
Ship Docker Anywhere
58 lines (57 loc) • 2.29 kB
TypeScript
import { DockerClient } from "../docker";
/**
* Client for interacting with the iop-proxy service
*/
export declare class IopProxyClient {
private dockerClient;
private serverHostname?;
private verbose;
/**
* Create a new IopProxyClient
* @param dockerClient An initialized DockerClient for the target server
* @param serverHostname The hostname of the server (for logging purposes)
* @param verbose Whether to enable verbose logging
*/
constructor(dockerClient: DockerClient, serverHostname?: string, verbose?: boolean);
/**
* Log a message with server hostname prefix (only in verbose mode)
*/
private log;
/**
* Log an error with server hostname prefix
*/
private logError;
/**
* Check if the iop-proxy container is running
* @returns true if the iop-proxy container exists and is running
*/
isProxyRunning(): Promise<boolean>;
/**
* Configure the iop-proxy to route traffic from a host to a target container
* @param host The hostname to route traffic from (e.g., api.example.com)
* @param targetContainer The container name to route traffic to
* @param targetPort The port on the target container
* @param projectName The name of the project (used for network connectivity)
* @param healthPath The health check endpoint path (default: "/up")
* @returns true if the configuration was successful
*/
configureProxy(host: string, targetContainer: string, targetPort: number, projectName: string, healthPath?: string): Promise<boolean>;
/**
* Remove a host configuration from the iop-proxy
* @param host The hostname to remove
* @returns true if the removal was successful
*/
removeProxyConfig(host: string): Promise<boolean>;
/**
* List all proxy configurations
* @returns The output of the list command if successful, or null if it fails
*/
listProxyConfigs(): Promise<string | null>;
/**
* Update the health status of a service in the proxy
* @param host The hostname to update
* @param healthy Whether the service is healthy
* @returns true if the update was successful
*/
updateServiceHealth(host: string, healthy: boolean): Promise<boolean>;
}