ilert-rust   ![Latest Version] ![ilert: rustc 1.13+]

The official iLert api bindings.

In action

```rust use ilert::ilert::ILert; use ilert::ilert_builders::{UserApiResource, EventApiResource, ILertEventType};

let mut client = ILert::new().unwrap(); client.authviatoken("your-api-token").unwrap();

// create a new alert

client .post() .event( "44c7afdc-0b3e-4344-b48a-5378a963231f", ILertEventType::ALERT, "Host srv/mail01 is CRITICAL", None) .execute();

// fetch users

let user_result = client .get() .users() .execute() .unwrap();

// ping a heartbeat

client .get() .heartbeat("43c7afdc-0b3e-4344-b48a-5379a963241f") .execute();

// create detailed alert

client .post() .eventwithdetails( "8972f0d5d8c9cde78d79b6cc8fd", ILertEventType::ALERT, Some("Host srv/mail01 is CRITICAL".tostring()), Some("bratwurst".tostring()), Some("some detail message".to_string()), Some(ILertPriority::LOW), Some(vec![EventImage::new("https://i.giphy.com/media/VRhsYYBw8AE36/giphy.webp")]), Some(vec![]), Some(json!({"hehe": "test"})), None) .execute() .unwrap();

// add comment to alert

client .post() .eventwithcomment( "8972f0d5d8c9cde78d79b6cc8fd", Some("bratwurst".to_string()), Some(vec![EventComment::new("Peter Parker", "a comment alt text picture")])) .execute() .unwrap();

// resolve alert

client .post() .event("8972f0d5d8c9cde78d79b6cc8fd", ILertEventType::RESOLVE, None, Some("bratwurst".to_string())) .execute() .unwrap(); ```

Getting help

We are happy to respond to GitHub issues as well.


License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in ilert-rust by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.