Chore: ZabbixConnector types
This commit is contained in:
@@ -34,7 +34,7 @@ export class ZabbixDatasource {
|
|||||||
dbConnectionDatasourceName: string;
|
dbConnectionDatasourceName: string;
|
||||||
dbConnectionRetentionPolicy: string;
|
dbConnectionRetentionPolicy: string;
|
||||||
enableDebugLog: boolean;
|
enableDebugLog: boolean;
|
||||||
zabbix: any;
|
zabbix: Zabbix;
|
||||||
|
|
||||||
replaceTemplateVars: (target: any, scopedVars?: any) => any;
|
replaceTemplateVars: (target: any, scopedVars?: any) => any;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
export interface ZabbixConnector {
|
export interface ZabbixConnector {
|
||||||
getMacros(hostids: any[]): any;
|
getHistory: (items, timeFrom, timeTill) => Promise<any>;
|
||||||
getVersion(): string;
|
getTrend: (items, timeFrom, timeTill) => Promise<any>;
|
||||||
login(): any;
|
getItemsByIDs: (itemids) => Promise<any>;
|
||||||
|
getEvents: (objectids, timeFrom, timeTo, showEvents, limit?) => Promise<any>;
|
||||||
|
getAlerts: (itemids, timeFrom?, timeTo?) => Promise<any>;
|
||||||
|
getHostAlerts: (hostids, applicationids, options?) => Promise<any>;
|
||||||
|
getAcknowledges: (eventids) => Promise<any>;
|
||||||
|
getITService: (serviceids?) => Promise<any>;
|
||||||
|
acknowledgeEvent: (eventid, message) => Promise<any>;
|
||||||
|
getProxies: () => Promise<any>;
|
||||||
|
getEventAlerts: (eventids) => Promise<any>;
|
||||||
|
getExtendedEventData: (eventids) => Promise<any>;
|
||||||
|
getMacros: (hostids: any[]) => Promise<any>;
|
||||||
|
getVersion: () => Promise<string>;
|
||||||
|
login: () => Promise<any>;
|
||||||
|
|
||||||
|
getGroups: (groupFilter?) => any;
|
||||||
|
getHosts: (groupFilter?, hostFilter?) => any;
|
||||||
|
getApps: (groupFilter?, hostFilter?, appFilter?) => any;
|
||||||
|
getItems: (groupFilter?, hostFilter?, appFilter?, itemFilter?, options?) => any;
|
||||||
|
getSLA: (itservices, timeRange, target, options?) => any;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const REQUESTS_TO_CACHE = [
|
|||||||
|
|
||||||
const REQUESTS_TO_BIND = [
|
const REQUESTS_TO_BIND = [
|
||||||
'getHistory', 'getTrend', 'getMacros', 'getItemsByIDs', 'getEvents', 'getAlerts', 'getHostAlerts',
|
'getHistory', 'getTrend', 'getMacros', 'getItemsByIDs', 'getEvents', 'getAlerts', 'getHostAlerts',
|
||||||
'getAcknowledges', 'getITService', 'getVersion', 'login', 'acknowledgeEvent', 'getProxies', 'getEventAlerts',
|
'getAcknowledges', 'getITService', 'getSLA', 'getVersion', 'login', 'acknowledgeEvent', 'getProxies', 'getEventAlerts',
|
||||||
'getExtendedEventData'
|
'getExtendedEventData'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -33,9 +33,21 @@ export class Zabbix implements ZabbixConnector {
|
|||||||
dbConnector: any;
|
dbConnector: any;
|
||||||
getTrendsDB: any;
|
getTrendsDB: any;
|
||||||
|
|
||||||
getMacros: any;
|
getHistory: (items, timeFrom, timeTill) => Promise<any>;
|
||||||
getVersion: any;
|
getTrend: (items, timeFrom, timeTill) => Promise<any>;
|
||||||
login: any;
|
getItemsByIDs: (itemids) => Promise<any>;
|
||||||
|
getEvents: (objectids, timeFrom, timeTo, showEvents, limit?) => Promise<any>;
|
||||||
|
getAlerts: (itemids, timeFrom?, timeTo?) => Promise<any>;
|
||||||
|
getHostAlerts: (hostids, applicationids, options?) => Promise<any>;
|
||||||
|
getAcknowledges: (eventids) => Promise<any>;
|
||||||
|
getITService: (serviceids?) => Promise<any>;
|
||||||
|
acknowledgeEvent: (eventid, message) => Promise<any>;
|
||||||
|
getProxies: () => Promise<any>;
|
||||||
|
getEventAlerts: (eventids) => Promise<any>;
|
||||||
|
getExtendedEventData: (eventids) => Promise<any>;
|
||||||
|
getMacros: (hostids: any[]) => Promise<any>;
|
||||||
|
getVersion: () => Promise<string>;
|
||||||
|
login: () => Promise<any>;
|
||||||
|
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
const {
|
const {
|
||||||
@@ -277,7 +289,7 @@ export class Zabbix implements ZabbixConnector {
|
|||||||
/**
|
/**
|
||||||
* Build query - convert target filters to array of Zabbix items
|
* Build query - convert target filters to array of Zabbix items
|
||||||
*/
|
*/
|
||||||
getTriggers(groupFilter, hostFilter, appFilter, options, proxyFilter) {
|
getTriggers(groupFilter, hostFilter, appFilter, options?, proxyFilter?) {
|
||||||
const promises = [
|
const promises = [
|
||||||
this.getGroups(groupFilter),
|
this.getGroups(groupFilter),
|
||||||
this.getHosts(groupFilter, hostFilter),
|
this.getHosts(groupFilter, hostFilter),
|
||||||
|
|||||||
Reference in New Issue
Block a user