Skip to main content

Python SDK for OpsGenie Web/REST API

Project description

Aim and Scope

OpsGenie Python SDK aims to access OpsGenie Web API through HTTP calls from a client application in Python language.

OpsGenie Python SDK covers:

  • Alert API

  • Heartbeat API (TODO: will be available soon)

  • Integration API (TODO: will be available soon)

  • Policy API (TODO: will be available soon)

Future releases are subject to be delivered for packing more APIs soon.

For more information about OpsGenie Python SDK, please refer to OpsGenie Python API document.

Pre-requisites

  • The API is built for Python 2.7 but can also be used with other Python versions.

  • Before you begin, you need to sign up OpsGenie if you don’t have a valid account yet. Create an API Integration and get your API key.

Installation

To download all packages in the repo with their dependencies, simply execute

pip install opsgenie-sdk

Getting Started

One can start using OpsGenie Python SDK by initializing client and making a request. Example shown below demonstrates how to initialize an OpsGenie client and make a create alert request.

from opsgenie import OpsGenie
from opsgenie.alert.requests import CreateAlertRequest
from opsgenie.config import Configuration
from opsgenie.errors import OpsGenieError

config = Configuration("YOUR_API_KEY")

client = OpsGenie(config)

try:
    response = client.alert.create_alert(CreateAlertRequest(message="Hello from OpsGenie Python SDK"))
    print 'message: {}'.format(response.message)
    print 'alert id: {}'.format(response.alert_id)
    print 'status: {}'.format(response.status)
    print 'code: {}'.format(response.code)
except OpsGenieError as err:
    print err.message

There are useful sample code snippets under samples directory for packages.

The Web API

Please follow the links below for more information and details about the Web API.

Bug Reporting and Feature Requests

If you like to report a bug, or a feature request; please open an issue.

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

opsgenie-sdk-0.1.3.tar.gz (13.3 kB view details)

Uploaded Source

File details

Details for the file opsgenie-sdk-0.1.3.tar.gz.

File metadata

File hashes

Hashes for opsgenie-sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bbf29d67221cfd54b1e486b04d467ccb37e1e5b6bcf23a69541c071ceaf3b710
MD5 c97c2313b07960679b07336e0e2d90d8
BLAKE2b-256 6c1edf0e00c482aa5b4f80e183f4ec65e4a8086cc01b54b3e8ec770235c5fd59

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page