Skip to content

Commit 38878f7

Browse files
committed
move existing timeseries query endpoints to /v1/system
1 parent 7cf688c commit 38878f7

File tree

6 files changed

+104
-104
lines changed

6 files changed

+104
-104
lines changed

nexus/external-api/output/nexus_tags.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ login_saml POST /login/{silo_name}/saml/{provi
7373
API operations found with tag "metrics"
7474
OPERATION ID METHOD URL PATH
7575
silo_metric GET /v1/metrics/{metric_name}
76-
timeseries_query POST /v1/timeseries/query
77-
timeseries_schema_list GET /v1/timeseries/schema
7876

7977
API operations found with tag "policy"
8078
OPERATION ID METHOD URL PATH
@@ -170,6 +168,8 @@ ip_pool_view GET /v1/system/ip-pools/{pool}
170168
API operations found with tag "system/metrics"
171169
OPERATION ID METHOD URL PATH
172170
system_metric GET /v1/system/metrics/{metric_name}
171+
system_timeseries_query POST /v1/system/timeseries/query
172+
system_timeseries_schema_list GET /v1/system/timeseries/schema
173173

174174
API operations found with tag "system/networking"
175175
OPERATION ID METHOD URL PATH

nexus/external-api/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,10 +2541,10 @@ pub trait NexusExternalApi {
25412541
/// List timeseries schemas
25422542
#[endpoint {
25432543
method = GET,
2544-
path = "/v1/timeseries/schema",
2545-
tags = ["metrics"],
2544+
path = "/v1/system/timeseries/schema",
2545+
tags = ["system/metrics"],
25462546
}]
2547-
async fn timeseries_schema_list(
2547+
async fn system_timeseries_schema_list(
25482548
rqctx: RequestContext<Self::Context>,
25492549
pag_params: Query<TimeseriesSchemaPaginationParams>,
25502550
) -> Result<
@@ -2559,10 +2559,10 @@ pub trait NexusExternalApi {
25592559
/// Queries are written in OxQL.
25602560
#[endpoint {
25612561
method = POST,
2562-
path = "/v1/timeseries/query",
2563-
tags = ["metrics"],
2562+
path = "/v1/system/timeseries/query",
2563+
tags = ["system/metrics"],
25642564
}]
2565-
async fn timeseries_query(
2565+
async fn system_timeseries_query(
25662566
rqctx: RequestContext<Self::Context>,
25672567
body: TypedBody<params::TimeseriesQuery>,
25682568
) -> Result<HttpResponseOk<views::OxqlQueryResult>, HttpError>;

nexus/src/external_api/http_entrypoints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5494,7 +5494,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
54945494
.await
54955495
}
54965496

5497-
async fn timeseries_schema_list(
5497+
async fn system_timeseries_schema_list(
54985498
rqctx: RequestContext<ApiContext>,
54995499
pag_params: Query<TimeseriesSchemaPaginationParams>,
55005500
) -> Result<
@@ -5521,7 +5521,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
55215521
.await
55225522
}
55235523

5524-
async fn timeseries_query(
5524+
async fn system_timeseries_query(
55255525
rqctx: RequestContext<ApiContext>,
55265526
body: TypedBody<params::TimeseriesQuery>,
55275527
) -> Result<HttpResponseOk<views::OxqlQueryResult>, HttpError> {

nexus/tests/integration_tests/endpoints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,10 +947,10 @@ pub static DEMO_SILO_METRICS_URL: Lazy<String> = Lazy::new(|| {
947947
});
948948

949949
pub static TIMESERIES_LIST_URL: Lazy<String> =
950-
Lazy::new(|| String::from("/v1/timeseries/schema"));
950+
Lazy::new(|| String::from("/v1/system/timeseries/schema"));
951951

952952
pub static TIMESERIES_QUERY_URL: Lazy<String> =
953-
Lazy::new(|| String::from("/v1/timeseries/query"));
953+
Lazy::new(|| String::from("/v1/system/timeseries/query"));
954954

955955
pub static DEMO_TIMESERIES_QUERY: Lazy<params::TimeseriesQuery> =
956956
Lazy::new(|| params::TimeseriesQuery {

nexus/tests/integration_tests/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ async fn test_timeseries_schema_list(
272272
// producing data. Force a collection to ensure that happens.
273273
cptestctx.oximeter.force_collect().await;
274274
let client = &cptestctx.external_client;
275-
let url = "/v1/timeseries/schema";
275+
let url = "/v1/system/timeseries/schema";
276276
let schema =
277277
objects_list_page_authz::<TimeseriesSchema>(client, &url).await;
278278
schema
@@ -300,7 +300,7 @@ pub async fn timeseries_query(
300300
nexus_test_utils::http_testing::RequestBuilder::new(
301301
&cptestctx.external_client,
302302
http::Method::POST,
303-
"/v1/timeseries/query",
303+
"/v1/system/timeseries/query",
304304
)
305305
.body(Some(&body)),
306306
)

openapi/nexus.json

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -8490,6 +8490,96 @@
84908490
}
84918491
}
84928492
},
8493+
"/v1/system/timeseries/query": {
8494+
"post": {
8495+
"tags": [
8496+
"system/metrics"
8497+
],
8498+
"summary": "Run timeseries query",
8499+
"description": "Queries are written in OxQL.",
8500+
"operationId": "system_timeseries_query",
8501+
"requestBody": {
8502+
"content": {
8503+
"application/json": {
8504+
"schema": {
8505+
"$ref": "#/components/schemas/TimeseriesQuery"
8506+
}
8507+
}
8508+
},
8509+
"required": true
8510+
},
8511+
"responses": {
8512+
"200": {
8513+
"description": "successful operation",
8514+
"content": {
8515+
"application/json": {
8516+
"schema": {
8517+
"$ref": "#/components/schemas/OxqlQueryResult"
8518+
}
8519+
}
8520+
}
8521+
},
8522+
"4XX": {
8523+
"$ref": "#/components/responses/Error"
8524+
},
8525+
"5XX": {
8526+
"$ref": "#/components/responses/Error"
8527+
}
8528+
}
8529+
}
8530+
},
8531+
"/v1/system/timeseries/schema": {
8532+
"get": {
8533+
"tags": [
8534+
"system/metrics"
8535+
],
8536+
"summary": "List timeseries schemas",
8537+
"operationId": "system_timeseries_schema_list",
8538+
"parameters": [
8539+
{
8540+
"in": "query",
8541+
"name": "limit",
8542+
"description": "Maximum number of items returned by a single call",
8543+
"schema": {
8544+
"nullable": true,
8545+
"type": "integer",
8546+
"format": "uint32",
8547+
"minimum": 1
8548+
}
8549+
},
8550+
{
8551+
"in": "query",
8552+
"name": "page_token",
8553+
"description": "Token returned by previous call to retrieve the subsequent page",
8554+
"schema": {
8555+
"nullable": true,
8556+
"type": "string"
8557+
}
8558+
}
8559+
],
8560+
"responses": {
8561+
"200": {
8562+
"description": "successful operation",
8563+
"content": {
8564+
"application/json": {
8565+
"schema": {
8566+
"$ref": "#/components/schemas/TimeseriesSchemaResultsPage"
8567+
}
8568+
}
8569+
}
8570+
},
8571+
"4XX": {
8572+
"$ref": "#/components/responses/Error"
8573+
},
8574+
"5XX": {
8575+
"$ref": "#/components/responses/Error"
8576+
}
8577+
},
8578+
"x-dropshot-pagination": {
8579+
"required": []
8580+
}
8581+
}
8582+
},
84938583
"/v1/system/users": {
84948584
"get": {
84958585
"tags": [
@@ -8800,96 +8890,6 @@
88008890
}
88018891
}
88028892
},
8803-
"/v1/timeseries/query": {
8804-
"post": {
8805-
"tags": [
8806-
"metrics"
8807-
],
8808-
"summary": "Run timeseries query",
8809-
"description": "Queries are written in OxQL.",
8810-
"operationId": "timeseries_query",
8811-
"requestBody": {
8812-
"content": {
8813-
"application/json": {
8814-
"schema": {
8815-
"$ref": "#/components/schemas/TimeseriesQuery"
8816-
}
8817-
}
8818-
},
8819-
"required": true
8820-
},
8821-
"responses": {
8822-
"200": {
8823-
"description": "successful operation",
8824-
"content": {
8825-
"application/json": {
8826-
"schema": {
8827-
"$ref": "#/components/schemas/OxqlQueryResult"
8828-
}
8829-
}
8830-
}
8831-
},
8832-
"4XX": {
8833-
"$ref": "#/components/responses/Error"
8834-
},
8835-
"5XX": {
8836-
"$ref": "#/components/responses/Error"
8837-
}
8838-
}
8839-
}
8840-
},
8841-
"/v1/timeseries/schema": {
8842-
"get": {
8843-
"tags": [
8844-
"metrics"
8845-
],
8846-
"summary": "List timeseries schemas",
8847-
"operationId": "timeseries_schema_list",
8848-
"parameters": [
8849-
{
8850-
"in": "query",
8851-
"name": "limit",
8852-
"description": "Maximum number of items returned by a single call",
8853-
"schema": {
8854-
"nullable": true,
8855-
"type": "integer",
8856-
"format": "uint32",
8857-
"minimum": 1
8858-
}
8859-
},
8860-
{
8861-
"in": "query",
8862-
"name": "page_token",
8863-
"description": "Token returned by previous call to retrieve the subsequent page",
8864-
"schema": {
8865-
"nullable": true,
8866-
"type": "string"
8867-
}
8868-
}
8869-
],
8870-
"responses": {
8871-
"200": {
8872-
"description": "successful operation",
8873-
"content": {
8874-
"application/json": {
8875-
"schema": {
8876-
"$ref": "#/components/schemas/TimeseriesSchemaResultsPage"
8877-
}
8878-
}
8879-
}
8880-
},
8881-
"4XX": {
8882-
"$ref": "#/components/responses/Error"
8883-
},
8884-
"5XX": {
8885-
"$ref": "#/components/responses/Error"
8886-
}
8887-
},
8888-
"x-dropshot-pagination": {
8889-
"required": []
8890-
}
8891-
}
8892-
},
88938893
"/v1/users": {
88948894
"get": {
88958895
"tags": [

0 commit comments

Comments
 (0)