UNPKG

@adpt/cloud

Version:
73 lines 2.58 kB
import { BuildData, ChangeType, DependsOnMethod, NoStatus, ObserveForStatus } from "@adpt/core"; import { Action, ActionContext, ShouldAct } from "../action"; import { ContainerStatus } from "../Container"; import { ImageInspectReport, InspectReport } from "./cli"; import { DockerContainerProps } from "./types"; /** @public */ export interface DockerContainerStatus extends ContainerStatus { } interface ContainerInfo { name: string; data?: InspectReport; image?: ImageInspectReport; } /** * Compute a unique name for the container * * @internal */ export declare const computeContainerName: (elemKey: string, elemID: string, deployID: string) => string; /** * State for DockerContainer * @internal */ interface DockerContainerState { info?: ContainerInfo; } /** * Component to instantiate an image container with docker * * @remarks * See {@link docker.DockerContainerProps}. * * @public */ export declare class DockerContainer extends Action<DockerContainerProps, DockerContainerState> { static defaultProps: { dockerHost: string | undefined; }; dependsOn: DependsOnMethod; /** @internal */ shouldAct(diff: ChangeType, context: ActionContext): Promise<false | ShouldAct>; /** @internal */ action(diff: ChangeType, context: ActionContext): Promise<void>; status(observe: ObserveForStatus, buildData: BuildData): Promise<NoStatus | ContainerStatus>; /** * Get the IP address of the container, optionally for a specific Docker * network. * @remarks * The IP addresses that are returned by this function are valid only * on the associated Docker network, which is often only associated * with a single host node for most Docker network types. * * @param network - Name of a Docker network. If `network` is provided * and the container is connected to the network with an IP address, that * address will be returned. If the container is not connected to the * network, `undefined` will be returned. If `network` is not provided, * the default container IP address will be returned. * * @beta */ dockerIP(network?: string): string | undefined; /** @internal */ initialState(): {}; private displayName; } export default DockerContainer; /** * Compute the status of a container based on a graphQL schema * * @internal */ export declare function containerStatus(observe: ObserveForStatus, containerName: string, dockerHost: string): Promise<ContainerStatus | NoStatus>; //# sourceMappingURL=DockerContainer.d.ts.map