All URIs are relative to https://api.opsgenie.com
Method | HTTP request | Description |
---|---|---|
close_incident | POST /v1/incidents/{identifier}/close | Close Incident |
create_incident | POST /v1/incidents/create | Create Incident |
delete_incident | DELETE /v1/incidents/{identifier} | Delete Incident |
get_incident | GET /v1/incidents/{identifier} | Get Incident |
get_incident_request_status | GET /v1/incidents/requests/{requestId} | Get Request Status of Incident |
list_incidents | GET /v1/incidents/ | List incidents |
SuccessResponse close_incident(identifier, identifier_type=identifier_type, close_incident_payload=close_incident_payload)
Close Incident
Closes incident with given identifier
- Api Key Authentication (GenieKey):
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.IncidentApi(opsgenie_sdk.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of incident which could be incident id or tiny id
identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'tiny. Default is id' (optional) (default to 'id')
close_incident_payload = opsgenie_sdk.CloseIncidentPayload() # CloseIncidentPayload | Request payload of closing incident action (optional)
try:
# Close Incident
api_response = api_instance.close_incident(identifier, identifier_type=identifier_type, close_incident_payload=close_incident_payload)
pprint(api_response)
except ApiException as e:
print("Exception when calling IncidentApi->close_incident: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of incident which could be incident id or tiny id | |
identifier_type | str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'tiny. Default is id' | [optional] [default to 'id'] |
close_incident_payload | CloseIncidentPayload | Request payload of closing incident action | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuccessResponse create_incident(create_incident_payload)
Create Incident
Creates a new incident
- Api Key Authentication (GenieKey):
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.IncidentApi(opsgenie_sdk.ApiClient(configuration))
create_incident_payload = opsgenie_sdk.CreateIncidentPayload() # CreateIncidentPayload | Request payload of created incident
try:
# Create Incident
api_response = api_instance.create_incident(create_incident_payload)
pprint(api_response)
except ApiException as e:
print("Exception when calling IncidentApi->create_incident: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
create_incident_payload | CreateIncidentPayload | Request payload of created incident |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuccessResponse delete_incident(identifier, identifier_type=identifier_type)
Delete Incident
Deletes an incident using incident id or the tiny id
- Api Key Authentication (GenieKey):
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.IncidentApi(opsgenie_sdk.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of incident which could be incident id or tiny id
identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'tiny. Default is id' (optional) (default to 'id')
try:
# Delete Incident
api_response = api_instance.delete_incident(identifier, identifier_type=identifier_type)
pprint(api_response)
except ApiException as e:
print("Exception when calling IncidentApi->delete_incident: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of incident which could be incident id or tiny id | |
identifier_type | str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'tiny. Default is id' | [optional] [default to 'id'] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIncidentResponse get_incident(identifier, identifier_type=identifier_type)
Get Incident
Returns incident with given id, tiny id or alias
- Api Key Authentication (GenieKey):
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.IncidentApi(opsgenie_sdk.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of incident which could be incident id or tiny id
identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'tiny. Default is id' (optional) (default to 'id')
try:
# Get Incident
api_response = api_instance.get_incident(identifier, identifier_type=identifier_type)
pprint(api_response)
except ApiException as e:
print("Exception when calling IncidentApi->get_incident: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of incident which could be incident id or tiny id | |
identifier_type | str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'tiny. Default is id' | [optional] [default to 'id'] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetIncidentRequestStatusResponse get_incident_request_status(request_id)
Get Request Status of Incident
Used to track the status and incident details (if any) of the request whose identifier is given
- Api Key Authentication (GenieKey):
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.IncidentApi(opsgenie_sdk.ApiClient(configuration))
request_id = 'request_id_example' # str | Universally unique identifier of the questioned request
try:
# Get Request Status of Incident
api_response = api_instance.get_incident_request_status(request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling IncidentApi->get_incident_request_status: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
request_id | str | Universally unique identifier of the questioned request |
GetIncidentRequestStatusResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListIncidentsResponse list_incidents(query, offset=offset, limit=limit, sort=sort, order=order)
List incidents
Return list of incidents
- Api Key Authentication (GenieKey):
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.IncidentApi(opsgenie_sdk.ApiClient(configuration))
query = 'query_example' # str | Search query to apply while filtering the incidents.
offset = 56 # int | Start index of the result set (to apply pagination). Minimum value (and also default value) is 0. (optional)
limit = 56 # int | Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 (optional)
sort = 'createdAt' # str | Name of the field that result set will be sorted by (optional) (default to 'createdAt')
order = 'desc' # str | Sorting order of the result set (optional) (default to 'desc')
try:
# List incidents
api_response = api_instance.list_incidents(query, offset=offset, limit=limit, sort=sort, order=order)
pprint(api_response)
except ApiException as e:
print("Exception when calling IncidentApi->list_incidents: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
query | str | Search query to apply while filtering the incidents. | |
offset | int | Start index of the result set (to apply pagination). Minimum value (and also default value) is 0. | [optional] |
limit | int | Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 | [optional] |
sort | str | Name of the field that result set will be sorted by | [optional] [default to 'createdAt'] |
order | str | Sorting order of the result set | [optional] [default to 'desc'] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]