use std::path::PathBuf;
use super::*;
#[derive(Debug, Args)]
pub struct PutSnapshotBlock {
#[arg(long)]
snapshot_id: String,
#[arg(long)]
block_index: i32,
#[arg(long)]
block_data: PathBuf,
#[arg(long)]
progress: Option<i32>,
}
impl PutSnapshotBlock {
pub(crate) async fn execute(self, config: &Config) -> EbsResult {
let block_data = ebs::primitives::ByteStream::from_path(self.block_data)
.await
.map_err(ebs::error::BuildError::other)?;
let block = config
.ebs()
.put_snapshot_block()
.snapshot_id(self.snapshot_id)
.block_data(block_data)
.send()
.await?;
Ok(Box::new(block))
}
}