ilert-rust

The official iLert api bindings.
In action
use ilert::ilert::ILert;
use ilert::ilert_builders::{UserApiResource, EventApiResource, ILertEventType};
let mut client = ILert::new().unwrap();
client.auth_via_token("your-api-token").unwrap();
client
.post()
.event(
"44c7afdc-0b3e-4344-b48a-5378a963231f",
ILertEventType::ALERT,
"Host srv/mail01 is CRITICAL", None)
.execute();
let user_result = client
.get()
.users()
.execute()
.unwrap();
client
.get()
.heartbeat("43c7afdc-0b3e-4344-b48a-5379a963241f")
.execute();
client
.post()
.event_with_details(
"8972f0d5d8c9cde78d79b6cc8fd",
ILertEventType::ALERT,
Some("Host srv/mail01 is CRITICAL".to_string()),
Some("bratwurst".to_string()),
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();
client
.post()
.event_with_comment(
"8972f0d5d8c9cde78d79b6cc8fd",
Some("bratwurst".to_string()),
Some(vec")]))
.execute()
.unwrap();
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