feat: add backup contracts
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import type { IBackupRecord, TBackupSnapshot } from '../data/backup.js';
|
||||
import type { IService } from '../data/service.js';
|
||||
import type { IIdentity } from '../data/user.js';
|
||||
|
||||
export interface IReq_Any_Cloudly_CreateServiceBackup
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Any_Cloudly_CreateServiceBackup
|
||||
> {
|
||||
method: 'createServiceBackup';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
serviceId: string;
|
||||
clusterId?: string;
|
||||
tags?: Record<string, string>;
|
||||
};
|
||||
response: {
|
||||
backup: IBackupRecord;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_Any_Cloudly_GetServiceBackups
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Any_Cloudly_GetServiceBackups
|
||||
> {
|
||||
method: 'getServiceBackups';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
serviceId?: string;
|
||||
status?: IBackupRecord['status'];
|
||||
};
|
||||
response: {
|
||||
backups: IBackupRecord[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_Any_Cloudly_GetBackupById
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Any_Cloudly_GetBackupById
|
||||
> {
|
||||
method: 'getBackupById';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
backupId: string;
|
||||
};
|
||||
response: {
|
||||
backup: IBackupRecord;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_Any_Cloudly_RestoreServiceBackup
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Any_Cloudly_RestoreServiceBackup
|
||||
> {
|
||||
method: 'restoreServiceBackup';
|
||||
request: {
|
||||
identity: IIdentity;
|
||||
backupId: string;
|
||||
clear?: boolean;
|
||||
resourceTypes?: Array<TBackupSnapshot['type']>;
|
||||
};
|
||||
response: {
|
||||
backup: IBackupRecord;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_Cloudly_Coreflow_ExecuteServiceBackup
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Cloudly_Coreflow_ExecuteServiceBackup
|
||||
> {
|
||||
method: 'executeServiceBackup';
|
||||
request: {
|
||||
backupId: string;
|
||||
service: IService;
|
||||
tags?: Record<string, string>;
|
||||
};
|
||||
response: {
|
||||
snapshots: TBackupSnapshot[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_Cloudly_Coreflow_ExecuteServiceRestore
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Cloudly_Coreflow_ExecuteServiceRestore
|
||||
> {
|
||||
method: 'executeServiceRestore';
|
||||
request: {
|
||||
backupId: string;
|
||||
service: IService;
|
||||
snapshots: TBackupSnapshot[];
|
||||
clear?: boolean;
|
||||
resourceTypes?: Array<TBackupSnapshot['type']>;
|
||||
};
|
||||
response: {
|
||||
restored: TBackupSnapshot[];
|
||||
};
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import * as plugins from '../plugins.js';
|
||||
|
||||
import * as adminRequests from './admin.js';
|
||||
import * as baremetalRequests from './baremetal.js';
|
||||
import * as backupRequests from './backup.js';
|
||||
import * as certificateRequests from './certificate.js';
|
||||
import * as clusterRequests from './cluster.js';
|
||||
import * as configRequests from './config.js';
|
||||
@@ -29,6 +30,7 @@ import * as versionRequests from './version.js';
|
||||
export {
|
||||
adminRequests as admin,
|
||||
baremetalRequests as baremetal,
|
||||
backupRequests as backup,
|
||||
certificateRequests as certificate,
|
||||
clusterRequests as cluster,
|
||||
configRequests as config,
|
||||
|
||||
Reference in New Issue
Block a user