Skip to content

Commit

Permalink
revert(cockpit): set back external enum (scaleway#1590)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Nov 25, 2024
1 parent 35cdb3a commit c254b81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 52 deletions.
23 changes: 0 additions & 23 deletions packages/clients/src/api/cockpit/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
marshalRegionalApiTriggerTestAlertRequest,
marshalRegionalApiUpdateDataSourceRequest,
unmarshalAlertManager,
unmarshalCockpitMetrics,
unmarshalContactPoint,
unmarshalDataSource,
unmarshalGetConfigResponse,
Expand All @@ -43,7 +42,6 @@ import {
} from './marshalling.gen'
import type {
AlertManager,
CockpitMetrics,
ContactPoint,
DataSource,
GetConfigResponse,
Expand Down Expand Up @@ -80,7 +78,6 @@ import type {
RegionalApiEnableAlertManagerRequest,
RegionalApiEnableManagedAlertsRequest,
RegionalApiGetAlertManagerRequest,
RegionalApiGetCockpitMetricsRequest,
RegionalApiGetConfigRequest,
RegionalApiGetDataSourceRequest,
RegionalApiGetTokenRequest,
Expand Down Expand Up @@ -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<RegionalApiGetCockpitMetricsRequest>,
) =>
this.client.fetch<CockpitMetrics>(
{
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,
)
}
2 changes: 0 additions & 2 deletions packages/clients/src/api/cockpit/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export { GlobalAPI, RegionalAPI } from './api.gen'
export type {
Alert,
AlertManager,
CockpitMetrics,
ContactPoint,
ContactPointEmail,
DataSource,
Expand Down Expand Up @@ -52,7 +51,6 @@ export type {
RegionalApiEnableAlertManagerRequest,
RegionalApiEnableManagedAlertsRequest,
RegionalApiGetAlertManagerRequest,
RegionalApiGetCockpitMetricsRequest,
RegionalApiGetConfigRequest,
RegionalApiGetDataSourceRequest,
RegionalApiGetTokenRequest,
Expand Down
14 changes: 0 additions & 14 deletions packages/clients/src/api/cockpit/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import {
resolveOneOf,
unmarshalArrayOfObject,
unmarshalDate,
unmarshalTimeSeries,
} from '../../../bridge'
import type { DefaultValues } from '../../../bridge'
import type {
Alert,
AlertManager,
CockpitMetrics,
ContactPoint,
ContactPointEmail,
DataSource,
Expand Down Expand Up @@ -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 => {
Expand Down
19 changes: 6 additions & 13 deletions packages/clients/src/api/cockpit/v1/types.gen.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -207,10 +211,6 @@ export interface AlertManager {
region: Region
}

export interface CockpitMetrics {
timeseries: TimeSeries[]
}

/** Cockpit configuration. */
export interface GetConfigResponse {
/** Custom metrics retention configuration. */
Expand Down Expand Up @@ -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 = {
/**
Expand Down

0 comments on commit c254b81

Please sign in to comment.