All URIs are relative to https://api.opsgenie.com
Method | HTTP request | Description |
---|---|---|
export_on_call_user | GET /v2/schedules/on-calls/{identifier}.ics | Export On-Call User |
get_next_on_calls | GET /v2/schedules/{identifier}/next-on-calls | Get Next On Calls |
get_on_calls | GET /v2/schedules/{identifier}/on-calls | Get On Calls |
list_on_calls | GET /v2/schedules/on-calls | List On Calls |
str export_on_call_user(identifier)
Export On-Call User
Exports personal on-call timeline of 3 months to a .ics file
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.WhoIsOnCallApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the user. Should be either 'id' or 'username' of the user
try:
# Export On-Call User
api_response = api_instance.export_on_call_user(identifier)
pprint(api_response)
except ApiException as e:
print("Exception when calling WhoIsOnCallApi->export_on_call_user: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the user. Should be either 'id' or 'username' of the user |
str
- Content-Type: Not defined
- Accept: text/calendar
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetNextOnCallResponse get_next_on_calls(identifier, schedule_identifier_type=schedule_identifier_type, flat=flat, _date=_date)
Get Next On Calls
Gets next on-call participants of a specific schedule
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.WhoIsOnCallApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of schedule which could be id or name
schedule_identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' (optional) (default to id)
flat = true # bool | Retrieves user names of all on call participants if enabled (optional)
_date = '2013-10-20T19:20:30+01:00' # datetime | Starting date of the timeline (optional)
try:
# Get Next On Calls
api_response = api_instance.get_next_on_calls(identifier, schedule_identifier_type=schedule_identifier_type, flat=flat, _date=_date)
pprint(api_response)
except ApiException as e:
print("Exception when calling WhoIsOnCallApi->get_next_on_calls: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of schedule which could be id or name | |
schedule_identifier_type | str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' | [optional] [default to id] |
flat | bool | Retrieves user names of all on call participants if enabled | [optional] |
_date | datetime | Starting date of the timeline | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetOnCallResponse get_on_calls(identifier, schedule_identifier_type=schedule_identifier_type, flat=flat, _date=_date)
Get On Calls
Gets current on-call participants of a specific schedule
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.WhoIsOnCallApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of schedule which could be id or name
schedule_identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' (optional) (default to id)
flat = true # bool | Retrieves user names of all on call participants if enabled (optional)
_date = '2013-10-20T19:20:30+01:00' # datetime | Starting date of the timeline (optional)
try:
# Get On Calls
api_response = api_instance.get_on_calls(identifier, schedule_identifier_type=schedule_identifier_type, flat=flat, _date=_date)
pprint(api_response)
except ApiException as e:
print("Exception when calling WhoIsOnCallApi->get_on_calls: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of schedule which could be id or name | |
schedule_identifier_type | str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' | [optional] [default to id] |
flat | bool | Retrieves user names of all on call participants if enabled | [optional] |
_date | datetime | Starting date of the timeline | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListOnCallsResponse list_on_calls(flat=flat, _date=_date)
List On Calls
Lists current on-call participants of all schedules
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.WhoIsOnCallApi(swagger_client.ApiClient(configuration))
flat = true # bool | Retrieves user names of all on call participants if enabled (optional)
_date = '2013-10-20T19:20:30+01:00' # datetime | Starting date of the timeline (optional)
try:
# List On Calls
api_response = api_instance.list_on_calls(flat=flat, _date=_date)
pprint(api_response)
except ApiException as e:
print("Exception when calling WhoIsOnCallApi->list_on_calls: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
flat | bool | Retrieves user names of all on call participants if enabled | [optional] |
_date | datetime | Starting date of the timeline | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]