Crates.io | watchrs |
lib.rs | watchrs |
version | 0.2.1 |
source | src |
created_at | 2019-04-23 00:33:10.854659 |
updated_at | 2019-04-24 02:27:52.963708 |
description | Crate that aids in monitoring and setting up alerts for AWS Batch Jobs. |
homepage | https://github.com/itsHabib/watchrs |
repository | https://github.com/itsHabib/watchrs.git |
max_upload_size | |
id | 129572 |
size | 37,731 |
watchrs
is a crate that aids in monitoring and setting up alerts for AWS Batch Jobs.
Note: This is still under development and I would not consider it to be production ready yet.
use watchrs::Watcher;
// First create and subscribe to a topic
let watcher = Watcher::default();
watcher
.subscribe("youremail@example.com".to_owned(), None)
.and_then(|(topic_arn, _)| {
watcher
.create_job_watcher_rule(
"my_batch_job_rule".to_owned(),
// enable?
true,
Some("watch failed jobs".to_owned()),
Some(vec!["FAILED".to_owned(), "RUNNABLE".to_owned()]),
Some(vec!["JOB_QUEUE_ARN".to_owned()]),
Some(vec!["JOB_DEFINITION_NAME".to_owned()])
)
.map(|rule_name| (topic_arn, rule_name))
})
.and_then(|(topic_arn, rule_name)| {
// create target
watcher.create_sns_target(rule_name, topic_arn)
})
.expect("failed to create alerting system");
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.