Newer
Older
import { HttpClient } from "@angular/common/http";
import {Observable} from "rxjs/Rx";
import { Injectable } from '@angular/core';
import {SERVER_API_URL} from "../app.constants";
@Injectable()
export class OverAllService {
constructor(private http: HttpClient) {
}
//资源列表--所有类型
find(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/find',data);
}
//停止-开启监控
stopOrOpen(params1,params2): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/stopOrOpen/'+ params1 + "/" + params2);
}
//批量停止开启监控接口
batchStopOrOpen(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/batchStopOrOpen',data);
}
//资源列表--资源分组
findGroup(): Observable<any>{
return this.http.get(SERVER_API_URL + '/groups/getAll');
}
//资源列表--设备类型
findType(): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/selectAllEquipmentType');
}
return this.http.post(SERVER_API_URL + '/host/selectAllHostByType/',data);
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
73
74
75
76
//资源列表--查询主机
findDetail(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/find',data);
}
//资源详情
findDetailed(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/findDetailed/'+ data);
}
//平均响应时间
responseTime(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/responseTime/'+ data);
}
//丢包率
losed(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/losed/'+ data );
}
//CPU使用率
cupUsed(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/cpuUsed/'+ data.hostId+ "/"+ data.hostType);
}
//内存使用率
used(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/used/'+ data.hostId+ "/"+ data.hostType);
}
//磁盘使用率
disks(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/disks/'+ data.hostId+ "/"+ data.hostType);
}
//进出口流量 --SNMP
inOutInfoSnmp(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/inOutInfo', data);
}
//进出口流量 --
inOutInfoAgent(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/inOutInfoAgent/'+ data);
}
//主机接口
getinterface(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/hostInterface/getinterface/'+ data);
}
//查询键值
zabbixKey(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/zabbixKey/find/'+ data);
}
//创建监控点
create(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/item/create', data);
}
//删除资源--get
deleteHostGet(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/deleteHost/'+ data);
}
deleteHostPost(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/deleteHost', data);
}
//添加资源
createHost(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/host/create', data);
}
//获取分组信息
getgroups(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/groups/getgroups', data);
}
//模版信息
templates(): Observable<any>{
return this.http.get(SERVER_API_URL + '/templates');
}
//添加分组
createGroup(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/groups/create',data);
}
//修改分组
updataGroup(data): Observable<any>{
return this.http.put(SERVER_API_URL + '/groups/updata',data);
}
//删除分组
deleteGroup(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/groups/delete',data);
}
//删除监控项
deleteItem(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/item/deleteItem',data);
}
//监控设备数
findSize(): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/findSize');
}
//监测点列表--type
findCheckByType(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/item/find/' ,data);
}
//查询监控项
findItemDetail(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/item/details/' +params);
}
//监控项分类
findItemType(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/application/find' ,data);
}
//新增监控项分类
createItemType(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/application/create' ,data);
}
//监测点状态统计
findItemCount(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/item/findItemStatistics/' +params);
return this.http.post(SERVER_API_URL + '/graph/findGraphData/' ,data);
}
//监控项编辑
itemUpdate(data): Observable<any>{
return this.http.put(SERVER_API_URL + '/item/updata/' , data);
}
return this.http.post(SERVER_API_URL + '/host/tempStop', data);
//查询报警主机 和报警数量 以及最高报警级别
findHostWarningCount(): Observable<any>{
return this.http.get(SERVER_API_URL + '/statistics/findHostWarningCount');
}
//查询所有告警组
findWarnAll(): Observable<any>{
return this.http.get(SERVER_API_URL + '/alertGroup/findAll');
}
//修改资源
updateHost(data): Observable<any>{
return this.http.put(SERVER_API_URL + '/host/updataHost',data);
}
//根据host的启用状态查询count 记录数
findHostCountByStatus(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/findHostCountByStatus/' + params);
}
//查询所有主机的警告数和高危报警数
findWarningByAll(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/statistics/findWarningByAll/' + params);
}
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
//网站监测
//查询网站监测列表
findWebscenario(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/find' ,data);
}
//修改网站监测
updateWebscenario(data): Observable<any>{
return this.http.put(SERVER_API_URL + '/webscenario/update' ,data);
}
//创建网站监测
createWebscenario(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/create' ,data);
}
//临时暂停
tempStopWebscenario(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/tempStop' ,data);
}
//取消临时暂停
tempStopCancelWebscenario(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/temp-stop-cancel/' +params);
}
//启用禁用网站监测
statusBatch(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/statusBatch' ,data);
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
}
//批量删除网站监测
deleteBatch(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/delete' ,data);
}
//查找单个网站监测(数据回显接口)
findWeb(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find/' +params);
}
//添加告警-查询告警目标接口
findAlertAim(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find-alert-aim/' +params);
}
//添加告警接口
addWebAction(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/add-web-action' ,data);
}
//查找最近一条监测状态
findCurrentState(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find-current-state/' +params);
}
//查找监测图表数据
findChart(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/findChart' ,data);
}
//查找阈值设定
findTrigger(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find-trigger/' +params);
}
//网站监测历史告警
findAlert(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/findAlert' ,data);
}