Files
corestore/ts/corestore.interfaces.ts
T

119 lines
2.7 KiB
TypeScript

export type TCoreStoreCapability = 'database' | 'objectstorage';
export interface ICoreStoreVolumeCreateRequest {
name: string;
opts?: Record<string, string>;
options?: Record<string, string>;
serviceId?: string;
serviceName?: string;
mountPath?: string;
backup?: boolean;
}
export interface ICoreStoreVolumeRemoveRequest {
name: string;
}
export interface ICoreStoreVolumeSnapshotRequest {
name: string;
tags?: Record<string, string>;
snapshotName?: string;
}
export interface ICoreStoreVolumeRestoreRequest {
name: string;
snapshotId: string;
clear?: boolean;
}
export interface ICoreStoreProvisionRequest {
serviceId: string;
serviceName?: string;
capabilities?: TCoreStoreCapability[];
database?: boolean;
db?: boolean;
objectstorage?: boolean;
s3?: boolean;
}
export interface ICoreStoreDeprovisionRequest {
serviceId: string;
}
export interface ICoreStoreResourceBase {
capability: TCoreStoreCapability;
provider: string;
resourceName: string;
env: Record<string, string>;
createdAt: number;
}
export interface ICoreStoreDatabaseResource extends ICoreStoreResourceBase {
capability: 'database';
provider: 'smartdb';
databaseName: string;
username: string;
}
export interface ICoreStoreObjectStorageResource extends ICoreStoreResourceBase {
capability: 'objectstorage';
provider: 'smartstorage';
bucketName: string;
accessKeyId: string;
}
export type TCoreStoreResource = ICoreStoreDatabaseResource | ICoreStoreObjectStorageResource;
export interface ICoreStoreServiceManifestEntry {
serviceId: string;
serviceName?: string;
resources: Partial<Record<TCoreStoreCapability, TCoreStoreResource>>;
env: Record<string, string>;
createdAt: number;
updatedAt: number;
}
export interface ICoreStoreVolumeSnapshotEntry {
snapshotId: string;
snapshotName?: string;
createdAt: number;
originalSize: number;
storedSize: number;
tags: Record<string, string>;
}
export interface ICoreStoreVolumeManifestEntry {
name: string;
directoryName: string;
mountpoint: string;
options: Record<string, string>;
serviceId?: string;
serviceName?: string;
mountPath?: string;
backup: boolean;
mountIds: string[];
snapshots: ICoreStoreVolumeSnapshotEntry[];
createdAt: number;
updatedAt: number;
}
export interface ICoreStoreManifest {
version: 1;
services: Record<string, ICoreStoreServiceManifestEntry>;
volumes: Record<string, ICoreStoreVolumeManifestEntry>;
}
export interface ICoreStoreProvisionResponse {
serviceId: string;
serviceName?: string;
resources: TCoreStoreResource[];
env: Record<string, string>;
}
export interface ICoreStoreSecretFile {
masterSecret: string;
dbRootPassword: string;
s3AdminAccessKeyId: string;
s3AdminSecretAccessKey: string;
}