Python SDK for OpsGenie Web/REST API
Project description
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 <https://www.opsgenie.com/docs/api-and-client-libraries/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 <http://www.opsgenie.com>`__ 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.
- `Alert API <https://www.opsgenie.com/docs/web-api/alert-api>`__
- `Heartbeat
API <https://www.opsgenie.com/docs/web-api/heartbeat-api>`__
- `Integration
API <https://www.opsgenie.com/docs/web-api/integration-api>`__
- `Policy API <https://www.opsgenie.com/docs/web-api/policy-api>`__
Bug Reporting and Feature Requests
----------------------------------
If you like to report a bug, or a feature request; please open an issue.
===================
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 <https://www.opsgenie.com/docs/api-and-client-libraries/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 <http://www.opsgenie.com>`__ 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.
- `Alert API <https://www.opsgenie.com/docs/web-api/alert-api>`__
- `Heartbeat
API <https://www.opsgenie.com/docs/web-api/heartbeat-api>`__
- `Integration
API <https://www.opsgenie.com/docs/web-api/integration-api>`__
- `Policy API <https://www.opsgenie.com/docs/web-api/policy-api>`__
Bug Reporting and Feature Requests
----------------------------------
If you like to report a bug, or a feature request; please open an issue.
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
opsgenie-sdk-0.2.1.tar.gz
(13.7 kB
view details)
File details
Details for the file opsgenie-sdk-0.2.1.tar.gz
.
File metadata
- Download URL: opsgenie-sdk-0.2.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0026f62945e75a2ddb78351d5f64c4adbcaaa23d2eb2d20802cbd9d8af89f2b5 |
|
MD5 | a1fd7db63dddc35f9e74a8568bbf3705 |
|
BLAKE2b-256 | ec28a8436fe4a8cb7cf3dd914a0561118e741ae5d20b5da888eb27078ae605c6 |