A Python client for Cronus alerts
Project description
cronus-alert
The easiest way to get push notifications for events that you define
This repo contains the cronus-alert package in
- Javascript
- Go
- Python
All packages require an API key from cronusmonitoring.com
Javascript
1. Install
npm i cronus-alert
2. Example usage
function main() {
// Set API Key to an environment variable
const cronusAlert = new CronusAlert(process.env.CRONUS_API_TOKEN);
cronusAlert
.FireAlert(
"The system is down", // Summary
"Someone forgot to lock the gate", // Description
Status.Firing // Optional status
)
.then((resp) => {
console.log(resp.data); // API response
})
.catch((err) => {
console.error(err); // network error
});
}
main();
Go
1. Install
go get github.com/mperkins808/cronus-alert/go/pkg/cronusalert
2. Example usage
func main() {
client := cronusalert.NewCronusAlertClient(os.Getenv("CRONUS_API_KEY"))
alert := cronusalert.Alert{
Summary: "Issue detected in server",
Description: "Failing to read database transactions",
Status: cronusalert.FIRING,
}
err := client.Fire(alert)
if err != nil {
// handle error
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cronusalert-0.1.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for cronusalert-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 631bb53602222ff759419a0bd1f8571af2d6f079712e141b16c7360bc675132a |
|
MD5 | a82688ff38d8c4e133440a1e1b29c4b9 |
|
BLAKE2b-256 | 64afed3ffa141033fe7915be62a8e32610666bab26a10c12da5fb02bf10050ce |