pub struct BackupService { /* private fields */ }Expand description
Backup service for managing workspace backups
Implementations§
Source§impl BackupService
impl BackupService
Sourcepub fn new(
db: Pool<Sqlite>,
local_backup_dir: Option<String>,
core_bridge: Arc<CoreBridge>,
workspace_service: Arc<WorkspaceService>,
) -> Self
pub fn new( db: Pool<Sqlite>, local_backup_dir: Option<String>, core_bridge: Arc<CoreBridge>, workspace_service: Arc<WorkspaceService>, ) -> Self
Create a new backup service
Sourcepub async fn backup_workspace(
&self,
workspace_id: Uuid,
user_id: Uuid,
storage_backend: StorageBackend,
format: Option<String>,
commit_id: Option<Uuid>,
) -> Result<WorkspaceBackup>
pub async fn backup_workspace( &self, workspace_id: Uuid, user_id: Uuid, storage_backend: StorageBackend, format: Option<String>, commit_id: Option<Uuid>, ) -> Result<WorkspaceBackup>
Create a backup of a workspace
Exports the workspace to the specified storage backend. For now, we support local filesystem backups. Cloud storage backends (S3, Azure, GCS) can be added later.
Sourcepub async fn restore_workspace(
&self,
backup_id: Uuid,
target_workspace_id: Option<Uuid>,
user_id: Uuid,
) -> Result<Uuid>
pub async fn restore_workspace( &self, backup_id: Uuid, target_workspace_id: Option<Uuid>, user_id: Uuid, ) -> Result<Uuid>
Restore a workspace from a backup
Sourcepub async fn list_backups(
&self,
workspace_id: Uuid,
limit: Option<i32>,
) -> Result<Vec<WorkspaceBackup>>
pub async fn list_backups( &self, workspace_id: Uuid, limit: Option<i32>, ) -> Result<Vec<WorkspaceBackup>>
List all backups for a workspace
Sourcepub async fn get_backup(&self, backup_id: Uuid) -> Result<WorkspaceBackup>
pub async fn get_backup(&self, backup_id: Uuid) -> Result<WorkspaceBackup>
Get a backup by ID
Sourcepub async fn delete_backup(&self, backup_id: Uuid) -> Result<()>
pub async fn delete_backup(&self, backup_id: Uuid) -> Result<()>
Delete a backup
Auto Trait Implementations§
impl Freeze for BackupService
impl !RefUnwindSafe for BackupService
impl Send for BackupService
impl Sync for BackupService
impl Unpin for BackupService
impl !UnwindSafe for BackupService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more