@@ -14,7 +14,6 @@ use nexus_db_queries::{
1414use nexus_external_api:: TimeseriesSchemaPaginationParams ;
1515use nexus_types:: external_api:: params:: SystemMetricName ;
1616use omicron_common:: api:: external:: { Error , InternalContext } ;
17- use oximeter:: AuthzScope ;
1817use oximeter_db:: { Measurement , TimeseriesSchema } ;
1918use std:: num:: NonZeroU32 ;
2019
@@ -167,7 +166,7 @@ impl super::Nexus {
167166 }
168167
169168 /// Run an OxQL query against the timeseries database, scoped to a specific project.
170- pub ( crate ) async fn project_timeseries_query (
169+ pub ( crate ) async fn timeseries_query_project (
171170 & self ,
172171 _opctx : & OpContext ,
173172 project_lookup : & lookup:: Project < ' _ > ,
@@ -202,45 +201,4 @@ impl super::Nexus {
202201 _ => Error :: InternalError { internal_message : e. to_string ( ) } ,
203202 } )
204203 }
205-
206- /// List available project-scoped timeseries schema
207- pub ( crate ) async fn project_timeseries_schema_list (
208- & self ,
209- opctx : & OpContext ,
210- pagination : & TimeseriesSchemaPaginationParams ,
211- limit : NonZeroU32 ,
212- ) -> Result < dropshot:: ResultsPage < TimeseriesSchema > , Error > {
213- // any authenticated user should be able to do this
214- let authz_silo = opctx
215- . authn
216- . silo_required ( )
217- . internal_context ( "listing project-scoped timeseries schemas" ) ?;
218- opctx. authorize ( authz:: Action :: ListChildren , & authz_silo) . await ?;
219-
220- self . timeseries_client
221- . timeseries_schema_list ( & pagination. page , limit)
222- . await
223- . and_then ( |schemas| {
224- let filtered = schemas
225- . items
226- . into_iter ( )
227- . filter ( |schema| schema. authz_scope == AuthzScope :: Project )
228- . collect ( ) ;
229- dropshot:: ResultsPage :: new (
230- filtered,
231- & dropshot:: EmptyScanParams { } ,
232- |schema, _| schema. timeseries_name . clone ( ) ,
233- )
234- . map_err ( |err| oximeter_db:: Error :: Database ( err. to_string ( ) ) )
235- } )
236- . map_err ( |e| match e {
237- oximeter_db:: Error :: DatabaseUnavailable ( _)
238- | oximeter_db:: Error :: Connection ( _) => {
239- Error :: ServiceUnavailable {
240- internal_message : e. to_string ( ) ,
241- }
242- }
243- _ => Error :: InternalError { internal_message : e. to_string ( ) } ,
244- } )
245- }
246204}
0 commit comments