diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-05 15:38:32 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-05 15:38:32 +0100 |
commit | d7868c48a4d8d5831051a0be088fe7bbec259bca (patch) | |
tree | 27e5b5d5050a73e159f716884f69c2fec5a8fbb6 /src/api/admin/router.rs | |
parent | 280d1be7b1fde13d23e47f75aa8acd2f90efb81f (diff) | |
download | garage-d7868c48a4d8d5831051a0be088fe7bbec259bca.tar.gz garage-d7868c48a4d8d5831051a0be088fe7bbec259bca.zip |
Separate /health (simple text answer) and /v0/health (full json answer, authenticated)
Diffstat (limited to 'src/api/admin/router.rs')
-rw-r--r-- | src/api/admin/router.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/api/admin/router.rs b/src/api/admin/router.rs index 6ffcc131..3fa07b3c 100644 --- a/src/api/admin/router.rs +++ b/src/api/admin/router.rs @@ -17,11 +17,10 @@ router_match! {@func #[derive(Debug, Clone, PartialEq, Eq)] pub enum Endpoint { Options, - Health { - format: Option<String>, - }, + Health, Metrics, GetClusterStatus, + GetClusterHealth, ConnectClusterNodes, // Layout GetClusterLayout, @@ -92,9 +91,10 @@ impl Endpoint { let res = router_match!(@gen_path_parser (req.method(), path, query) [ OPTIONS _ => Options, - GET "/health" => Health (query_opt::format), + GET "/health" => Health, GET "/metrics" => Metrics, GET "/v0/status" => GetClusterStatus, + GET "/v0/health" => GetClusterHealth, POST "/v0/connect" => ConnectClusterNodes, // Layout endpoints GET "/v0/layout" => GetClusterLayout, @@ -135,7 +135,7 @@ impl Endpoint { /// Get the kind of authorization which is required to perform the operation. pub fn authorization_type(&self) -> Authorization { match self { - Self::Health { .. } => Authorization::None, + Self::Health => Authorization::None, Self::Metrics => Authorization::MetricsToken, _ => Authorization::AdminToken, } |