cli_v2: implement CreateMetadataSnapshot

This commit is contained in:
Alex Auvolat
2025-02-05 14:22:10 +01:00
parent 97be7b38fa
commit 9f468b4439
9 changed files with 94 additions and 68 deletions
+23
View File
@@ -0,0 +1,23 @@
use std::sync::Arc;
use async_trait::async_trait;
use garage_model::garage::Garage;
use crate::api::*;
use crate::error::Error;
use crate::{Admin, RequestHandler};
#[async_trait]
impl RequestHandler for LocalCreateMetadataSnapshotRequest {
type Response = LocalCreateMetadataSnapshotResponse;
async fn handle(
self,
garage: &Arc<Garage>,
_admin: &Admin,
) -> Result<LocalCreateMetadataSnapshotResponse, Error> {
garage_model::snapshot::async_snapshot_metadata(garage).await?;
Ok(LocalCreateMetadataSnapshotResponse)
}
}