UNPKG

@codai/memorai-core

Version:

Simplified advanced memory engine - no tiers, just powerful semantic search with persistence

298 lines 7.58 kB
/** * Multi-Cloud Deployment Manager * Enterprise-grade cloud deployment and orchestration across multiple cloud providers */ export interface CloudProvider { id: string; name: string; type: 'aws' | 'azure' | 'gcp' | 'private'; region: string; credentials: CloudCredentials; endpoints: CloudEndpoints; capabilities: CloudCapabilities; status: 'active' | 'inactive' | 'maintenance' | 'error'; healthScore: number; lastHealthCheck: Date; } export interface CloudCredentials { type: 'iam' | 'service-account' | 'access-key' | 'certificate'; keyId?: string; secretKey?: string; token?: string; certificatePath?: string; region?: string; } export interface CloudEndpoints { api: string; storage: string; database: string; monitoring: string; logging: string; } export interface CloudCapabilities { compute: boolean; storage: boolean; database: boolean; ai: boolean; monitoring: boolean; networking: boolean; security: boolean; backup: boolean; } export interface DeploymentTarget { id: string; name: string; providerId: string; environment: 'development' | 'staging' | 'production'; resources: CloudResource[]; configuration: DeploymentConfiguration; status: DeploymentStatus; metrics: DeploymentMetrics; } export interface CloudResource { id: string; type: 'compute' | 'storage' | 'database' | 'network' | 'security'; name: string; specification: any; status: 'provisioning' | 'running' | 'stopped' | 'error' | 'terminated'; cost: ResourceCost; tags: string[]; } export interface ResourceCost { hourly: number; monthly: number; currency: string; lastUpdated: Date; } export interface DeploymentConfiguration { scaling: { minInstances: number; maxInstances: number; targetCPU: number; targetMemory: number; autoScaling: boolean; }; networking: { vpc: string; subnets: string[]; loadBalancer: boolean; ssl: boolean; }; security: { encryption: boolean; accessControl: boolean; firewall: boolean; monitoring: boolean; }; backup: { enabled: boolean; frequency: 'hourly' | 'daily' | 'weekly'; retention: number; crossRegion: boolean; }; } export interface DeploymentStatus { phase: 'planning' | 'provisioning' | 'deploying' | 'running' | 'scaling' | 'maintenance' | 'error'; progress: number; lastDeployment: Date; uptime: number; errors: DeploymentError[]; } export interface DeploymentError { id: string; timestamp: Date; severity: 'low' | 'medium' | 'high' | 'critical'; component: string; message: string; resolved: boolean; } export interface DeploymentMetrics { cpu: { usage: number; average: number; peak: number; }; memory: { usage: number; available: number; peak: number; }; network: { inbound: number; outbound: number; latency: number; }; requests: { total: number; successful: number; failed: number; responseTime: number; }; costs: { current: number; projected: number; budget: number; alerts: CostAlert[]; }; } export interface CostAlert { id: string; threshold: number; current: number; severity: 'warning' | 'critical'; timestamp: Date; } export interface DisasterRecoveryPlan { id: string; name: string; primaryProvider: string; backupProviders: string[]; rto: number; rpo: number; triggers: DisasterTrigger[]; procedures: RecoveryProcedure[]; lastTested: Date; testResults: TestResult[]; } export interface DisasterTrigger { type: 'availability' | 'performance' | 'security' | 'manual'; threshold: number; conditions: string[]; autoActivate: boolean; } export interface RecoveryProcedure { id: string; name: string; order: number; type: 'automated' | 'manual'; script?: string; documentation: string; estimatedTime: number; } export interface TestResult { id: string; date: Date; success: boolean; rtoAchieved: number; rpoAchieved: number; issues: string[]; recommendations: string[]; } export declare class MultiCloudDeploymentManager { private providers; private deployments; private disasterRecoveryPlans; private healthCheckInterval; private costMonitoringInterval; private metricsCollectionInterval; constructor(); /** * Initialize cloud providers with default configurations */ private initializeCloudProviders; /** * Create a new deployment across multiple cloud providers */ createMultiCloudDeployment(name: string, environment: DeploymentTarget['environment'], primaryProvider: string, backupProviders: string[], configuration?: Partial<DeploymentConfiguration>): Promise<DeploymentTarget>; /** * Execute deployment across cloud providers */ private executeDeployment; /** * Provision cloud resources */ private provisionResources; /** * Configure networking */ private configureNetworking; /** * Configure security */ private configureSecurity; /** * Deploy application */ private deployApplication; /** * Create backup deployment in secondary provider */ private createBackupDeployment; /** * Create disaster recovery plan */ createDisasterRecoveryPlan(name: string, primaryProvider: string, backupProviders: string[], rto?: number, // 15 minutes rpo?: number): Promise<DisasterRecoveryPlan>; /** * Execute disaster recovery */ executeDisasterRecovery(planId: string, reason: string): Promise<boolean>; /** * Get deployment analytics */ getDeploymentAnalytics(): { overview: { totalDeployments: number; runningDeployments: number; totalResources: number; totalMonthlyCost: number; }; providerDistribution: { provider: string; deployments: number; cost: number; }[]; resourceUtilization: { type: string; count: number; utilization: number; }[]; costTrends: { date: string; cost: number; }[]; healthStatus: { provider: string; health: number; status: string; }[]; }; /** * Start health monitoring */ private startHealthMonitoring; /** * Start cost monitoring */ private startCostMonitoring; /** * Start metrics collection */ private startMetricsCollection; /** * Check provider health */ private checkProviderHealth; /** * Update cost metrics */ private updateCostMetrics; /** * Collect deployment metrics */ private collectDeploymentMetrics; private initializeMetrics; private executeScript; private waitFor; private generateDeploymentId; private generateResourceId; private generatePlanId; private generateTestId; private generateErrorId; private generateAlertId; /** * Cleanup resources on shutdown */ shutdown(): Promise<void>; } //# sourceMappingURL=MultiCloudDeploymentManager.d.ts.map