diff options
author | Alex Auvolat <alex@adnab.me> | 2022-05-12 10:20:34 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-05-12 10:20:34 +0200 |
commit | 2b93a01d2bead391e15f529dc5b4db80dcbeeba8 (patch) | |
tree | cfda293e7f97a891773dea75d53763c77c06d821 /src/api/admin/router.rs | |
parent | aeb978552a10eb89d183cdec04d242369127d764 (diff) | |
download | garage-2b93a01d2bead391e15f529dc5b4db80dcbeeba8.tar.gz garage-2b93a01d2bead391e15f529dc5b4db80dcbeeba8.zip |
ListBucket and GetBucketInfo
Diffstat (limited to 'src/api/admin/router.rs')
-rw-r--r-- | src/api/admin/router.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/api/admin/router.rs b/src/api/admin/router.rs index 626cced1..a6e1c848 100644 --- a/src/api/admin/router.rs +++ b/src/api/admin/router.rs @@ -18,10 +18,12 @@ pub enum Endpoint { Options, Metrics, GetClusterStatus, + // Layout GetClusterLayout, UpdateClusterLayout, ApplyClusterLayout, RevertClusterLayout, + // Keys ListKeys, CreateKey, GetKeyInfo { @@ -34,6 +36,16 @@ pub enum Endpoint { UpdateKey { id: String, }, + // Buckets + ListBuckets, + CreateBucket, + GetBucketInfo { + id: Option<String>, + global_alias: Option<String>, + }, + DeleteBucket { + id: String, + }, }} impl Endpoint { @@ -63,6 +75,12 @@ impl Endpoint { POST "/key" => CreateKey, DELETE "/key" if id => DeleteKey (query::id), GET "/key" => ListKeys, + // Bucket endpoints + GET "/bucket" if id => GetBucketInfo (query_opt::id, query_opt::global_alias), + GET "/bucket" if global_alias => GetBucketInfo (query_opt::id, query_opt::global_alias), + GET "/bucket" => ListBuckets, + POST "/bucket" => CreateBucket, + DELETE "/bucket" if id => DeleteBucket (query::id), ]); if let Some(message) = query.nonempty_message() { @@ -82,5 +100,6 @@ impl Endpoint { generateQueryParameters! { "id" => id, - "search" => search + "search" => search, + "globalAlias" => global_alias } |