Struct weaviate_community::Backups
source · pub struct Backups { /* private fields */ }
Expand description
All backup related endpoints and functionality described in Weaviate meta API documentation
Implementations§
source§impl Backups
impl Backups
sourcepub async fn create(
&self,
backend: &BackupBackends,
backup_request: &BackupCreateRequest,
wait_for_completion: bool
) -> Result<BackupResponse, Box<dyn Error>>
pub async fn create( &self, backend: &BackupBackends, backup_request: &BackupCreateRequest, wait_for_completion: bool ) -> Result<BackupResponse, Box<dyn Error>>
Create a new backup
§Examples
Creating a backup to the filesystem, waiting for completion
use weaviate_community::WeaviateClient;
use weaviate_community::collections::backups::{BackupBackends, BackupCreateRequest};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WeaviateClient::builder("http://localhost:8080").build()?;
let my_request = BackupCreateRequest {
id: "doc-test-backup".into(),
include: None,
exclude: None
};
let res = client.backups.create(
&BackupBackends::FILESYSTEM,
&my_request,
true
).await?;
println!("{:#?}", res);
Ok(())
}
sourcepub async fn get_backup_status(
&self,
backend: &BackupBackends,
backup_id: &str,
restore: bool
) -> Result<BackupStatusResponse, Box<dyn Error>>
pub async fn get_backup_status( &self, backend: &BackupBackends, backup_id: &str, restore: bool ) -> Result<BackupStatusResponse, Box<dyn Error>>
Get the status of a backup
§Examples
use weaviate_community::WeaviateClient;
use weaviate_community::collections::backups::BackupBackends;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WeaviateClient::builder("http://localhost:8080").build()?;
let res = client.backups.get_backup_status(
&BackupBackends::FILESYSTEM,
"doc-test-backup",
true
).await?;
println!("{:#?}", res);
Ok(())
}
sourcepub async fn restore(
&self,
backend: &BackupBackends,
backup_id: &str,
backup_request: &BackupRestoreRequest,
wait_for_completion: bool
) -> Result<BackupResponse, Box<dyn Error>>
pub async fn restore( &self, backend: &BackupBackends, backup_id: &str, backup_request: &BackupRestoreRequest, wait_for_completion: bool ) -> Result<BackupResponse, Box<dyn Error>>
Restore a backup
§Examples
Restore a backup from the filesystem, waiting for completion
use weaviate_community::WeaviateClient;
use weaviate_community::collections::backups::{BackupBackends, BackupRestoreRequest};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WeaviateClient::builder("http://localhost:8080").build()?;
let my_request = BackupRestoreRequest {
include: None,
exclude: None
};
let res = client.backups.restore(
&BackupBackends::FILESYSTEM,
"doc-test-backup",
&my_request,
true
).await?;
println!("{:#?}", res);
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Backups
impl Send for Backups
impl Sync for Backups
impl Unpin for Backups
impl !UnwindSafe for Backups
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