Description
# Python SDK for Opsgenie REST API This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 2.0.0 - Package version: 2.1.5 - Build package: com.atlassian.opsgenie.codegen.geniepy.GeniepyGenerator For more information, please visit [https://www.opsgenie.com/contact-us](https://www.opsgenie.com/contact-us) ## Requirements. Python 2.7 and 3.4+ ## Installation & Usage ### pip install If the python package is hosted on Github, you can install directly from Github ```sh pip install opsgenie-sdk ``` (you may need to run `pip` with root permission: `sudo pip install opsgenie-sdk`) Then import the package: ```python import opsgenie_sdk ``` ### Setuptools Install via [Setuptools](http://pypi.python.org/pypi/setuptools). ```sh python setup.py install --user ``` (or `sudo python setup.py install` to install the package for all users) Then import the package: ```python import opsgenie_sdk ``` ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: ```python from __future__ import print_function import time import opsgenie_sdk from opsgenie_sdk.rest import ApiException from pprint import pprint configuration = opsgenie_sdk.Configuration() # Configure API key authorization: GenieKey configuration.api_key['Authorization'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = opsgenie_sdk.AccountApi(opsgenie_sdk.ApiClient(configuration)) try: # Get Account Info api_response = api_instance.get_info() pprint(api_response) except ApiException as e: print("Exception when calling AccountApi->get_info: %s\n" % e) ``` Note: if you have an european account please set attribute 'host' ``` configuration.host = 'https://api.eu.opsgenie.com' ``` ## Documentation for API Endpoints All URIs are relative to *https://api.opsgenie.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AccountApi* | [**get_info**](docs/AccountApi.md#get_info) | **GET** /v2/account | Get Account Info *AlertApi* | [**acknowledge_alert**](docs/AlertApi.md#acknowledge_alert) | **POST** /v2/alerts/{identifier}/acknowledge | Acknowledge Alert *AlertApi* | [**add_attachment**](docs/AlertApi.md#add_attachment) | **POST** /v2/alerts/{identifier}/attachments | Add Alert Attachment *AlertApi* | [**add_details**](docs/AlertApi.md#add_details) | **POST** /v2/alerts/{identifier}/details | Add Details *AlertApi* | [**add_note**](docs/AlertApi.md#add_note) | **POST** /v2/alerts/{identifier}/notes | Add Note *AlertApi* | [**add_responder**](docs/AlertApi.md#add_responder) | **POST** /v2/alerts/{identifier}/responders | Add Responder *AlertApi* | [**add_tags**](docs/AlertApi.md#add_tags) | **POST** /v2/alerts/{identifier}/tags | Add Tags *AlertApi* | [**add_team**](docs/AlertApi.md#add_team) | **POST** /v2/alerts/{identifier}/teams | Add Team *AlertApi* | [**assign_alert**](docs/AlertApi.md#assign_alert) | **POST** /v2/alerts/{identifier}/assign | Assign Alert *AlertApi* | [**close_alert**](docs/AlertApi.md#close_alert) | **POST** /v2/alerts/{identifier}/close | Close Alert *AlertApi* | [**count_alerts**](docs/AlertApi.md#count_alerts) | **GET** /v2/alerts/count | Count Alerts *AlertApi* | [**create_alert**](docs/AlertApi.md#create_alert) | **POST** /v2/alerts | Create Alert *AlertApi* | [**create_saved_searches**](docs/AlertApi.md#create_saved_searches) | **POST** /v2/alerts/saved-searches | Create Saved Search *AlertApi* | [**delete_alert**](docs/AlertApi.md#delete_alert) | **DELETE** /v2/alerts/{identifier} | Delete Alert *AlertApi* | [**delete_saved_search**](docs/AlertApi.md#delete_saved_search) | **DELETE** /v2/alerts/saved-searches/{identifier} | Delete Saved Search *AlertApi* | [**escalate_alert**](docs/AlertApi.md#escalate_alert) | **POST** /v2/alerts/{identifier}/escalate | Escalate Alert *AlertApi* | [**execute_custom_alert_action**](docs/AlertApi.md#execute_custom_alert_action) | **POST** /v2/alerts/{identifier}/actions/{actionName} | Custom Alert Action *AlertApi* | [**get_alert**](docs/AlertApi.md#get_alert) | **GET** /v2/alerts/{identifier} | Get Alert *AlertApi* | [**get_attachment**](docs/AlertApi.md#get_attachment) | **GET** /v2/alerts/{identifier}/attachments/{attachmentId} | Get Alert Attachment *AlertApi* | [**get_request_status**](docs/AlertApi.md#get_request_status) | **GET** /v2/alerts/requests/{requestId} | Get Request Status of Alert *AlertApi* | [**get_saved_search**](docs/AlertApi.md#get_saved_search) | **GET** /v2/alerts/saved-searches/{identifier} | Get Saved Search *AlertApi* | [**list_alerts**](docs/AlertApi.md#list_alerts) | **GET** /v2/alerts | List Alerts *AlertApi* | [**list_attachments**](docs/AlertApi.md#list_attachments) | **GET** /v2/alerts/{identifier}/attachments | List Alert Attachments *AlertApi* | [**list_logs**](docs/AlertApi.md#list_logs) | **GET** /v2/alerts/{identifier}/logs | List Alert Lo
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 2.1.5 | Imported from PyPI (2.1.5) | Low | 4/21/2026 |
| v2.1.5 | Fix a vulnerability issue that effects urllib3 library: urllib3 (below 1.26.5) is vulnerable to Denial Of Service (DoS) | Low | 8/2/2021 |
| v2.1.4 | fixes https://github.com/opsgenie/opsgenie-python-sdk/issues/50 | Low | 4/30/2021 |
| v2.1.3 | Releases: 1. https://github.com/opsgenie/opsgenie-python-sdk/pull/53 2. https://github.com/opsgenie/opsgenie-python-sdk/pull/51 | Low | 3/10/2021 |
| v2.1.2 | fixes: https://github.com/opsgenie/opsgenie-python-sdk/issues/45 | Low | 2/3/2021 |
| v2.1.1 | removed numpy dependency | Low | 1/28/2021 |
| v2.1.0 | updated urllib3 version to 1.26.2 | Low | 11/27/2020 |
| v2.0.3 | **Closed Issues:** * #25 European accounts * #18 ModuleNotFound * #24 Inconsistency in sort field values for Incident API and Alert API * #34 cannot list alert * #32 teamId needs to be ownerTeam in Incident * #33 details should be extraProperties in Incident * #21 Problems using Configurable Retry Policy | Low | 1/24/2020 |
| v2.0.2 | **Changes:** * #20 Fix responder conversion for both Alert and Incident responses. | Low | 11/6/2019 |
| v2.0.1 | A brand new implementation of the SDK with more domains and smarter capabilities, of whose detailed documentation can be found at https://docs.opsgenie.com/docs/opsgenie-python-api-v2-1 SDK Core Capabilities: - Metrics Publishing Support - Short API Polling Support - Configurable Logging Support - Configurable Proxy Support - Configurable Retry Policy Support Supported Opsgenie Domains: - Alert - Heartbeat - Incident - Account | Low | 9/10/2019 |
| v0.3.1 | This version will be the latest release that supports old Opsgenie Python SDK implementation. From now on (starting from v2.0.0), we introduce a modified version of the OpenAPI Generator. | Low | 6/18/2019 |
