aboutsummaryrefslogtreecommitdiff
path: root/src/api/api_server.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-01-19 17:16:00 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-01-21 10:42:30 +0100
commit440374524bcd21cade7b68410eb2d12ba23cfaaf (patch)
tree6bafbb7b087f6e7e3d852f914ae936c1aede99d4 /src/api/api_server.rs
parentfe003d6fbccbd202b41f3bdb29df11bd2597fef3 (diff)
downloadgarage-440374524bcd21cade7b68410eb2d12ba23cfaaf.tar.gz
garage-440374524bcd21cade7b68410eb2d12ba23cfaaf.zip
Implement ListParts
Diffstat (limited to 'src/api/api_server.rs')
-rw-r--r--src/api/api_server.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/api/api_server.rs b/src/api/api_server.rs
index b064ac24..dfb8dfdb 100644
--- a/src/api/api_server.rs
+++ b/src/api/api_server.rs
@@ -294,6 +294,25 @@ async fn handler_inner(garage: Arc<Garage>, req: Request<Body>) -> Result<Respon
)
.await
}
+ Endpoint::ListParts {
+ key,
+ max_parts,
+ part_number_marker,
+ upload_id,
+ } => {
+ handle_list_parts(
+ garage,
+ &ListPartsQuery {
+ bucket_name,
+ bucket_id,
+ key,
+ upload_id,
+ part_number_marker: part_number_marker.map(|p| p.clamp(1, 10000)),
+ max_parts: max_parts.map(|p| p.clamp(1, 1000)).unwrap_or(1000),
+ },
+ )
+ .await
+ }
Endpoint::DeleteObjects {} => {
handle_delete_objects(garage, bucket_id, req, content_sha256).await
}