pub struct WorkspaceManager<'a> { /* private fields */ }Expand description
Manager for workspace operations
Implementations§
Source§impl<'a> WorkspaceManager<'a>
impl<'a> WorkspaceManager<'a>
Sourcepub fn new(client: &'a DaytonaClient) -> Self
pub fn new(client: &'a DaytonaClient) -> Self
Create a new workspace manager
Sourcepub async fn create(&self, params: CreateWorkspaceParams) -> Result<Workspace>
pub async fn create(&self, params: CreateWorkspaceParams) -> Result<Workspace>
Create a new workspace
Sourcepub async fn update(
&self,
workspace_id: &Uuid,
params: UpdateWorkspaceParams,
) -> Result<Workspace>
pub async fn update( &self, workspace_id: &Uuid, params: UpdateWorkspaceParams, ) -> Result<Workspace>
Update workspace
Sourcepub async fn delete_with_force(
&self,
workspace_id: &Uuid,
force: bool,
) -> Result<()>
pub async fn delete_with_force( &self, workspace_id: &Uuid, force: bool, ) -> Result<()>
Delete workspace with force option
Sourcepub async fn backup(
&self,
workspace_id: &Uuid,
name: String,
description: Option<String>,
) -> Result<WorkspaceBackup>
pub async fn backup( &self, workspace_id: &Uuid, name: String, description: Option<String>, ) -> Result<WorkspaceBackup>
Create workspace backup
Sourcepub async fn list_backups(
&self,
workspace_id: &Uuid,
) -> Result<Vec<WorkspaceBackup>>
pub async fn list_backups( &self, workspace_id: &Uuid, ) -> Result<Vec<WorkspaceBackup>>
List workspace backups
Sourcepub async fn restore_from_backup(
&self,
workspace_id: &Uuid,
backup_id: &Uuid,
) -> Result<()>
pub async fn restore_from_backup( &self, workspace_id: &Uuid, backup_id: &Uuid, ) -> Result<()>
Restore from backup
Sourcepub async fn get_port_preview(
&self,
workspace_id: &Uuid,
port: u16,
) -> Result<PortPreview>
pub async fn get_port_preview( &self, workspace_id: &Uuid, port: u16, ) -> Result<PortPreview>
Get port preview URL
Sourcepub async fn create_port_preview(
&self,
workspace_id: &Uuid,
port: u16,
public: bool,
) -> Result<PortPreview>
pub async fn create_port_preview( &self, workspace_id: &Uuid, port: u16, public: bool, ) -> Result<PortPreview>
Create port preview
Sourcepub async fn get_build_logs(
&self,
workspace_id: &Uuid,
follow: bool,
) -> Result<String>
pub async fn get_build_logs( &self, workspace_id: &Uuid, follow: bool, ) -> Result<String>
Get build logs for a workspace
Sourcepub async fn replace_labels(
&self,
workspace_id: &Uuid,
labels: HashMap<String, String>,
) -> Result<()>
pub async fn replace_labels( &self, workspace_id: &Uuid, labels: HashMap<String, String>, ) -> Result<()>
Replace labels for a workspace
Sourcepub async fn set_auto_archive_interval(
&self,
workspace_id: &Uuid,
minutes: u32,
) -> Result<()>
pub async fn set_auto_archive_interval( &self, workspace_id: &Uuid, minutes: u32, ) -> Result<()>
Set auto-archive interval for a workspace
Sourcepub async fn set_autostop_interval(
&self,
workspace_id: &Uuid,
minutes: u32,
) -> Result<()>
pub async fn set_autostop_interval( &self, workspace_id: &Uuid, minutes: u32, ) -> Result<()>
Set auto-stop interval for a workspace
Sourcepub async fn update_public_status(
&self,
workspace_id: &Uuid,
is_public: bool,
) -> Result<()>
pub async fn update_public_status( &self, workspace_id: &Uuid, is_public: bool, ) -> Result<()>
Update public status of a workspace
Sourcepub async fn wait_for_state(
&self,
workspace_id: &Uuid,
target_state: WorkspaceState,
max_wait_seconds: u64,
) -> Result<Workspace>
pub async fn wait_for_state( &self, workspace_id: &Uuid, target_state: WorkspaceState, max_wait_seconds: u64, ) -> Result<Workspace>
Wait for workspace to reach a specific state
Auto Trait Implementations§
impl<'a> Freeze for WorkspaceManager<'a>
impl<'a> !RefUnwindSafe for WorkspaceManager<'a>
impl<'a> Send for WorkspaceManager<'a>
impl<'a> Sync for WorkspaceManager<'a>
impl<'a> Unpin for WorkspaceManager<'a>
impl<'a> !UnwindSafe for WorkspaceManager<'a>
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