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, body=body)
Close Incident
Closes incident with given identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.IncidentApi(swagger_client.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)
body = swagger_client.CloseIncidentPayload() # CloseIncidentPayload | Request payload of closing incident action (optional)
try:
# Close Incident
api_response = api_instance.close_incident(identifier, identifier_type=identifier_type, body=body)
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] |
body | 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(body)
Create Incident
Creates a new incident
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.IncidentApi(swagger_client.ApiClient(configuration))
body = swagger_client.CreateIncidentPayload() # CreateIncidentPayload | Request payload of created incident
try:
# Create Incident
api_response = api_instance.create_incident(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling IncidentApi->create_incident: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | 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
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.IncidentApi(swagger_client.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
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.IncidentApi(swagger_client.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
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.IncidentApi(swagger_client.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
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.IncidentApi(swagger_client.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]