diff --git a/distribution/lambda/cdk/cli.py b/distribution/lambda/cdk/cli.py index 847a11fdeb3..f7374296d58 100644 --- a/distribution/lambda/cdk/cli.py +++ b/distribution/lambda/cdk/cli.py @@ -460,3 +460,4 @@ def req(method, path, body=None, expected_status=200): expected_status=400, ) req("GET", f"/api/v1/_elastic/_search?q=animal", expected_status=501) + req("GET", f"/api/v1/indexes/{mock_sales_index_id}") diff --git a/quickwit/quickwit-lambda/src/searcher/api.rs b/quickwit/quickwit-lambda/src/searcher/api.rs index 44c73d54c12..14a6ee46d36 100644 --- a/quickwit/quickwit-lambda/src/searcher/api.rs +++ b/quickwit/quickwit-lambda/src/searcher/api.rs @@ -88,12 +88,22 @@ fn es_compat_api( .or(es_compat_cat_indices_handler(metastore.clone())) } +fn index_api( + metastore: MetastoreServiceClient, +) -> impl Filter + Clone { + get_index_metadata_handler(metastore) +} + fn v1_searcher_api( search_service: Arc, metastore: MetastoreServiceClient, ) -> impl Filter + Clone { warp::path!("api" / "v1" / ..) - .and(native_api(search_service.clone()).or(es_compat_api(search_service, metastore))) + .and( + native_api(search_service.clone()) + .or(es_compat_api(search_service, metastore.clone())) + .or(index_api(metastore)), + ) .with(warp::filters::compression::gzip()) .recover(|rejection| { error!(?rejection, "request rejected"); diff --git a/quickwit/quickwit-serve/src/index_api/mod.rs b/quickwit/quickwit-serve/src/index_api/mod.rs index ab831526c81..64d58cddb94 100644 --- a/quickwit/quickwit-serve/src/index_api/mod.rs +++ b/quickwit/quickwit-serve/src/index_api/mod.rs @@ -20,5 +20,6 @@ mod rest_handler; pub use self::rest_handler::{ - index_management_handlers, IndexApi, IndexUpdates, ListSplitsQueryParams, ListSplitsResponse, + get_index_metadata_handler, index_management_handlers, IndexApi, IndexUpdates, + ListSplitsQueryParams, ListSplitsResponse, }; diff --git a/quickwit/quickwit-serve/src/index_api/rest_handler.rs b/quickwit/quickwit-serve/src/index_api/rest_handler.rs index b132a00d2e4..f5a783901d4 100644 --- a/quickwit/quickwit-serve/src/index_api/rest_handler.rs +++ b/quickwit/quickwit-serve/src/index_api/rest_handler.rs @@ -114,7 +114,7 @@ fn json_body( warp::body::content_length_limit(1024 * 1024).and(warp::body::json()) } -fn get_index_metadata_handler( +pub fn get_index_metadata_handler( metastore: MetastoreServiceClient, ) -> impl Filter + Clone { warp::path!("indexes" / String) diff --git a/quickwit/quickwit-serve/src/lib.rs b/quickwit/quickwit-serve/src/lib.rs index 074b9a028a7..22c6730fc43 100644 --- a/quickwit/quickwit-serve/src/lib.rs +++ b/quickwit/quickwit-serve/src/lib.rs @@ -1248,6 +1248,7 @@ pub mod lambda_search_api { es_compat_index_stats_handler, es_compat_scroll_handler, es_compat_search_handler, es_compat_stats_handler, }; + pub use crate::index_api::get_index_metadata_handler; pub use crate::rest::recover_fn; pub use crate::search_api::{search_get_handler, search_post_handler}; }