diff --git a/src/http/app_server.rs b/src/http/app_server.rs index 7b0813a..015d5d0 100644 --- a/src/http/app_server.rs +++ b/src/http/app_server.rs @@ -77,20 +77,20 @@ pub struct AppServer { pub engine: Arc, } -pub const PATH_QUERY: &str = "/query"; -pub const PATH_INFORMATION_SCHEMA: &str = "/information_schema"; +pub const PATH_QUERY: &str = "/v1/query"; +pub const PATH_INFORMATION_SCHEMA: &str = "/v1/information_schema"; pub const PATH_HEALTH: &str = "/health"; -pub const PATH_REFRESH: &str = "/refresh"; -pub const PATH_CONNECTIONS: &str = "/connections"; -pub const PATH_CONNECTION: &str = "/connections/{connection_id}"; -pub const PATH_CONNECTION_HEALTH: &str = "/connections/{connection_id}/health"; -pub const PATH_CONNECTION_CACHE: &str = "/connections/{connection_id}/cache"; -pub const PATH_TABLE_CACHE: &str = "/connections/{connection_id}/tables/{schema}/{table}/cache"; -pub const PATH_SECRETS: &str = "/secrets"; -pub const PATH_SECRET: &str = "/secrets/{name}"; -pub const PATH_QUERY_RUNS: &str = "/query-runs"; -pub const PATH_RESULTS: &str = "/results"; -pub const PATH_RESULT: &str = "/results/{id}"; +pub const PATH_REFRESH: &str = "/v1/refresh"; +pub const PATH_CONNECTIONS: &str = "/v1/connections"; +pub const PATH_CONNECTION: &str = "/v1/connections/{connection_id}"; +pub const PATH_CONNECTION_HEALTH: &str = "/v1/connections/{connection_id}/health"; +pub const PATH_CONNECTION_CACHE: &str = "/v1/connections/{connection_id}/cache"; +pub const PATH_TABLE_CACHE: &str = "/v1/connections/{connection_id}/tables/{schema}/{table}/cache"; +pub const PATH_SECRETS: &str = "/v1/secrets"; +pub const PATH_SECRET: &str = "/v1/secrets/{name}"; +pub const PATH_QUERY_RUNS: &str = "/v1/query-runs"; +pub const PATH_RESULTS: &str = "/v1/results"; +pub const PATH_RESULT: &str = "/v1/results/{id}"; pub const PATH_FILES: &str = "/v1/files"; pub const PATH_DATASETS: &str = "/v1/datasets"; pub const PATH_DATASET: &str = "/v1/datasets/{id}"; diff --git a/tests/http_server_tests.rs b/tests/http_server_tests.rs index 23e6b45..d056a6f 100644 --- a/tests/http_server_tests.rs +++ b/tests/http_server_tests.rs @@ -2674,7 +2674,7 @@ async fn test_list_query_runs_empty() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri("/query-runs") + .uri("/v1/query-runs") .body(Body::empty())?, ) .await?; @@ -2720,7 +2720,7 @@ async fn test_query_run_lifecycle_and_list() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri("/query-runs?limit=10") + .uri("/v1/query-runs?limit=10") .body(Body::empty())?, ) .await?; @@ -2767,7 +2767,7 @@ async fn test_query_run_failed_query() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri("/query-runs") + .uri("/v1/query-runs") .body(Body::empty())?, ) .await?; @@ -2810,7 +2810,7 @@ async fn test_query_run_pagination() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri("/query-runs?limit=2") + .uri("/v1/query-runs?limit=2") .body(Body::empty())?, ) .await?; @@ -2827,7 +2827,7 @@ async fn test_query_run_pagination() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri(format!("/query-runs?limit=2&cursor={}", next_cursor)) + .uri(format!("/v1/query-runs?limit=2&cursor={}", next_cursor)) .body(Body::empty())?, ) .await?; @@ -2868,7 +2868,7 @@ async fn test_list_query_runs_limit_zero_clamps_to_one() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri("/query-runs?limit=0") + .uri("/v1/query-runs?limit=0") .body(Body::empty())?, ) .await?; @@ -2893,7 +2893,7 @@ async fn test_list_query_runs_invalid_cursor_returns_400() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri("/query-runs?cursor=not-valid-base64!!!") + .uri("/v1/query-runs?cursor=not-valid-base64!!!") .body(Body::empty())?, ) .await?; diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index ebe18b3..6be3201 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -572,7 +572,7 @@ impl TestExecutor for ApiExecutor { async fn get_connection(&self, identifier: &str) -> Option { // For API, identifier is connection_id - let uri = format!("/connections/{}", identifier); + let uri = format!("/v1/connections/{}", identifier); let response = self .router .clone() @@ -600,7 +600,7 @@ impl TestExecutor for ApiExecutor { async fn delete_connection(&self, identifier: &str) -> bool { // For API, identifier is connection_id - let uri = format!("/connections/{}", identifier); + let uri = format!("/v1/connections/{}", identifier); let response = self .router .clone() @@ -618,7 +618,7 @@ impl TestExecutor for ApiExecutor { async fn purge_connection_cache(&self, identifier: &str) -> bool { // For API, identifier is connection_id - let uri = format!("/connections/{}/cache", identifier); + let uri = format!("/v1/connections/{}/cache", identifier); let response = self .router .clone() @@ -637,7 +637,7 @@ impl TestExecutor for ApiExecutor { async fn purge_table_cache(&self, identifier: &str, schema: &str, table: &str) -> bool { // For API, identifier is connection_id let uri = format!( - "/connections/{}/tables/{}/{}/cache", + "/v1/connections/{}/tables/{}/{}/cache", identifier, schema, table ); let response = self diff --git a/tests/result_persistence_tests.rs b/tests/result_persistence_tests.rs index 69f2146..e4d489f 100644 --- a/tests/result_persistence_tests.rs +++ b/tests/result_persistence_tests.rs @@ -466,7 +466,7 @@ async fn wait_for_result_ready( .oneshot( Request::builder() .method("GET") - .uri(format!("/results/{}", result_id)) + .uri(format!("/v1/results/{}", result_id)) .body(Body::empty())?, ) .await?; @@ -843,7 +843,7 @@ async fn test_empty_result_returns_id() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri(format!("/results/{}", result_id)) + .uri(format!("/v1/results/{}", result_id)) .body(Body::empty())?, ) .await?; @@ -1001,7 +1001,7 @@ async fn test_storage_recovery_after_failure() -> Result<()> { .oneshot( Request::builder() .method("GET") - .uri(format!("/results/{}", result_id2)) + .uri(format!("/v1/results/{}", result_id2)) .body(Body::empty())?, ) .await?; @@ -1258,7 +1258,7 @@ async fn test_different_failure_stages_produce_consistent_status() -> Result<()> .oneshot( Request::builder() .method("GET") - .uri(format!("/results/{}", result_id3)) + .uri(format!("/v1/results/{}", result_id3)) .body(Body::empty())?, ) .await?; @@ -1811,7 +1811,7 @@ async fn test_catalog_finalize_result_failure_marks_result_failed() -> Result<() .oneshot( Request::builder() .method("GET") - .uri(format!("/results/{}", result_id)) + .uri(format!("/v1/results/{}", result_id)) .body(Body::empty())?, ) .await?; diff --git a/tests/saved_query_tests.rs b/tests/saved_query_tests.rs index a001130..0b3e76d 100644 --- a/tests/saved_query_tests.rs +++ b/tests/saved_query_tests.rs @@ -516,7 +516,7 @@ async fn test_query_run_linkage_on_saved_query_execution() -> Result<()> { &router, Request::builder() .method("GET") - .uri("/query-runs?limit=10") + .uri("/v1/query-runs?limit=10") .body(Body::empty())?, ) .await?; @@ -559,7 +559,7 @@ async fn test_ad_hoc_query_run_has_null_linkage() -> Result<()> { &router, Request::builder() .method("GET") - .uri("/query-runs?limit=10") + .uri("/v1/query-runs?limit=10") .body(Body::empty())?, ) .await?;