diff options
author | Alex Auvolat <alex@adnab.me> | 2022-05-17 17:16:29 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-05-17 17:16:29 +0200 |
commit | 2ce3513c108a53bdcc5a838704867a4499295d85 (patch) | |
tree | 77681eee926bd532a2568dafab899d13691b0e8c /src/api/admin/router.rs | |
parent | e92c52eb6522a140cdced40bc047149dc638bfa4 (diff) | |
download | garage-2ce3513c108a53bdcc5a838704867a4499295d85.tar.gz garage-2ce3513c108a53bdcc5a838704867a4499295d85.zip |
Specify and implement {Global,Local}{Alias,Unalias}Bucket
Diffstat (limited to 'src/api/admin/router.rs')
-rw-r--r-- | src/api/admin/router.rs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/api/admin/router.rs b/src/api/admin/router.rs index 2a5098bf..6961becb 100644 --- a/src/api/admin/router.rs +++ b/src/api/admin/router.rs @@ -49,6 +49,25 @@ pub enum Endpoint { // Bucket-Key Permissions BucketAllowKey, BucketDenyKey, + // Bucket aliases + GlobalAliasBucket { + id: String, + alias: String, + }, + GlobalUnaliasBucket { + id: String, + alias: String, + }, + LocalAliasBucket { + id: String, + access_key_id: String, + alias: String, + }, + LocalUnaliasBucket { + id: String, + access_key_id: String, + alias: String, + }, }} impl Endpoint { @@ -87,6 +106,11 @@ impl Endpoint { // Bucket-key permissions POST "/bucket/allow" => BucketAllowKey, POST "/bucket/deny" => BucketDenyKey, + // Bucket aliases + PUT "/bucket/alias/global" => GlobalAliasBucket (query::id, query::alias), + DELETE "/bucket/alias/global" => GlobalUnaliasBucket (query::id, query::alias), + PUT "/bucket/alias/local" => LocalAliasBucket (query::id, query::access_key_id, query::alias), + DELETE "/bucket/alias/local" => LocalUnaliasBucket (query::id, query::access_key_id, query::alias), ]); if let Some(message) = query.nonempty_message() { @@ -107,5 +131,7 @@ impl Endpoint { generateQueryParameters! { "id" => id, "search" => search, - "globalAlias" => global_alias + "globalAlias" => global_alias, + "alias" => alias, + "accessKeyId" => access_key_id } |