feat: add backup replication contracts

This commit is contained in:
2026-05-07 17:44:31 +00:00
parent dbcb75c460
commit 6f1bc574fd
2 changed files with 131 additions and 2 deletions
+95 -1
View File
@@ -1,5 +1,11 @@
import * as plugins from '../plugins.js';
import type { IBackupRecord, TBackupSnapshot } from '../data/backup.js';
import type {
IBackupArchiveManifest,
IBackupArchiveObject,
IBackupRecord,
IBackupReplicationResult,
TBackupSnapshot,
} from '../data/backup.js';
import type { IService } from '../data/service.js';
import type { IIdentity } from '../data/user.js';
@@ -78,9 +84,13 @@ extends plugins.typedrequestInterfaces.implementsTR<
backupId: string;
service: IService;
tags?: Record<string, string>;
replication?: {
enabled: boolean;
};
};
response: {
snapshots: TBackupSnapshot[];
replication?: IBackupReplicationResult;
};
}
@@ -96,8 +106,92 @@ extends plugins.typedrequestInterfaces.implementsTR<
snapshots: TBackupSnapshot[];
clear?: boolean;
resourceTypes?: Array<TBackupSnapshot['type']>;
replication?: {
enabled: boolean;
};
};
response: {
restored: TBackupSnapshot[];
};
}
export interface IReq_Coreflow_Cloudly_PrepareBackupReplication
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Coreflow_Cloudly_PrepareBackupReplication
> {
method: 'prepareBackupReplication';
request: {
identity: IIdentity;
backupId: string;
manifest: IBackupArchiveManifest;
};
response: {
missingObjects: IBackupArchiveObject[];
};
}
export interface IReq_Coreflow_Cloudly_UploadBackupArchiveObject
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Coreflow_Cloudly_UploadBackupArchiveObject
> {
method: 'uploadBackupArchiveObject';
request: {
identity: IIdentity;
backupId: string;
object: IBackupArchiveObject;
contentsBase64: string;
};
response: {
accepted: boolean;
};
}
export interface IReq_Coreflow_Cloudly_CompleteBackupReplication
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Coreflow_Cloudly_CompleteBackupReplication
> {
method: 'completeBackupReplication';
request: {
identity: IIdentity;
backupId: string;
manifest: IBackupArchiveManifest;
};
response: {
replication: IBackupReplicationResult;
};
}
export interface IReq_Coreflow_Cloudly_GetBackupArchiveManifest
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Coreflow_Cloudly_GetBackupArchiveManifest
> {
method: 'getBackupArchiveManifest';
request: {
identity: IIdentity;
backupId: string;
};
response: {
manifest: IBackupArchiveManifest;
};
}
export interface IReq_Coreflow_Cloudly_DownloadBackupArchiveObject
extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_Coreflow_Cloudly_DownloadBackupArchiveObject
> {
method: 'downloadBackupArchiveObject';
request: {
identity: IIdentity;
backupId: string;
object: IBackupArchiveObject;
};
response: {
object: IBackupArchiveObject;
contentsBase64: string;
};
}