oncalls
Creates, updates, deletes, gets or lists an oncalls
resource.
Overview
Name | oncalls |
Type | Resource |
Id | pagerduty.on_calls.oncalls |
Fields
The following fields are returned by SELECT
queries:
- list_on_calls
A paginated array of on-call objects.
Name | Datatype | Description |
---|---|---|
end | string (date-time) | The end of the on-call. If null , the user does not go off-call. |
escalation_level | integer | The escalation level for the on-call. |
escalation_policy | object | |
schedule | object | |
start | string (date-time) | The start of the on-call. If null , the on-call is a permanent user on-call. |
user | object |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_on_calls | select | Accept , Content-Type , time_zone , limit , offset , total , include[] , user_ids[] , escalation_policy_ids[] , schedule_ids[] , since , until , earliest | List the on-call entries during a given time range. An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules. For more information see the API Concepts Document Scoped OAuth requires: oncalls.read | |
_list_on_calls | exec | Accept , Content-Type , time_zone , limit , offset , total , include[] , user_ids[] , escalation_policy_ids[] , schedule_ids[] , since , until , earliest | List the on-call entries during a given time range. An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules. For more information see the API Concepts Document Scoped OAuth requires: oncalls.read |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
Accept | string | The Accept header is used as a versioning header. |
Content-Type | string | |
earliest | boolean | This will filter on-calls such that only the earliest on-call for each combination of escalation policy, escalation level, and user is returned. This is useful for determining when the "next" on-calls are for a given set of filters. |
escalation_policy_ids[] | array | Filters the results, showing only on-calls for the specified escalation policy IDs. |
include[] | string | Array of additional details to include. |
limit | integer | The number of results per page. |
offset | integer | Offset to start pagination search results. |
schedule_ids[] | array | Filters the results, showing only on-calls for the specified schedule IDs. If null is provided in the array, it includes permanent on-calls due to direct user escalation targets. |
since | string (date-time) | The start of the time range over which you want to search. If an on-call period overlaps with the range, it will be included in the result. Defaults to current time. On-call shifts are limited to 90 days in the future. |
time_zone | string (tzinfo) | Time zone in which dates in the result will be rendered. |
total | boolean | By default the total field in pagination responses is set to null to provide the fastest possible response times. Set total to true for this field to be populated. See our Pagination Docs for more information. |
until | string (date-time) | The end of the time range over which you want to search. If an on-call period overlaps with the range, it will be included in the result. Defaults to current time. On-call shifts are limited to 90 days in the future, and the until time cannot be before the since time. |
user_ids[] | array | Filters the results, showing only on-calls for the specified user IDs. |
SELECT
examples
- list_on_calls
List the on-call entries during a given time range.
An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules.
For more information see the API Concepts Document
Scoped OAuth requires: oncalls.read
SELECT
end,
escalation_level,
escalation_policy,
schedule,
start,
user
FROM pagerduty.on_calls.oncalls
WHERE Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
AND time_zone = '{{ time_zone }}'
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
AND total = '{{ total }}'
AND include[] = '{{ include[] }}'
AND user_ids[] = '{{ user_ids[] }}'
AND escalation_policy_ids[] = '{{ escalation_policy_ids[] }}'
AND schedule_ids[] = '{{ schedule_ids[] }}'
AND since = '{{ since }}'
AND until = '{{ until }}'
AND earliest = '{{ earliest }}'
;
Lifecycle Methods
- _list_on_calls
List the on-call entries during a given time range.
An on-call represents a contiguous unit of time for which a User will be on call for a given Escalation Policy and Escalation Rules.
For more information see the API Concepts Document
Scoped OAuth requires: oncalls.read
EXEC pagerduty.on_calls.oncalls._list_on_calls
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}',
@time_zone='{{ time_zone }}',
@limit='{{ limit }}',
@offset='{{ offset }}',
@total={{ total }},
@include[]='{{ include[] }}',
@user_ids[]='{{ user_ids[] }}',
@escalation_policy_ids[]='{{ escalation_policy_ids[] }}',
@schedule_ids[]='{{ schedule_ids[] }}',
@since='{{ since }}',
@until='{{ until }}',
@earliest={{ earliest }}
;