1import { AlertQuery, GrafanaAlertStateDecision } from 'app/types/unified-alerting-dto';
2
3export enum RuleFormType {
4  grafana = 'grafana',
5  cloudAlerting = 'cloud-alerting',
6  cloudRecording = 'cloud-recording',
7}
8
9export interface RuleFormValues {
10  // common
11  name: string;
12  type?: RuleFormType;
13  dataSourceName: string | null;
14
15  labels: Array<{ key: string; value: string }>;
16  annotations: Array<{ key: string; value: string }>;
17
18  // grafana rules
19  queries: AlertQuery[];
20  condition: string | null; // refId of the query that gets alerted on
21  noDataState: GrafanaAlertStateDecision;
22  execErrState: GrafanaAlertStateDecision;
23  folder: { title: string; id: number } | null;
24  evaluateEvery: string;
25  evaluateFor: string;
26
27  // cortex / loki rules
28  namespace: string;
29  group: string;
30  forTime: number;
31  forTimeUnit: string;
32  expression: string;
33}
34