mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-09 14:49:25 +00:00
add legalhold api
This commit is contained in:
@@ -4320,6 +4320,23 @@ impl StorageAPI for SetDisks {
|
||||
fi.metadata = Some(metadata)
|
||||
}
|
||||
|
||||
if let Some(mt) = &opts.eval_metadata {
|
||||
if let Some(ref mut metadata) = fi.metadata {
|
||||
for (k, v) in mt {
|
||||
metadata.insert(k.clone(), v.clone());
|
||||
}
|
||||
fi.metadata = Some(metadata.clone())
|
||||
} else {
|
||||
let mut metadata = HashMap::new();
|
||||
|
||||
for (k, v) in mt {
|
||||
metadata.insert(k.clone(), v.clone());
|
||||
}
|
||||
|
||||
fi.metadata = Some(metadata)
|
||||
}
|
||||
}
|
||||
|
||||
fi.mod_time = opts.mod_time;
|
||||
if let Some(ref version_id) = opts.version_id {
|
||||
fi.version_id = Uuid::parse_str(version_id).ok();
|
||||
|
||||
@@ -18,7 +18,7 @@ use uuid::Uuid;
|
||||
pub const ERASURE_ALGORITHM: &str = "rs-vandermonde";
|
||||
pub const BLOCK_SIZE_V2: usize = 1024 * 1024; // 1M
|
||||
pub const RESERVED_METADATA_PREFIX: &str = "X-Rustfs-Internal-";
|
||||
pub const RESERVED_METADATA_PREFIX_LOWER: &str = "X-Rustfs-Internal-";
|
||||
pub const RESERVED_METADATA_PREFIX_LOWER: &str = "x-rustfs-internal-";
|
||||
pub const RUSTFS_HEALING: &str = "X-Rustfs-Internal-healing";
|
||||
pub const RUSTFS_DATA_MOVE: &str = "X-Rustfs-Internal-data-mov";
|
||||
|
||||
@@ -602,6 +602,8 @@ pub struct ObjectOptions {
|
||||
|
||||
pub replication_request: bool,
|
||||
pub delete_marker: bool,
|
||||
|
||||
pub eval_metadata: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
// impl Default for ObjectOptions {
|
||||
|
||||
Reference in New Issue
Block a user