Skip to content

Commit c254b81

Browse files
authored
revert(cockpit): set back external enum (#1590)
1 parent 35cdb3a commit c254b81

File tree

4 files changed

+6
-52
lines changed

4 files changed

+6
-52
lines changed

packages/clients/src/api/cockpit/v1/api.gen.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
marshalRegionalApiTriggerTestAlertRequest,
2424
marshalRegionalApiUpdateDataSourceRequest,
2525
unmarshalAlertManager,
26-
unmarshalCockpitMetrics,
2726
unmarshalContactPoint,
2827
unmarshalDataSource,
2928
unmarshalGetConfigResponse,
@@ -43,7 +42,6 @@ import {
4342
} from './marshalling.gen'
4443
import type {
4544
AlertManager,
46-
CockpitMetrics,
4745
ContactPoint,
4846
DataSource,
4947
GetConfigResponse,
@@ -80,7 +78,6 @@ import type {
8078
RegionalApiEnableAlertManagerRequest,
8179
RegionalApiEnableManagedAlertsRequest,
8280
RegionalApiGetAlertManagerRequest,
83-
RegionalApiGetCockpitMetricsRequest,
8481
RegionalApiGetConfigRequest,
8582
RegionalApiGetDataSourceRequest,
8683
RegionalApiGetTokenRequest,
@@ -918,24 +915,4 @@ export class RegionalAPI extends ParentAPI {
918915
method: 'POST',
919916
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`,
920917
})
921-
922-
getCockpitMetrics = (
923-
request: Readonly<RegionalApiGetCockpitMetricsRequest>,
924-
) =>
925-
this.client.fetch<CockpitMetrics>(
926-
{
927-
method: 'GET',
928-
path: `/cockpit/v1beta1/cockpit/metrics`,
929-
urlParams: urlParams(
930-
['end_date', request.endDate],
931-
[
932-
'project_id',
933-
request.projectId ?? this.client.settings.defaultProjectId,
934-
],
935-
['query', request.query],
936-
['start_date', request.startDate],
937-
),
938-
},
939-
unmarshalCockpitMetrics,
940-
)
941918
}

packages/clients/src/api/cockpit/v1/index.gen.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export { GlobalAPI, RegionalAPI } from './api.gen'
44
export type {
55
Alert,
66
AlertManager,
7-
CockpitMetrics,
87
ContactPoint,
98
ContactPointEmail,
109
DataSource,
@@ -52,7 +51,6 @@ export type {
5251
RegionalApiEnableAlertManagerRequest,
5352
RegionalApiEnableManagedAlertsRequest,
5453
RegionalApiGetAlertManagerRequest,
55-
RegionalApiGetCockpitMetricsRequest,
5654
RegionalApiGetConfigRequest,
5755
RegionalApiGetDataSourceRequest,
5856
RegionalApiGetTokenRequest,

packages/clients/src/api/cockpit/v1/marshalling.gen.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import {
55
resolveOneOf,
66
unmarshalArrayOfObject,
77
unmarshalDate,
8-
unmarshalTimeSeries,
98
} from '../../../bridge'
109
import type { DefaultValues } from '../../../bridge'
1110
import type {
1211
Alert,
1312
AlertManager,
14-
CockpitMetrics,
1513
ContactPoint,
1614
ContactPointEmail,
1715
DataSource,
@@ -180,18 +178,6 @@ export const unmarshalAlertManager = (data: unknown): AlertManager => {
180178
} as AlertManager
181179
}
182180

183-
export const unmarshalCockpitMetrics = (data: unknown): CockpitMetrics => {
184-
if (!isJSONObject(data)) {
185-
throw new TypeError(
186-
`Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`,
187-
)
188-
}
189-
190-
return {
191-
timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries),
192-
} as CockpitMetrics
193-
}
194-
195181
const unmarshalGetConfigResponseRetention = (
196182
data: unknown,
197183
): GetConfigResponseRetention => {

packages/clients/src/api/cockpit/v1/types.gen.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
3-
import type { Region, TimeSeries } from '../../../bridge'
3+
import type { Region } from '../../../bridge'
44

5-
export type DataSourceOrigin = 'unknown_origin' | 'scaleway' | 'custom'
5+
export type DataSourceOrigin =
6+
| 'unknown_origin'
7+
| 'scaleway'
8+
| 'external'
9+
| 'custom'
610

711
export type DataSourceType = 'unknown_type' | 'metrics' | 'logs' | 'traces'
812

@@ -207,10 +211,6 @@ export interface AlertManager {
207211
region: Region
208212
}
209213

210-
export interface CockpitMetrics {
211-
timeseries: TimeSeries[]
212-
}
213-
214214
/** Cockpit configuration. */
215215
export interface GetConfigResponse {
216216
/** Custom metrics retention configuration. */
@@ -539,13 +539,6 @@ export type RegionalApiGetAlertManagerRequest = {
539539
projectId?: string
540540
}
541541

542-
export type RegionalApiGetCockpitMetricsRequest = {
543-
projectId?: string
544-
startDate?: Date
545-
endDate?: Date
546-
query: string
547-
}
548-
549542
/** Get Cockpit configuration. */
550543
export type RegionalApiGetConfigRequest = {
551544
/**

0 commit comments

Comments
 (0)