Giter Club home page Giter Club logo

opsgenie-python-sdk's Introduction

OpsGenie Python SDK - [BETA]

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.

opsgenie-python-sdk's People

Contributors

kaanbasal avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.