Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/http/app_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ pub struct AppServer {
pub engine: Arc<RuntimeEngine>,
}

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}";
Expand Down
14 changes: 7 additions & 7 deletions tests/http_server_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand All @@ -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?;
Expand Down Expand Up @@ -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?;
Expand All @@ -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?;
Expand Down
8 changes: 4 additions & 4 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ impl TestExecutor for ApiExecutor {

async fn get_connection(&self, identifier: &str) -> Option<ConnectionDetails> {
// For API, identifier is connection_id
let uri = format!("/connections/{}", identifier);
let uri = format!("/v1/connections/{}", identifier);
let response = self
.router
.clone()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/result_persistence_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand Down
4 changes: 2 additions & 2 deletions tests/saved_query_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down Expand Up @@ -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?;
Expand Down
Loading