pub struct Backups { /* private fields */ }Expand description
Every org’s destinations and backups.
Implementations§
Source§impl Backups
impl Backups
pub fn new(state: &Path, apps: Apps) -> Backups
pub fn set_scheduler(&self, s: Scheduler)
pub fn apps(&self) -> &Apps
pub fn state_dir(&self) -> &Path
pub fn runs(&self, org: &OrgId, name: &str) -> RunStore
pub fn restore_runs(&self, org: &OrgId) -> RunStore
Sourcepub fn destination_create(
&self,
org: &OrgId,
dest: Destination,
access_key: Option<String>,
secret_key: Option<String>,
trusted: bool,
) -> Result<Destination>
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).
pub fn destination_get(&self, org: &OrgId, name: &str) -> Result<Destination>
pub fn destination_list(&self, org: &OrgId) -> Result<Vec<Destination>>
Sourcepub fn destination_delete(&self, org: &OrgId, name: &str) -> Result<()>
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.
Sourcepub fn client(&self, org: &OrgId, d: &Destination) -> Result<Client>
pub fn client(&self, org: &OrgId, d: &Destination) -> Result<Client>
An S3 client for a destination, with its key pair read now.
Sourcepub fn destination_create_bucket(&self, org: &OrgId, name: &str) -> Result<()>
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).
Sourcepub fn destination_test(&self, org: &OrgId, name: &str) -> Result<Value>
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.
pub fn get(&self, org: &OrgId, name: &str) -> Result<Backup>
pub fn list(&self, org: &OrgId) -> Result<Vec<Backup>>
pub fn create(&self, org: &OrgId, spec: BackupSpec) -> Result<Backup>
Sourcepub fn update(&self, org: &OrgId, name: &str, patch: &Value) -> Result<Backup>
pub fn update(&self, org: &OrgId, name: &str, patch: &Value) -> Result<Backup>
A merge patch of a backup’s settings (name and database fixed).
Sourcepub fn delete(&self, org: &OrgId, name: &str) -> Result<()>
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).
pub fn next_run(&self, b: &Backup) -> Option<i64>
Sourcepub fn files(&self, org: &OrgId, name: &str) -> Result<Vec<BackupFile>>
pub fn files(&self, org: &OrgId, name: &str) -> Result<Vec<BackupFile>>
The backup’s objects in its bucket, newest first.