diff options
author | Alex Auvolat <alex@adnab.me> | 2022-05-11 11:10:28 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-05-11 11:10:28 +0200 |
commit | 5c00c9fb46305b021b5fc45d7ae7b1e13b72030c (patch) | |
tree | 4c38ca477cd293e4e94b744a8c209d6d159c1ad7 /src/api/admin/router.rs | |
parent | f97a7845e9e9ab68c3b8afc0d1091765ed11439c (diff) | |
download | garage-5c00c9fb46305b021b5fc45d7ae7b1e13b72030c.tar.gz garage-5c00c9fb46305b021b5fc45d7ae7b1e13b72030c.zip |
First key endpoints: ListKeys and GetKeyInfo
Diffstat (limited to 'src/api/admin/router.rs')
-rw-r--r-- | src/api/admin/router.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/api/admin/router.rs b/src/api/admin/router.rs index 7ff34aaa..626cced1 100644 --- a/src/api/admin/router.rs +++ b/src/api/admin/router.rs @@ -25,7 +25,8 @@ pub enum Endpoint { ListKeys, CreateKey, GetKeyInfo { - id: String, + id: Option<String>, + search: Option<String>, }, DeleteKey { id: String, @@ -56,7 +57,8 @@ impl Endpoint { POST "/layout/apply" => ApplyClusterLayout, POST "/layout/revert" => RevertClusterLayout, // API key endpoints - GET "/key" if id => GetKeyInfo (query::id), + GET "/key" if id => GetKeyInfo (query_opt::id, query_opt::search), + GET "/key" if search => GetKeyInfo (query_opt::id, query_opt::search), POST "/key" if id => UpdateKey (query::id), POST "/key" => CreateKey, DELETE "/key" if id => DeleteKey (query::id), @@ -79,5 +81,6 @@ impl Endpoint { } generateQueryParameters! { - "id" => id + "id" => id, + "search" => search } |