@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
115 lines (114 loc) • 5.09 kB
TypeScript
/**
* SPDX-License-Identifier: Apache-2.0
*/
import { ShellRunner } from '../core/shell_runner.js';
import { type LeaseManager } from '../core/lease/lease_manager.js';
import { type LocalConfig } from '../core/config/local_config.js';
import { type RemoteConfigManager } from '../core/config/remote/remote_config_manager.js';
import { type Helm } from '../core/helm.js';
import { type K8Factory } from '../core/kube/k8_factory.js';
import { type ChartManager } from '../core/chart_manager.js';
import { type ConfigManager } from '../core/config_manager.js';
import { type DependencyManager } from '../core/dependency_managers/index.js';
import { type CommandFlag } from '../types/flag_types.js';
import { type Lease } from '../core/lease/lease.js';
import { Task } from '../core/task.js';
import { ConsensusNode } from '../core/model/consensus_node.js';
import { type ClusterRef, type ClusterRefs } from '../core/config/remote/types.js';
import { type SoloLogger } from '../core/logging.js';
import { type PackageDownloader } from '../core/package_downloader.js';
import { type PlatformInstaller } from '../core/platform_installer.js';
import { type KeyManager } from '../core/key_manager.js';
import { type AccountManager } from '../core/account_manager.js';
import { type ProfileManager } from '../core/profile_manager.js';
import { type CertificateManager } from '../core/certificate_manager.js';
export interface CommandHandlers {
parent: BaseCommand;
}
export interface Opts {
logger: SoloLogger;
helm: Helm;
k8Factory: K8Factory;
downloader: PackageDownloader;
platformInstaller: PlatformInstaller;
chartManager: ChartManager;
configManager: ConfigManager;
depManager: DependencyManager;
keyManager: KeyManager;
accountManager: AccountManager;
profileManager: ProfileManager;
leaseManager: LeaseManager;
certificateManager: CertificateManager;
localConfig: LocalConfig;
remoteConfigManager: RemoteConfigManager;
parent?: BaseCommand;
}
export declare abstract class BaseCommand extends ShellRunner {
protected readonly helm: Helm;
protected readonly k8Factory: K8Factory;
protected readonly chartManager: ChartManager;
protected readonly configManager: ConfigManager;
protected readonly depManager: DependencyManager;
protected readonly leaseManager: LeaseManager;
protected readonly _configMaps: Map<string, any>;
readonly localConfig: LocalConfig;
protected readonly remoteConfigManager: RemoteConfigManager;
constructor(opts: Opts);
prepareChartPath(chartDir: string, chartRepo: string, chartReleaseName: string): Promise<string>;
prepareValuesFiles(valuesFile: string): string;
/**
* Prepare the values files map for each cluster
*
* <p> Order of precedence:
* <ol>
* <li> Chart's default values file (if chartDirectory is set) </li>
* <li> Profile values file </li>
* <li> User's values file </li>
* </ol>
* @param clusterRefs - the map of cluster references
* @param valuesFileInput - the values file input string
* @param chartDirectory - the chart directory
* @param profileValuesFile - the profile values file
*/
static prepareValuesFilesMap(clusterRefs: ClusterRefs, chartDirectory?: string, profileValuesFile?: string, valuesFileInput?: string): Record<ClusterRef, string>;
getConfigManager(): ConfigManager;
getChartManager(): ChartManager;
/**
* Dynamically builds a class with properties from the provided list of flags
* and extra properties, will keep track of which properties are used. Call
* getUnusedConfigs() to get an array of unused properties.
*/
getConfig(configName: string, flags: CommandFlag[], extraProperties?: string[]): object;
getLeaseManager(): LeaseManager;
/**
* Get the list of unused configurations that were not accessed
* @returns an array of unused configurations
*/
getUnusedConfigs(configName: string): string[];
getK8Factory(): K8Factory;
getLocalConfig(): LocalConfig;
getRemoteConfigManager(): RemoteConfigManager;
abstract close(): Promise<void>;
commandActionBuilder(actionTasks: any, options: any, errorString: string, lease: Lease | null): (argv: any, commandDef: CommandHandlers) => Promise<void>;
/**
* Setup home directories
* @param dirs a list of directories that need to be created in sequence
*/
setupHomeDirectory(dirs?: string[]): string[];
setupHomeDirectoryTask(): Task;
/**
* Get the consensus nodes from the remoteConfigManager and use the localConfig to get the context
* @returns an array of ConsensusNode objects
*/
getConsensusNodes(): ConsensusNode[];
/**
* Gets a list of distinct contexts from the consensus nodes
* @returns an array of context strings
*/
getContexts(): string[];
/**
* Gets a list of distinct cluster references from the consensus nodes
* @returns an object of cluster references
*/
getClusterRefs(): ClusterRefs;
}