pub struct VolumeBackups { /* private fields */ }Expand description
Every org’s volume snapshots and staged restores.
Implementations§
Source§impl VolumeBackups
impl VolumeBackups
Sourcepub fn restore(
&self,
org: &OrgId,
req: VolumeRestoreRequest,
by: &str,
) -> Result<(Run, Staged)>
pub fn restore( &self, org: &OrgId, req: VolumeRestoreRequest, by: &str, ) -> Result<(Run, Staged)>
Restore into a new staged volume, in the background. Returns the run and where the restore lands.
Sourcepub fn staged_list(
&self,
org: &OrgId,
volume: Option<&str>,
) -> Result<Vec<StagedRestore>>
pub fn staged_list( &self, org: &OrgId, volume: Option<&str>, ) -> Result<Vec<StagedRestore>>
The org’s staged restores (of volume, or all).
Source§impl VolumeBackups
impl VolumeBackups
pub fn new(state: &Path, apps: Apps, backups: Backups) -> VolumeBackups
pub fn set_scheduler(&self, s: Scheduler)
pub fn backups(&self) -> &Backups
Sourcepub fn configured(&self, org: &OrgId) -> Vec<String>
pub fn configured(&self, org: &OrgId) -> Vec<String>
Volumes with stored settings.
pub fn record(&self, org: &OrgId, volume: &str) -> Result<Option<VolumeRecord>>
Sourcepub fn info(&self, org: &OrgId, volume: &str) -> Result<VolumeInfo>
pub fn info(&self, org: &OrgId, volume: &str) -> Result<VolumeInfo>
The volume as incus has it (it must exist in the org).
Sourcepub fn update(
&self,
org: &OrgId,
volume: &str,
patch: &Value,
) -> Result<VolumeRecord>
pub fn update( &self, org: &OrgId, volume: &str, patch: &Value, ) -> Result<VolumeRecord>
Change a volume’s settings with a merge patch (schedule: null or
"" removes the schedule).
pub fn next_run(&self, r: &VolumeRecord) -> Option<i64>
Sourcepub fn snapshots(&self, org: &OrgId, volume: &str) -> Result<Vec<Snapshot>>
pub fn snapshots(&self, org: &OrgId, volume: &str) -> Result<Vec<Snapshot>>
Snapshots, newest first.
pub fn snapshot_delete( &self, org: &OrgId, volume: &str, snapshot: &str, ) -> Result<()>
Sourcepub fn create(
&self,
org: &OrgId,
volume: &str,
size: Option<&str>,
) -> Result<bool>
pub fn create( &self, org: &OrgId, volume: &str, size: Option<&str>, ) -> Result<bool>
Create an empty volume in the org’s pool, size or (under a disk
limit) the default. False when it already exists, as isb volume create says.
Sourcepub fn delete(&self, org: &OrgId, volume: &str) -> Result<()>
pub fn delete(&self, org: &OrgId, volume: &str) -> Result<()>
Delete a volume and its snapshots, and forget its settings and runs.
Refused while an instance uses it (as incus refuses), while a
snapshot of it is being taken, while a backup names it, and for a
staged restore, which staged_discard detaches first.