feat(backup): Add backup scheduling system with GFS retention, API and UI integration
This commit is contained in:
@@ -22,6 +22,8 @@ import type {
|
||||
IRestoreResult,
|
||||
TPlatformServiceType,
|
||||
IPlatformResource,
|
||||
IBackupCreateOptions,
|
||||
TRetentionTier,
|
||||
} from '../types.ts';
|
||||
import { logger } from '../logging.ts';
|
||||
import { getErrorMessage } from '../utils/error.ts';
|
||||
@@ -45,8 +47,10 @@ export class BackupManager {
|
||||
|
||||
/**
|
||||
* Create a backup for a service
|
||||
* @param serviceName - Name of the service to backup
|
||||
* @param options - Optional backup creation options (scheduleId)
|
||||
*/
|
||||
async createBackup(serviceName: string): Promise<IBackupResult> {
|
||||
async createBackup(serviceName: string, options?: IBackupCreateOptions): Promise<IBackupResult> {
|
||||
const service = this.oneboxRef.database.getServiceByName(serviceName);
|
||||
if (!service) {
|
||||
throw new Error(`Service not found: ${serviceName}`);
|
||||
@@ -181,6 +185,7 @@ export class BackupManager {
|
||||
includesImage: includeImage,
|
||||
platformResources: resourceTypes,
|
||||
checksum,
|
||||
scheduleId: options?.scheduleId,
|
||||
};
|
||||
|
||||
const createdBackup = this.oneboxRef.database.createBackup(backup);
|
||||
|
||||
Reference in New Issue
Block a user