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
21 changes: 0 additions & 21 deletions nexus/src/app/oximeter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

//! Oximeter-related functionality

use crate::authz;
use crate::db;
use crate::db::identity::Asset;
use crate::external_api::params::ResourceMetrics;
use crate::internal_api::params::OximeterInfo;
use dns_service_client::multiclient::{ResolveError, Resolver};
use dropshot::PaginationParams;
use internal_dns_names::{ServiceName, SRV};
use nexus_db_queries::context::OpContext;
use omicron_common::address::CLICKHOUSE_PORT;
use omicron_common::api::external::DataPageParams;
use omicron_common::api::external::Error;
Expand All @@ -23,8 +21,6 @@ use omicron_common::backoff;
use oximeter_client::Client as OximeterClient;
use oximeter_db::query::Timestamp;
use oximeter_db::Measurement;
use oximeter_db::TimeseriesSchema;
use oximeter_db::TimeseriesSchemaPaginationParams;
use oximeter_producer::register;
use slog::Logger;
use std::convert::TryInto;
Expand Down Expand Up @@ -204,23 +200,6 @@ impl super::Nexus {
Ok(())
}

/// List existing timeseries schema.
pub async fn timeseries_schema_list(
&self,
opctx: &OpContext,
pag_params: &TimeseriesSchemaPaginationParams,
limit: NonZeroU32,
) -> Result<dropshot::ResultsPage<TimeseriesSchema>, Error> {
opctx.authorize(authz::Action::Read, &authz::FLEET).await?;
self.timeseries_client
.get()
.await
.map_err(|e| Error::internal_error(&e.to_string()))?
.timeseries_schema_list(&pag_params.page, limit)
.await
.map_err(map_oximeter_err)
}

/// Returns a results from the timeseries DB based on the provided query
/// parameters.
///
Expand Down
25 changes: 0 additions & 25 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ pub fn external_api() -> NexusApiDescription {
api.register(user_builtin_list)?;
api.register(user_builtin_view)?;

api.register(timeseries_schema_get)?;

api.register(role_list)?;
api.register(role_view)?;

Expand Down Expand Up @@ -8845,29 +8843,6 @@ async fn user_builtin_view(
apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await
}

/// List timeseries schema
#[endpoint {
method = GET,
path = "/timeseries/schema",
tags = ["metrics"],
}]
async fn timeseries_schema_get(
rqctx: RequestContext<Arc<ServerContext>>,
query_params: Query<oximeter_db::TimeseriesSchemaPaginationParams>,
) -> Result<HttpResponseOk<ResultsPage<oximeter_db::TimeseriesSchema>>, HttpError>
{
let apictx = rqctx.context();
let nexus = &apictx.nexus;
let query = query_params.into_inner();
let limit = rqctx.page_limit(&query)?;
let handler = async {
let opctx = crate::context::op_context_for_external_api(&rqctx).await?;
let list = nexus.timeseries_schema_list(&opctx, &query, limit).await?;
Ok(HttpResponseOk(list))
};
apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await
}

// Built-in roles

// Roles have their own pagination scheme because they do not use the usual "id"
Expand Down
9 changes: 0 additions & 9 deletions nexus/tests/integration_tests/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,15 +1457,6 @@ lazy_static! {
allowed_methods: vec![AllowedMethod::GetNonexistent],
},

/* Timeseries schema */

VerifyEndpoint {
url: "/timeseries/schema",
visibility: Visibility::Public,
unprivileged_access: UnprivilegedAccess::None,
allowed_methods: vec![AllowedMethod::Get],
},

/* Updates */

VerifyEndpoint {
Expand Down
1 change: 0 additions & 1 deletion nexus/tests/integration_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ mod snapshots;
mod ssh_keys;
mod subnet_allocation;
mod system_updates;
mod timeseries;
mod unauthorized;
mod unauthorized_coverage;
mod updates;
Expand Down
54 changes: 0 additions & 54 deletions nexus/tests/integration_tests/timeseries.rs

This file was deleted.

4 changes: 0 additions & 4 deletions nexus/tests/output/nexus_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ login_local /login/{silo_name}/local
login_saml /login/{silo_name}/saml/{provider_name}
login_saml_begin /login/{silo_name}/saml/{provider_name}

API operations found with tag "metrics"
OPERATION ID URL PATH
timeseries_schema_get /timeseries/schema

API operations found with tag "organizations"
OPERATION ID URL PATH
organization_create /organizations
Expand Down
159 changes: 0 additions & 159 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -7667,56 +7667,6 @@
}
}
},
"/timeseries/schema": {
"get": {
"tags": [
"metrics"
],
"summary": "List timeseries schema",
"operationId": "timeseries_schema_get",
"parameters": [
{
"in": "query",
"name": "limit",
"description": "Maximum number of items returned by a single call",
"schema": {
"nullable": true,
"type": "integer",
"format": "uint32",
"minimum": 1
}
},
{
"in": "query",
"name": "page_token",
"description": "Token returned by previous call to retrieve the subsequent page",
"schema": {
"nullable": true,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TimeseriesSchemaResultsPage"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
},
"x-dropshot-pagination": true
}
},
"/users": {
"get": {
"tags": [
Expand Down Expand Up @@ -15221,21 +15171,6 @@
}
]
},
"DatumType": {
"description": "The type of an individual datum of a metric.",
"type": "string",
"enum": [
"bool",
"i64",
"f64",
"string",
"bytes",
"cumulative_i64",
"cumulative_f64",
"histogram_i64",
"histogram_f64"
]
},
"DerEncodedKeyPair": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -15802,45 +15737,6 @@
"items"
]
},
"FieldSchema": {
"description": "The name and type information for a field of a timeseries schema.",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"source": {
"$ref": "#/components/schemas/FieldSource"
},
"ty": {
"$ref": "#/components/schemas/FieldType"
}
},
"required": [
"name",
"source",
"ty"
]
},
"FieldSource": {
"description": "The source from which a field is derived, the target or metric.",
"type": "string",
"enum": [
"target",
"metric"
]
},
"FieldType": {
"description": "The `FieldType` identifies the data type of a target or metric field.",
"type": "string",
"enum": [
"string",
"i64",
"ip_addr",
"uuid",
"bool"
]
},
"FleetRole": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -19026,61 +18922,6 @@
"version_range"
]
},
"TimeseriesName": {
"title": "The name of a timeseries",
"description": "Names are constructed by concatenating the target and metric names with ':'. Target and metric names must be lowercase alphanumeric characters with '_' separating words.",
"type": "string",
"pattern": "(([a-z]+[a-z0-9]*)(_([a-z0-9]+))*):(([a-z]+[a-z0-9]*)(_([a-z0-9]+))*)"
},
"TimeseriesSchema": {
"description": "The schema for a timeseries.\n\nThis includes the name of the timeseries, as well as the datum type of its metric and the schema for each field.",
"type": "object",
"properties": {
"created": {
"type": "string",
"format": "date-time"
},
"datum_type": {
"$ref": "#/components/schemas/DatumType"
},
"field_schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FieldSchema"
}
},
"timeseries_name": {
"$ref": "#/components/schemas/TimeseriesName"
}
},
"required": [
"created",
"datum_type",
"field_schema",
"timeseries_name"
]
},
"TimeseriesSchemaResultsPage": {
"description": "A single page of results",
"type": "object",
"properties": {
"items": {
"description": "list of items on this page of results",
"type": "array",
"items": {
"$ref": "#/components/schemas/TimeseriesSchema"
}
},
"next_page": {
"nullable": true,
"description": "token used to fetch the next page of results (if any)",
"type": "string"
}
},
"required": [
"items"
]
},
"UpdateDeployment": {
"description": "Identity-related metadata that's included in \"asset\" public API objects (which generally have no name or description)",
"type": "object",
Expand Down