diff --git a/nexus/src/app/oximeter.rs b/nexus/src/app/oximeter.rs index 350ad394761..af1a8f8ef30 100644 --- a/nexus/src/app/oximeter.rs +++ b/nexus/src/app/oximeter.rs @@ -4,7 +4,6 @@ //! Oximeter-related functionality -use crate::authz; use crate::db; use crate::db::identity::Asset; use crate::external_api::params::ResourceMetrics; @@ -12,7 +11,6 @@ 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; @@ -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; @@ -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, 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. /// diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index b2004e23a08..e96dd677f7d 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -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)?; @@ -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>, - query_params: Query, -) -> Result>, 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" diff --git a/nexus/tests/integration_tests/endpoints.rs b/nexus/tests/integration_tests/endpoints.rs index aea7d595e05..c1034d8912e 100644 --- a/nexus/tests/integration_tests/endpoints.rs +++ b/nexus/tests/integration_tests/endpoints.rs @@ -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 { diff --git a/nexus/tests/integration_tests/mod.rs b/nexus/tests/integration_tests/mod.rs index bb1cdde7878..cb44ae77ac7 100644 --- a/nexus/tests/integration_tests/mod.rs +++ b/nexus/tests/integration_tests/mod.rs @@ -31,7 +31,6 @@ mod snapshots; mod ssh_keys; mod subnet_allocation; mod system_updates; -mod timeseries; mod unauthorized; mod unauthorized_coverage; mod updates; diff --git a/nexus/tests/integration_tests/timeseries.rs b/nexus/tests/integration_tests/timeseries.rs deleted file mode 100644 index 0f2bd84b28b..00000000000 --- a/nexus/tests/integration_tests/timeseries.rs +++ /dev/null @@ -1,54 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -use nexus_test_utils::resource_helpers::objects_list_page_authz; -use nexus_test_utils_macros::nexus_test; -use omicron_test_utils::dev::poll::{wait_for_condition, CondCheckError}; -use oximeter_db::TimeseriesSchema; -use std::convert::Infallible; -use std::time::Duration; - -type ControlPlaneTestContext = - nexus_test_utils::ControlPlaneTestContext; - -#[nexus_test] -async fn test_timeseries_schema(context: &ControlPlaneTestContext) { - let client = &context.external_client; - - const POLL_INTERVAL: Duration = Duration::from_millis(500); - const POLL_DURATION: Duration = Duration::from_secs(10); - let page = wait_for_condition( - || async { - let page = objects_list_page_authz::( - client, - "/timeseries/schema", - ) - .await; - if page.items.is_empty() { - Err(CondCheckError::::NotYet) - } else { - Ok(page) - } - }, - &POLL_INTERVAL, - &POLL_DURATION, - ) - .await - .expect("Expected at least one timeseries schema"); - assert!( - page.items.iter().any(|schema| schema.timeseries_name - == "integration_target:integration_metric"), - "Expected to find a particular timeseries schema" - ); - - let url = format!( - "/timeseries/schema?page_token={}", - page.next_page.as_ref().unwrap() - ); - let page = objects_list_page_authz::(client, &url).await; - assert!( - page.next_page.is_none(), - "Expected exactly one page of timeseries schema" - ); -} diff --git a/nexus/tests/output/nexus_tags.txt b/nexus/tests/output/nexus_tags.txt index f4dcf434509..2eb356dbef6 100644 --- a/nexus/tests/output/nexus_tags.txt +++ b/nexus/tests/output/nexus_tags.txt @@ -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 diff --git a/openapi/nexus.json b/openapi/nexus.json index a54b2cbbf29..ba19fdcd26e 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -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": [ @@ -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": { @@ -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": [ @@ -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",