#alert #client #api #api-bindings #light #integration #status

opsgenie

Simple client library for creating and closing alerts on opsgenie

1 unstable release

0.0.1 Jan 20, 2020

#25 in #alert

Download history 2/week @ 2023-12-28 15/week @ 2024-01-04 11/week @ 2024-01-11 19/week @ 2024-02-15 27/week @ 2024-02-22 13/week @ 2024-02-29 44/week @ 2024-03-07 111/week @ 2024-03-14 115/week @ 2024-03-21

290 downloads per month

MIT license

11KB
181 lines

opsgenie_rust

Light alerting client library for opsgenie This libaray in WIP status so be aware that API can be rewritten. I have created this API because swagger-cli is not able to genereate rust lib that is compiling and it was faster for me implement needed functionality(Alert creating) on my own.

How to use it?

extern crate opsgenie_rust;
use opsgenie_rust::*;
use std::thread;

fn main() {
    let alert_data = AlertData::new("Some message".to_string())
        .alias("with alias".to_string())
        .tags(vec!["certyficates".to_string(), "expiring".to_string()])
        .entity("www.domain.com".to_string())
        .source("alert-sourtce".to_string())
        .priority(opsgenie_rust::Priority::P4);
    
    let opsgenie = OpsGenie::new("XXXXX-XXXXX-XXXXX-XXXXXX-XXXXX".to_string());

    let mut alert_ops = opsgenie.alert(alert_data).unwrap();

    thread::sleep_ms(10000);

    alert_ops.close().unwrap();
}

TODO:

  • Finish implementing alert API
  • Adding heatbeat API support
  • we will see

Dependencies

~20MB
~434K SLoC