Crates.io | opsgenie |
lib.rs | opsgenie |
version | 0.0.1 |
source | src |
created_at | 2020-01-20 20:58:44.047149 |
updated_at | 2020-01-20 20:58:44.047149 |
description | Simple client library for creating and closing alerts on opsgenie |
homepage | https://github.com/wojtekw92/opsgenie_rust/blob/master/README.md |
repository | https://github.com/wojtekw92/opsgenie_rust |
max_upload_size | |
id | 200557 |
size | 10,804 |
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.
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();
}