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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//资源列表--查询主机
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);
}
//进出口流量 --交换机
inOutInfosnmp(data): Observable<any>{
return this.http.get(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);
}
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
//删除分组
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);
}
//监控项分类
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(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/item/findItemCount/' +data);
}
//监测点图形数据
findGraphData(data): Observable<any>{
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);
}