Problems: improve ack dialog (add ack options), closes #942

This commit is contained in:
Alexander Zobnin
2020-05-18 19:41:33 +03:00
parent dfac36a5bb
commit 959cea2061
14 changed files with 295 additions and 204 deletions

View File

@@ -133,14 +133,21 @@ export class ZabbixAPIConnector {
// Zabbix API method wrappers //
////////////////////////////////
acknowledgeEvent(eventid, message) {
const action = semver.gte(this.version, '4.0.0') ? ZBX_ACK_ACTION_ACK + ZBX_ACK_ACTION_ADD_MESSAGE : ZBX_ACK_ACTION_NONE;
const params = {
acknowledgeEvent(eventid: string, message: string, action?: number, severity?: number) {
if (!action) {
action = semver.gte(this.version, '4.0.0') ? ZBX_ACK_ACTION_ADD_MESSAGE : ZBX_ACK_ACTION_NONE;
}
const params: any = {
eventids: eventid,
message: message,
action: action
};
if (severity) {
params.severity = severity;
}
return this.request('event.acknowledge', params);
}