Skip to main content

Backups

Struct Backups 

Source
pub struct Backups { /* private fields */ }
Expand description

Every org’s destinations and backups.

Implementations§

Source§

impl Backups

Source

pub fn new(state: &Path, apps: Apps) -> Backups

Source

pub fn set_scheduler(&self, s: Scheduler)

Source

pub fn apps(&self) -> &Apps

Source

pub fn state_dir(&self) -> &Path

Source

pub fn runs(&self, org: &OrgId, name: &str) -> RunStore

Source

pub fn restore_runs(&self, org: &OrgId) -> RunStore

Source

pub fn destination_create( &self, org: &OrgId, dest: Destination, access_key: Option<String>, secret_key: Option<String>, trusted: bool, ) -> Result<Destination>

Create a destination. access_key/secret_key values are stored as the org secrets backup.<name>.access-key/.secret-key; otherwise dest names existing secrets. trusted: the caller may point it at this host (loopback).

Source

pub fn destination_get(&self, org: &OrgId, name: &str) -> Result<Destination>

Source

pub fn destination_list(&self, org: &OrgId) -> Result<Vec<Destination>>

Source

pub fn destination_delete(&self, org: &OrgId, name: &str) -> Result<()>

Delete a destination no backup uses, and the key secrets isb made. Objects in the bucket stay.

Source

pub fn client(&self, org: &OrgId, d: &Destination) -> Result<Client>

An S3 client for a destination, with its key pair read now.

Source

pub fn destination_create_bucket(&self, org: &OrgId, name: &str) -> Result<()>

Create the destination’s bucket (self-hosted stores; S3 itself usually wants buckets made in its console).

Source

pub fn destination_test(&self, org: &OrgId, name: &str) -> Result<Value>

Write, read back and delete a small object under the destination’s prefix: the key pair, the bucket and the network all work.

Source

pub fn get(&self, org: &OrgId, name: &str) -> Result<Backup>

Source

pub fn list(&self, org: &OrgId) -> Result<Vec<Backup>>

Source

pub fn create(&self, org: &OrgId, spec: BackupSpec) -> Result<Backup>

Source

pub fn update(&self, org: &OrgId, name: &str, patch: &Value) -> Result<Backup>

A merge patch of a backup’s settings (name and database fixed).

Source

pub fn delete(&self, org: &OrgId, name: &str) -> Result<()>

Delete a backup schedule and its run records; its objects stay in the bucket (restore them with destination and key).

Source

pub fn next_run(&self, b: &Backup) -> Option<i64>

Source

pub fn files(&self, org: &OrgId, name: &str) -> Result<Vec<BackupFile>>

The backup’s objects in its bucket, newest first.

Source

pub fn run_now(&self, org: &OrgId, name: &str, by: &str) -> Result<Run>

Back up now, in the background.

Source

pub fn restore(&self, org: &OrgId, req: RestoreRequest, by: &str) -> Result<Run>

Restore a backup object into an existing database (its data is replaced: confirm is required) or into a new database created for it. Runs in the background; returns the run record.

Trait Implementations§

Source§

impl Clone for Backups

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Scheduled for Backups

Source§

fn entries(&self) -> Vec<Entry>

Every enabled schedule.
Source§

fn fire(&self, e: &Entry, slot: i64, late: bool)

Record slot as the entry’s anchor, then start its run (without blocking the scheduler). The anchor must be saved before this returns, so a slot never fires twice.
Source§

fn advance(&self, e: &Entry, to: i64)

Move the anchor without running (missed beyond the grace window).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V