Skip to content

feat(cockpit): add rule status on ListAlert endpoint #2236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages_generated/applesilicon/src/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export {
export * from './content.gen'
export * from './marshalling.gen'
export type {
BatchCreateServersRequest,
BatchCreateServersRequestBatchInnerCreateServerRequest,
BatchCreateServersResponse,
Commitment,
CommitmentType,
CommitmentTypeValue,
Expand Down
2 changes: 1 addition & 1 deletion packages_generated/cockpit/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,12 +822,12 @@ If you need to receive alerts for other receivers, you can create additional con
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alerts`,
urlParams: urlParams(
['data_source_id', request.dataSourceId],
['is_enabled', request.isEnabled],
['is_preconfigured', request.isPreconfigured],
[
'project_id',
request.projectId ?? this.client.settings.defaultProjectId,
],
['rule_status', request.ruleStatus],
['state', request.state],
),
},
Expand Down
1 change: 1 addition & 0 deletions packages_generated/cockpit/src/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type {
Alert,
AlertManager,
AlertState,
AlertStatus,
ContactPoint,
ContactPointEmail,
DataSource,
Expand Down
2 changes: 1 addition & 1 deletion packages_generated/cockpit/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,14 @@ const unmarshalAlert = (data: unknown): Alert => {
annotations: data.annotations,
dataSourceId: data.data_source_id,
duration: data.duration,
enabled: data.enabled,
name: data.name,
preconfigured: data.preconfigured,
preconfiguredData: data.preconfigured_data
? unmarshalPreconfiguredAlertData(data.preconfigured_data)
: undefined,
region: data.region,
rule: data.rule,
ruleStatus: data.rule_status,
state: data.state ? data.state : undefined,
} as Alert
}
Expand Down
15 changes: 11 additions & 4 deletions packages_generated/cockpit/src/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import type { Region as ScwRegion } from '@scaleway/sdk-client'

export type AlertState = 'unknown_state' | 'inactive' | 'pending' | 'firing'

export type AlertStatus =
| 'unknown_status'
| 'enabled'
| 'disabled'
| 'enabling'
| 'disabling'

export type DataSourceOrigin =
| 'unknown_origin'
| 'scaleway'
Expand Down Expand Up @@ -124,9 +131,9 @@ export interface Alert {
*/
duration: string
/**
* Indicates if the alert is enabled or disabled. Only preconfigured alerts can be disabled.
* Indicates if the alert is enabled, enabling, disabled or disabling. Preconfigured alerts can have any of these values, whereas custom alerts can only have the status "enabled".
*/
enabled: boolean
ruleStatus: AlertStatus
/**
* Current state of the alert. Possible states are `inactive`, `pending`, and `firing`.
*/
Expand Down Expand Up @@ -1030,9 +1037,9 @@ export type RegionalApiListAlertsRequest = {
*/
projectId?: string
/**
* True returns only enabled alerts. False returns only disabled alerts. If omitted, no alert filtering is applied. Other filters may still apply.
* Returns only alerts with the given activation status. If omitted, no alert filtering is applied. Other filters may still apply.
*/
isEnabled?: boolean
ruleStatus?: AlertStatus
/**
* True returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply.
*/
Expand Down
Loading