Skip to main content

Thin wrappers around various notification systems

Project description

hns_notification

Thin wrapper around various notification systems.

Notifications available

  1. Opsgenie

Installation

pip install hns-notification

Opsgenie usage

Below code snippet shows how to create alert on opsgenie.

# Import Opsgenie Class
from hns_notification.opsgenie import Opsgenie
# Your API key
api_key = 'api_key'

# Instantiate Opsgenie class
ops_genie = Opsgenie(api_key)

# Create the alert, pass the alert message body. 
# This always add a `_alert_timestamp` field to the details options in alert body
# Check https://docs.opsgenie.com/docs/python-sdk-alert#section-create-alert for details on accepted alert body fields.  
ops_genie.create_alert({
    'message': 'sample_msg',
    'alias': 'some-alias',
    'responders': [{
                'name': 'SampleTeam',
                'type': 'team'
              }],
    'visible_to': [
      {'name': 'Sample',
       'type': 'team'}],
    'actions': ['Restart', 'AnExampleAction'],
    'tags': ['OverwriteQuietHours'],
    'details': {'key1': 'value1',
             'key2': 'value2'},
    'entity': 'An example entity',
    'priority': 'P3',
    'description': 'Sample of SDK v2'
})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hns-notification, version 20.3
Filename, size File type Python version Upload date Hashes
Filename, size hns_notification-20.3-py3-none-any.whl (3.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size hns-notification-20.3.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page