Oven logo

Oven

Published

Python SDK for Opsgenie REST API

pip install opsgenie-sdk

Package Downloads

Weekly DownloadsMonthly Downloads

Requires Python

Python SDK for Opsgenie REST API

This Python package is automatically generated by the OpenAPI Generator 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

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

pip install opsgenie-sdk

(you may need to run pip with root permission: sudo pip install opsgenie-sdk)

Then import the package:

import opsgenie_sdk 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import opsgenie_sdk

Getting Started

Please follow the installation procedure and then run the following:

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

ClassMethodHTTP requestDescription
AccountApiget_infoGET /v2/accountGet Account Info
AlertApiacknowledge_alertPOST /v2/alerts/{identifier}/acknowledgeAcknowledge Alert
AlertApiadd_attachmentPOST /v2/alerts/{identifier}/attachmentsAdd Alert Attachment
AlertApiadd_detailsPOST /v2/alerts/{identifier}/detailsAdd Details
AlertApiadd_notePOST /v2/alerts/{identifier}/notesAdd Note
AlertApiadd_responderPOST /v2/alerts/{identifier}/respondersAdd Responder
AlertApiadd_tagsPOST /v2/alerts/{identifier}/tagsAdd Tags
AlertApiadd_teamPOST /v2/alerts/{identifier}/teamsAdd Team
AlertApiassign_alertPOST /v2/alerts/{identifier}/assignAssign Alert
AlertApiclose_alertPOST /v2/alerts/{identifier}/closeClose Alert
AlertApicount_alertsGET /v2/alerts/countCount Alerts
AlertApicreate_alertPOST /v2/alertsCreate Alert
AlertApicreate_saved_searchesPOST /v2/alerts/saved-searchesCreate Saved Search
AlertApidelete_alertDELETE /v2/alerts/{identifier}Delete Alert
AlertApidelete_saved_searchDELETE /v2/alerts/saved-searches/{identifier}Delete Saved Search
AlertApiescalate_alertPOST /v2/alerts/{identifier}/escalateEscalate Alert
AlertApiexecute_custom_alert_actionPOST /v2/alerts/{identifier}/actions/{actionName}Custom Alert Action
AlertApiget_alertGET /v2/alerts/{identifier}Get Alert
AlertApiget_attachmentGET /v2/alerts/{identifier}/attachments/{attachmentId}Get Alert Attachment
AlertApiget_request_statusGET /v2/alerts/requests/{requestId}Get Request Status of Alert
AlertApiget_saved_searchGET /v2/alerts/saved-searches/{identifier}Get Saved Search
AlertApilist_alertsGET /v2/alertsList Alerts
AlertApilist_attachmentsGET /v2/alerts/{identifier}/attachmentsList Alert Attachments
AlertApilist_logsGET /v2/alerts/{identifier}/logsList Alert Logs
AlertApilist_notesGET /v2/alerts/{identifier}/notesList Alert Notes
AlertApilist_recipientsGET /v2/alerts/{identifier}/recipientsList Alert Recipients
AlertApilist_saved_searchesGET /v2/alerts/saved-searchesLists Saved Searches
AlertApiremove_attachmentDELETE /v2/alerts/{identifier}/attachments/{attachmentId}Remove Alert Attachment
AlertApiremove_detailsDELETE /v2/alerts/{identifier}/detailsRemove Details
AlertApiremove_tagsDELETE /v2/alerts/{identifier}/tagsRemove Tags
AlertApisnooze_alertPOST /v2/alerts/{identifier}/snoozeSnooze Alert
AlertApiun_acknowledge_alertPOST /v2/alerts/{identifier}/unacknowledgeUnAcknowledge Alert
AlertApiupdate_alert_descriptionPUT /v2/alerts/{identifier}/descriptionUpdate Alert Description
AlertApiupdate_alert_messagePUT /v2/alerts/{identifier}/messageUpdate Alert Message
AlertApiupdate_alert_priorityPUT /v2/alerts/{identifier}/priorityUpdate Alert Priority
AlertApiupdate_saved_searchPATCH /v2/alerts/saved-searches/{identifier}Update Saved Search
HeartbeatApicreate_heartbeatPOST /v2/heartbeatsCreate Heartbeat
HeartbeatApidelete_heartbeatDELETE /v2/heartbeats/{name}Delete Heartbeat
HeartbeatApidisable_heartbeatPOST /v2/heartbeats/{name}/disableDisable Heartbeat
HeartbeatApienable_heartbeatPOST /v2/heartbeats/{name}/enableEnable Heartbeat
HeartbeatApiget_heartbeatGET /v2/heartbeats/{name}Get Heartbeat
HeartbeatApilist_heart_beatsGET /v2/heartbeatsList Heartbeats
HeartbeatApipingGET /v2/heartbeats/{name}/pingPing Heartbeat
HeartbeatApiupdate_heartbeatPATCH /v2/heartbeats/{name}Update Heartbeat (Partial)
IncidentApiclose_incidentPOST /v1/incidents/{identifier}/closeClose Incident
IncidentApicreate_incidentPOST /v1/incidents/createCreate Incident
IncidentApidelete_incidentDELETE /v1/incidents/{identifier}Delete Incident
IncidentApiget_incidentGET /v1/incidents/{identifier}Get Incident
IncidentApiget_incident_request_statusGET /v1/incidents/requests/{requestId}Get Request Status of Incident
IncidentApilist_incidentsGET /v1/incidents/List incidents

Documentation For Models

Documentation For Authorization

GenieKey

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

[email protected]