Skip to content

Commit 60b99f4

Browse files
feat(cockpit): add datasource filter on listAlert endpoint (#2126)
Co-authored-by: Jonathan R. <jremy@scaleway.com>
1 parent 46d73be commit 60b99f4

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

packages_generated/cockpit/src/v1/api.gen.ts

+1
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ If you need to receive alerts for other receivers, you can create additional con
801801
method: 'GET',
802802
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alerts`,
803803
urlParams: urlParams(
804+
['data_source_id', request.dataSourceId],
804805
['is_enabled', request.isEnabled],
805806
['is_preconfigured', request.isPreconfigured],
806807
[

packages_generated/cockpit/src/v1/marshalling.gen.ts

+1
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ const unmarshalAlert = (data: unknown): Alert => {
294294

295295
return {
296296
annotations: data.annotations,
297+
dataSourceId: data.data_source_id,
297298
duration: data.duration,
298299
enabled: data.enabled,
299300
name: data.name,

packages_generated/cockpit/src/v1/types.gen.ts

+8
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ export interface Alert {
116116
* Contains additional data for preconfigured alerts, such as the rule ID, display name, and description. Only present if the alert is preconfigured.
117117
*/
118118
preconfiguredData?: PreconfiguredAlertData
119+
/**
120+
* ID of the data source containing the alert rule.
121+
*/
122+
dataSourceId: string
119123
}
120124

121125
/**
@@ -964,6 +968,10 @@ export type RegionalApiListAlertsRequest = {
964968
* Valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply.
965969
*/
966970
state?: AlertState
971+
/**
972+
* If omitted, only alerts from the default scaleway data source will be listed.
973+
*/
974+
dataSourceId?: string
967975
}
968976

969977
/**

0 commit comments

Comments
 (0)