-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathalert.ts
More file actions
72 lines (56 loc) · 2.1 KB
/
alert.ts
File metadata and controls
72 lines (56 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import http from '@/api';
import { ResPage } from '@/api/interface';
import { Alert } from '../interface/alert';
import { deepCopy } from '@/utils/misc';
export const SearchAlerts = (req: Alert.AlertSearch) => {
return http.post<ResPage<Alert.AlertInfo>>(`/alert/search`, req);
};
export const CreateAlert = (req: Alert.AlertCreateReq) => {
let request = deepCopy(req) as Alert.AlertCreateReq;
return http.post<any>(`/alert`, request);
};
export const UpdateAlert = (req: Alert.AlertUpdateReq) => {
return http.post<any>(`/alert/update`, req);
};
export const DeleteAlert = (req: Alert.DelReq) => {
return http.post<any>(`/alert/del`, req);
};
export const UpdateAlertStatus = (req: Alert.AlertUpdateStatusReq) => {
return http.post<any>(`/alert/status`, req);
};
export const ListDisks = () => {
return http.get<Alert.DisksDTO[]>(`/alert/disks/list`);
};
export const SearchAlertLogs = (req: Alert.AlertLogSearch) => {
return http.post<ResPage<Alert.AlertLog>>(`/alert/logs/search`, req);
};
export const CleanAlertLogs = () => {
return http.post<any>(`/alert/logs/clean`);
};
export const ListClams = () => {
return http.get<Alert.ClamsDTO[]>(`/alert/clams/list`);
};
export const ListCronJob = (req: Alert.CronJobReq) => {
return http.post<Alert.CronJobDTO[]>(`/alert/cronjob/list`, req);
};
export const ListAlertConfigs = () => {
return http.post<Alert.AlertConfigInfo[]>(`/alert/config/info`);
};
export const DeleteAlertConfig = (req: Alert.DelReq) => {
return http.post<any>(`/alert/config/del`, req);
};
export const UpdateAlertConfig = (req: Alert.AlertConfigUpdateReq) => {
return http.post<any>(`/alert/config/update`, req);
};
export const TestAlertConfig = (req: Alert.AlertConfigTest) => {
return http.post<any>(`/alert/config/test`, req);
};
export const SyncAlertInfo = (req: Alert.AlertLogId) => {
return http.post<any>(`/xpack/alert/logs/sync`, req);
};
export const SyncAlertAll = () => {
return http.post<any>(`/xpack/alert/logs/sync/all`);
};
export const SyncOfflineAlert = () => {
return http.post<any>(`/core/xpack/alert/offline/sync`);
};