From c254b81461c75979090b1fc6358cc435b8de30be Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Mon, 25 Nov 2024 10:11:32 +0100 Subject: [PATCH] revert(cockpit): set back external enum (#1590) --- .../clients/src/api/cockpit/v1/api.gen.ts | 23 ------------------- .../clients/src/api/cockpit/v1/index.gen.ts | 2 -- .../src/api/cockpit/v1/marshalling.gen.ts | 14 ----------- .../clients/src/api/cockpit/v1/types.gen.ts | 19 +++++---------- 4 files changed, 6 insertions(+), 52 deletions(-) diff --git a/packages/clients/src/api/cockpit/v1/api.gen.ts b/packages/clients/src/api/cockpit/v1/api.gen.ts index eb45e6f31..e04a5b3db 100644 --- a/packages/clients/src/api/cockpit/v1/api.gen.ts +++ b/packages/clients/src/api/cockpit/v1/api.gen.ts @@ -23,7 +23,6 @@ import { marshalRegionalApiTriggerTestAlertRequest, marshalRegionalApiUpdateDataSourceRequest, unmarshalAlertManager, - unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDataSource, unmarshalGetConfigResponse, @@ -43,7 +42,6 @@ import { } from './marshalling.gen' import type { AlertManager, - CockpitMetrics, ContactPoint, DataSource, GetConfigResponse, @@ -80,7 +78,6 @@ import type { RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, - RegionalApiGetCockpitMetricsRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, @@ -918,24 +915,4 @@ export class RegionalAPI extends ParentAPI { method: 'POST', path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`, }) - - getCockpitMetrics = ( - request: Readonly, - ) => - this.client.fetch( - { - method: 'GET', - path: `/cockpit/v1beta1/cockpit/metrics`, - urlParams: urlParams( - ['end_date', request.endDate], - [ - 'project_id', - request.projectId ?? this.client.settings.defaultProjectId, - ], - ['query', request.query], - ['start_date', request.startDate], - ), - }, - unmarshalCockpitMetrics, - ) } diff --git a/packages/clients/src/api/cockpit/v1/index.gen.ts b/packages/clients/src/api/cockpit/v1/index.gen.ts index 995b85a99..421639703 100644 --- a/packages/clients/src/api/cockpit/v1/index.gen.ts +++ b/packages/clients/src/api/cockpit/v1/index.gen.ts @@ -4,7 +4,6 @@ export { GlobalAPI, RegionalAPI } from './api.gen' export type { Alert, AlertManager, - CockpitMetrics, ContactPoint, ContactPointEmail, DataSource, @@ -52,7 +51,6 @@ export type { RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, - RegionalApiGetCockpitMetricsRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, diff --git a/packages/clients/src/api/cockpit/v1/marshalling.gen.ts b/packages/clients/src/api/cockpit/v1/marshalling.gen.ts index aee142232..30b8ad846 100644 --- a/packages/clients/src/api/cockpit/v1/marshalling.gen.ts +++ b/packages/clients/src/api/cockpit/v1/marshalling.gen.ts @@ -5,13 +5,11 @@ import { resolveOneOf, unmarshalArrayOfObject, unmarshalDate, - unmarshalTimeSeries, } from '../../../bridge' import type { DefaultValues } from '../../../bridge' import type { Alert, AlertManager, - CockpitMetrics, ContactPoint, ContactPointEmail, DataSource, @@ -180,18 +178,6 @@ export const unmarshalAlertManager = (data: unknown): AlertManager => { } as AlertManager } -export const unmarshalCockpitMetrics = (data: unknown): CockpitMetrics => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`, - ) - } - - return { - timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries), - } as CockpitMetrics -} - const unmarshalGetConfigResponseRetention = ( data: unknown, ): GetConfigResponseRetention => { diff --git a/packages/clients/src/api/cockpit/v1/types.gen.ts b/packages/clients/src/api/cockpit/v1/types.gen.ts index 1ca010d26..6b4ee76c5 100644 --- a/packages/clients/src/api/cockpit/v1/types.gen.ts +++ b/packages/clients/src/api/cockpit/v1/types.gen.ts @@ -1,8 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region, TimeSeries } from '../../../bridge' +import type { Region } from '../../../bridge' -export type DataSourceOrigin = 'unknown_origin' | 'scaleway' | 'custom' +export type DataSourceOrigin = + | 'unknown_origin' + | 'scaleway' + | 'external' + | 'custom' export type DataSourceType = 'unknown_type' | 'metrics' | 'logs' | 'traces' @@ -207,10 +211,6 @@ export interface AlertManager { region: Region } -export interface CockpitMetrics { - timeseries: TimeSeries[] -} - /** Cockpit configuration. */ export interface GetConfigResponse { /** Custom metrics retention configuration. */ @@ -539,13 +539,6 @@ export type RegionalApiGetAlertManagerRequest = { projectId?: string } -export type RegionalApiGetCockpitMetricsRequest = { - projectId?: string - startDate?: Date - endDate?: Date - query: string -} - /** Get Cockpit configuration. */ export type RegionalApiGetConfigRequest = { /**