Command-line utility for interfacing with OpsDuty.
Project description
opsduty-python
Command-line utility for interfacing with OpsDuty.
Heartbeats
Send periodic heartbeats to OpsDuty using opsduty-python
. The
heartbeat needs to be configured in OpsDuty before check-ins can
be observed. Head over to https://opsduty.io
to configure your heartbeats.
Alternative 1: Decorator
from opsduty_python.heartbeats.heartbeats import (
heartbeat_checkin,
)
@heartbeat_checkin(heartbeat="HBXXXX", environment="prod", enabled=True)
def periodic_job():
pass
Alternative 2: Send heartbeat manually.
from opsduty_python.heartbeats.heartbeats import (
send_heartbeat_checkin,
)
def periodic_job():
try:
pass
except Exception:
print("Job failed.")
else:
send_heartbeat_checkin(heartbeat="HBXXXX", environment="prod")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
opsduty_python-0.2.0.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for opsduty_python-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2110f4b2716809f9983a5474ca5fb289507c58ae48b5229132bd2d8f9d9d03a5 |
|
MD5 | 360b369f0efd04d7348afccc43c5e177 |
|
BLAKE2b-256 | 72b88f2a613ae763f2b9c4452a637133ae45f9ebf92e061bfbca81f42d15a365 |