icinga2_api/types/
event_stream.rs

1//! Definition for the various Event Stream Types
2//!
3//! [Official Documentation](https://icinga.com/docs/icinga-2/latest/doc/12-icinga2-api/#event-streams)
4
5use serde::{Deserialize, Serialize};
6
7pub mod acknowledgement_cleared;
8pub mod acknowledgement_set;
9pub mod check_result;
10pub mod comment_added;
11pub mod comment_removed;
12pub mod downtime_added;
13pub mod downtime_removed;
14pub mod downtime_started;
15pub mod downtime_triggered;
16pub mod flapping;
17pub mod notification;
18pub mod object_created;
19pub mod object_deleted;
20pub mod object_modified;
21pub mod state_change;
22
23/// the enum used to deserialize events from an event stream
24#[derive(Debug, Clone, Serialize, Deserialize)]
25#[serde(tag = "type")]
26pub enum IcingaEvent {
27    /// a new check result
28    CheckResult(check_result::IcingaEventCheckResult),
29    /// a host or service state changed
30    StateChange(state_change::IcingaEventStateChange),
31    /// a notification was sent
32    Notification(notification::IcingaEventNotification),
33    /// a problem was acknowledged
34    AcknowledgementSet(acknowledgement_set::IcingaEventAcknowledgementSet),
35    /// an acknowledgement was removed
36    AcknowledgementCleared(acknowledgement_cleared::IcingaEventAcknowledgementCleared),
37    /// a comment was added
38    CommentAdded(comment_added::IcingaEventCommentAdded),
39    /// a comment was removed
40    CommentRemove(comment_removed::IcingaEventCommentRemoved),
41    /// a downtime was added
42    DowntimeAdded(downtime_added::IcingaEventDowntimeAdded),
43    /// a downtime was removed
44    DowntimeRemoved(downtime_removed::IcingaEventDowntimeRemoved),
45    /// a downtime started
46    DowntimeStarted(downtime_started::IcingaEventDowntimeStarted),
47    /// a downtime was triggered by another downtime
48    DowntimeTriggered(downtime_triggered::IcingaEventDowntimeTriggered),
49    /// an object was created
50    ObjectCreated(object_created::IcingaEventObjectCreated),
51    /// an object was deleted
52    ObjectDeleted(object_deleted::IcingaEventObjectDeleted),
53    /// an object was modified
54    ObjectModified(object_modified::IcingaEventObjectModified),
55    /// flapping status changed
56    Flapping(flapping::IcingaEventFlapping),
57}