aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/router.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/admin/router.rs')
-rw-r--r--src/api/admin/router.rs44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/api/admin/router.rs b/src/api/admin/router.rs
index b98db284..077509e3 100644
--- a/src/api/admin/router.rs
+++ b/src/api/admin/router.rs
@@ -97,35 +97,35 @@ impl Endpoint {
GET "/metrics" => Metrics,
GET "/v1/status" => GetClusterStatus,
GET "/v1/health" => GetClusterHealth,
- POST "/v0/connect" => ConnectClusterNodes,
+ POST ("/v0/connect" | "/v1/connect") => ConnectClusterNodes,
// Layout endpoints
GET "/v1/layout" => GetClusterLayout,
POST "/v1/layout" => UpdateClusterLayout,
- POST "/v0/layout/apply" => ApplyClusterLayout,
- POST "/v0/layout/revert" => RevertClusterLayout,
+ POST ("/v0/layout/apply" | "/v1/layout/apply") => ApplyClusterLayout,
+ POST ("/v0/layout/revert" | "/v1/layout/revert") => RevertClusterLayout,
// API key endpoints
- GET "/v0/key" if id => GetKeyInfo (query_opt::id, query_opt::search),
- GET "/v0/key" if search => GetKeyInfo (query_opt::id, query_opt::search),
- POST "/v0/key" if id => UpdateKey (query::id),
- POST "/v0/key" => CreateKey,
- POST "/v0/key/import" => ImportKey,
- DELETE "/v0/key" if id => DeleteKey (query::id),
- GET "/v0/key" => ListKeys,
+ GET ("/v0/key" | "/v1/key") if id => GetKeyInfo (query_opt::id, query_opt::search),
+ GET ("/v0/key" | "/v1/key") if search => GetKeyInfo (query_opt::id, query_opt::search),
+ POST ("/v0/key" | "/v1/key") if id => UpdateKey (query::id),
+ POST ("/v0/key" | "/v1/key") => CreateKey,
+ POST ("/v0/key/import" | "/v1/key/import") => ImportKey,
+ DELETE ("/v0/key" | "/v1/key") if id => DeleteKey (query::id),
+ GET ("/v0/key" | "/v1/key") => ListKeys,
// Bucket endpoints
- GET "/v0/bucket" if id => GetBucketInfo (query_opt::id, query_opt::global_alias),
- GET "/v0/bucket" if global_alias => GetBucketInfo (query_opt::id, query_opt::global_alias),
- GET "/v0/bucket" => ListBuckets,
- POST "/v0/bucket" => CreateBucket,
- DELETE "/v0/bucket" if id => DeleteBucket (query::id),
- PUT "/v0/bucket" if id => UpdateBucket (query::id),
+ GET ("/v0/bucket" | "/v1/bucket") if id => GetBucketInfo (query_opt::id, query_opt::global_alias),
+ GET ("/v0/bucket" | "/v1/bucket") if global_alias => GetBucketInfo (query_opt::id, query_opt::global_alias),
+ GET ("/v0/bucket" | "/v1/bucket") => ListBuckets,
+ POST ("/v0/bucket" | "/v1/bucket") => CreateBucket,
+ DELETE ("/v0/bucket" | "/v1/bucket") if id => DeleteBucket (query::id),
+ PUT ("/v0/bucket" | "/v1/bucket") if id => UpdateBucket (query::id),
// Bucket-key permissions
- POST "/v0/bucket/allow" => BucketAllowKey,
- POST "/v0/bucket/deny" => BucketDenyKey,
+ POST ("/v0/bucket/allow" | "/v1/bucket/allow") => BucketAllowKey,
+ POST ("/v0/bucket/deny" | "/v1/bucket/deny") => BucketDenyKey,
// Bucket aliases
- PUT "/v0/bucket/alias/global" => GlobalAliasBucket (query::id, query::alias),
- DELETE "/v0/bucket/alias/global" => GlobalUnaliasBucket (query::id, query::alias),
- PUT "/v0/bucket/alias/local" => LocalAliasBucket (query::id, query::access_key_id, query::alias),
- DELETE "/v0/bucket/alias/local" => LocalUnaliasBucket (query::id, query::access_key_id, query::alias),
+ PUT ("/v0/bucket/alias/global" | "/v1/bucket/alias/global") => GlobalAliasBucket (query::id, query::alias),
+ DELETE ("/v0/bucket/alias/global" | "/v1/bucket/alias/global") => GlobalUnaliasBucket (query::id, query::alias),
+ PUT ("/v0/bucket/alias/local" | "/v1/bucket/alias/local") => LocalAliasBucket (query::id, query::access_key_id, query::alias),
+ DELETE ("/v0/bucket/alias/local" | "/v1/bucket/alias/local") => LocalUnaliasBucket (query::id, query::access_key_id, query::alias),
]);
if let Some(message) = query.nonempty_message() {