Skip to content

Latest commit

 

History

History
242 lines (174 loc) · 8.82 KB

WhoIsOnCallApi.md

File metadata and controls

242 lines (174 loc) · 8.82 KB

swagger_client.WhoIsOnCallApi

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

export_on_call_user

str export_on_call_user(identifier)

Export On-Call User

Exports personal on-call timeline of 3 months to a .ics file

Example

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)

Parameters

Name Type Description Notes
identifier str Identifier of the user. Should be either 'id' or 'username' of the user

Return type

str

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/calendar

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_next_on_calls

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

Example

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)

Parameters

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]

Return type

GetNextOnCallResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_on_calls

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

Example

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)

Parameters

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]

Return type

GetOnCallResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_on_calls

ListOnCallsResponse list_on_calls(flat=flat, _date=_date)

List On Calls

Lists current on-call participants of all schedules

Example

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)

Parameters

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]

Return type

ListOnCallsResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]