aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_list.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-14 13:55:11 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-04 12:45:46 +0100
commit5b1117e582db16cc5aa50840a685875cbd5501f4 (patch)
tree06fec47bf56cb08cb51334454dc15f98352c98f2 /src/api/s3_list.rs
parent8f6026de5ecd44cbe0fc0bcd47638a1ece860439 (diff)
downloadgarage-5b1117e582db16cc5aa50840a685875cbd5501f4.tar.gz
garage-5b1117e582db16cc5aa50840a685875cbd5501f4.zip
New model for buckets
Diffstat (limited to 'src/api/s3_list.rs')
-rw-r--r--src/api/s3_list.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs
index df9c3e6b..07efb02d 100644
--- a/src/api/s3_list.rs
+++ b/src/api/s3_list.rs
@@ -3,6 +3,7 @@ use std::sync::Arc;
use hyper::{Body, Response};
+use garage_util::data::*;
use garage_util::error::Error as GarageError;
use garage_util::time::*;
@@ -18,7 +19,8 @@ use crate::s3_xml;
#[derive(Debug)]
pub struct ListObjectsQuery {
pub is_v2: bool,
- pub bucket: String,
+ pub bucket_name: String,
+ pub bucket_id: Uuid,
pub delimiter: Option<String>,
pub max_keys: usize,
pub prefix: String,
@@ -102,7 +104,7 @@ pub async fn handle_list(
let objects = garage
.object_table
.get_range(
- &query.bucket,
+ &query.bucket_id,
Some(next_chunk_start.clone()),
Some(DeletedFilter::NotDeleted),
query.max_keys + 1,
@@ -232,7 +234,7 @@ pub async fn handle_list(
let mut result = s3_xml::ListBucketResult {
xmlns: (),
- name: s3_xml::Value(query.bucket.to_string()),
+ name: s3_xml::Value(query.bucket_name.to_string()),
prefix: uriencode_maybe(&query.prefix, query.urlencode_resp),
marker: None,
next_marker: None,