UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

125 lines (124 loc) 4.34 kB
import { BaseCommand } from './base.js'; import { type ArgvStruct } from '../types/aliases.js'; import { type CommandFlags } from '../types/flag-types.js'; import { type DefaultKindClientBuilder } from '../integration/kind/impl/default-kind-client-builder.js'; export declare class BackupRestoreCommand extends BaseCommand { protected readonly kindBuilder: DefaultKindClientBuilder; private readonly kubectlInstallationDirectory; constructor(kindBuilder: DefaultKindClientBuilder, kubectlInstallationDirectory: string); close(): Promise<void>; static BACKUP_FLAGS_LIST: CommandFlags; static RESTORE_CONFIG_FLAGS_LIST: CommandFlags; static RESTORE_CLUSTERS_FLAGS_LIST: CommandFlags; static RESTORE_NETWORK_FLAGS_LIST: CommandFlags; /** * Generic export function for Kubernetes resources from multiple clusters * @param outputDirectory - directory to export resources to * @param resourceType - type of resource ('configmaps' or 'secrets') * @returns total number of resources exported across all clusters */ private exportResources; private waitForConsensusPods; /** * Export all configmaps from the cluster as YAML files * @param outputDirectory - directory to export configmaps to * @returns number of configmaps exported */ private exportConfigMaps; /** * Export all secrets from the cluster as YAML files * @param outputDirectory - directory to export secrets to * @returns number of secrets exported */ private exportSecrets; /** * Backup all component configurations */ backup(argv: ArgvStruct): Promise<boolean>; /** * Generic import function for Kubernetes resources from multiple clusters * @param inputDirectory - directory to import resources from * @param resourceType - type of resource ('configmaps' or 'secrets') * @returns total number of resources imported across all clusters */ private importResources; /** * Import all configmaps to the cluster from YAML files * @param inputDirectory - directory to import configmaps from * @returns number of configmaps imported */ private importConfigMaps; /** * Import all secrets to the cluster from YAML files * @param inputDirectory - directory to import secrets from * @returns number of secrets imported */ private importSecrets; /** * Restore logs and configs to consensus nodes * @param inputDirectory - directory containing logs * @returns Promise that resolves when restoration is complete */ private restoreLogsAndConfigs; /** * Restore all component configurations * Command: solo config ops restore-config */ restoreConfig(argv: ArgvStruct): Promise<boolean>; /** * Read the remote config from a local YAML file */ private readRemoteConfigFile; /** * Parse the config data and instantiate RemoteConfig object */ private parseRemoteConfig; private buildDeploymentTasks; /** * Build block node deployment tasks */ private buildBlockNodeTasks; /** * Build mirror node deployment tasks */ private buildMirrorNodeTasks; /** * Build relay node deployment tasks */ private buildRelayNodeTasks; /** * Build explorer deployment tasks */ private buildExplorerTasks; /** * Build scan backup directory task */ private buildScanBackupDirectoryTask; /** * Build shared initialization task for restore commands */ private buildInitializationTask; private extractEncryptedBackup; /** * Build create Kind clusters tasks */ private buildKindNetworkTask; /** * Build individual cluster creation tasks */ private buildIndividualClusterCreationTasks; /** * Build cluster initialization tasks */ private buildClusterInitializationTasks; /** * Restore Kind clusters from backup directory structure * Command: solo config ops restore-clusters */ restoreClusters(argv: ArgvStruct): Promise<boolean>; /** * Deploy network components to existing clusters from backup * Command: solo config ops restore-network */ restoreNetwork(argv: ArgvStruct): Promise<boolean>; }