Skip to content

Commit 7f5d82d

Browse files
committed
feat: update generated APIs
1 parent 3006f07 commit 7f5d82d

File tree

5 files changed

+56
-2
lines changed

5 files changed

+56
-2
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
marshalRegionalApiTriggerTestAlertRequest,
2424
marshalRegionalApiUpdateDataSourceRequest,
2525
unmarshalAlertManager,
26+
unmarshalCockpitMetrics,
2627
unmarshalContactPoint,
2728
unmarshalDataSource,
2829
unmarshalGetConfigResponse,
@@ -42,6 +43,7 @@ import {
4243
} from './marshalling.gen'
4344
import type {
4445
AlertManager,
46+
CockpitMetrics,
4547
ContactPoint,
4648
DataSource,
4749
GetConfigResponse,
@@ -78,6 +80,7 @@ import type {
7880
RegionalApiEnableAlertManagerRequest,
7981
RegionalApiEnableManagedAlertsRequest,
8082
RegionalApiGetAlertManagerRequest,
83+
RegionalApiGetCockpitMetricsRequest,
8184
RegionalApiGetConfigRequest,
8285
RegionalApiGetDataSourceRequest,
8386
RegionalApiGetTokenRequest,
@@ -915,4 +918,24 @@ export class RegionalAPI extends ParentAPI {
915918
method: 'POST',
916919
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`,
917920
})
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+
)
918941
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export { GlobalAPI, RegionalAPI } from './api.gen'
44
export type {
55
Alert,
66
AlertManager,
7+
CockpitMetrics,
78
ContactPoint,
89
ContactPointEmail,
910
DataSource,
@@ -51,6 +52,7 @@ export type {
5152
RegionalApiEnableAlertManagerRequest,
5253
RegionalApiEnableManagedAlertsRequest,
5354
RegionalApiGetAlertManagerRequest,
55+
RegionalApiGetCockpitMetricsRequest,
5456
RegionalApiGetConfigRequest,
5557
RegionalApiGetDataSourceRequest,
5658
RegionalApiGetTokenRequest,

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import {
55
resolveOneOf,
66
unmarshalArrayOfObject,
77
unmarshalDate,
8+
unmarshalTimeSeries,
89
} from '../../../bridge'
910
import type { DefaultValues } from '../../../bridge'
1011
import type {
1112
Alert,
1213
AlertManager,
14+
CockpitMetrics,
1315
ContactPoint,
1416
ContactPointEmail,
1517
DataSource,
@@ -178,6 +180,18 @@ export const unmarshalAlertManager = (data: unknown): AlertManager => {
178180
} as AlertManager
179181
}
180182

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+
181195
const unmarshalGetConfigResponseRetention = (
182196
data: unknown,
183197
): GetConfigResponseRetention => {

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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 } from '../../../bridge'
3+
import type { Region, TimeSeries } from '../../../bridge'
44

5-
export type DataSourceOrigin = 'unknown_origin' | 'scaleway' | 'external'
5+
export type DataSourceOrigin = 'unknown_origin' | 'scaleway' | 'custom'
66

77
export type DataSourceType = 'unknown_type' | 'metrics' | 'logs' | 'traces'
88

@@ -207,6 +207,10 @@ export interface AlertManager {
207207
region: Region
208208
}
209209

210+
export interface CockpitMetrics {
211+
timeseries: TimeSeries[]
212+
}
213+
210214
/** Cockpit configuration. */
211215
export interface GetConfigResponse {
212216
/** Custom metrics retention configuration. */
@@ -535,6 +539,13 @@ export type RegionalApiGetAlertManagerRequest = {
535539
projectId?: string
536540
}
537541

542+
export type RegionalApiGetCockpitMetricsRequest = {
543+
projectId?: string
544+
startDate?: Date
545+
endDate?: Date
546+
query: string
547+
}
548+
538549
/** Get Cockpit configuration. */
539550
export type RegionalApiGetConfigRequest = {
540551
/**

packages/clients/src/api/iam/v1alpha1/index.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export type {
3333
GetQuotumRequest,
3434
GetSSHKeyRequest,
3535
GetUserRequest,
36+
GracePeriod,
37+
GracePeriodType,
3638
Group,
3739
JWT,
3840
ListAPIKeysRequest,
@@ -41,6 +43,8 @@ export type {
4143
ListApplicationsRequest,
4244
ListApplicationsRequestOrderBy,
4345
ListApplicationsResponse,
46+
ListGracePeriodsRequest,
47+
ListGracePeriodsResponse,
4448
ListGroupsRequest,
4549
ListGroupsRequestOrderBy,
4650
ListGroupsResponse,

0 commit comments

Comments
 (0)