notification_rules
Creates, updates, deletes, gets or lists a notification_rules
resource.
Overview
Name | notification_rules |
Type | Resource |
Id | pagerduty.users.notification_rules |
Fields
The following fields are returned by SELECT
queries:
- get_user_notification_rule
- get_user_notification_rules
The user's notification rule requested.
Name | Datatype | Description |
---|---|---|
id | string | |
contact_method | object | |
html_url | string (url) | a URL at which the entity is uniquely displayed in the Web app |
self | string (url) | the API show URL at which the object is accessible |
start_delay_in_minutes | integer | The delay before firing the rule, in minutes. |
summary | string | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name , though it is not intended to be an identifier. |
type | string | The type of object being created. (default: assignment_notification_rule) |
urgency | string | Which incident urgency this rule is used for. Account must have the urgencies ability to have a low urgency notification rule. |
A list of notification rules.
Name | Datatype | Description |
---|
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_user_notification_rule | select | id , notification_rule_id | Accept , Content-Type , include[] | Get details about a user's notification rule. Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account. For more information see the API Concepts Document Scoped OAuth requires: users:contact_methods.read |
get_user_notification_rules | select | id | Accept , Content-Type , include[] , urgency | List notification rules of your PagerDuty user. Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account. For more information see the API Concepts Document Scoped OAuth requires: users:contact_methods.read |
create_user_notification_rule | insert | id , data__notification_rule | Accept , Content-Type | Create a new notification rule. Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account. For more information see the API Concepts Document Scoped OAuth requires: users:contact_methods.write |
delete_user_notification_rule | delete | id , notification_rule_id | Accept , Content-Type | Remove a user's notification rule. Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account. For more information see the API Concepts Document Scoped OAuth requires: users:contact_methods.write |
_get_user_notification_rules | exec | id | Accept , Content-Type , include[] , urgency | List notification rules of your PagerDuty user. Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account. For more information see the API Concepts Document Scoped OAuth requires: users:contact_methods.read |
_get_user_notification_rule | exec | id , notification_rule_id | Accept , Content-Type , include[] | Get details about a user's notification rule. Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account. For more information see the API Concepts Document Scoped OAuth requires: users:contact_methods.read |
update_user_notification_rule | exec | id , notification_rule_id , notification_rule | Accept , Content-Type | Update a user's notification rule. Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account. For more information see the API Concepts Document Scoped OAuth requires: users:contact_methods.write |
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 |
---|---|---|
id | string | The ID of the resource. |
notification_rule_id | string | The notification rule ID on the user. |
Accept | string | The Accept header is used as a versioning header. |
Content-Type | string | |
include[] | string | Array of additional details to include. |
urgency | string | The incident urgency for which the notification rules are applied. If not specified, defaults to high . |
SELECT
examples
- get_user_notification_rule
- get_user_notification_rules
Get details about a user's notification rule.
Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.
For more information see the API Concepts Document
Scoped OAuth requires: users:contact_methods.read
SELECT
id,
contact_method,
html_url,
self,
start_delay_in_minutes,
summary,
type,
urgency
FROM pagerduty.users.notification_rules
WHERE id = '{{ id }}' -- required
AND notification_rule_id = '{{ notification_rule_id }}' -- required
AND Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
AND include[] = '{{ include[] }}'
;
List notification rules of your PagerDuty user.
Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.
For more information see the API Concepts Document
Scoped OAuth requires: users:contact_methods.read
SELECT
*
FROM pagerduty.users.notification_rules
WHERE id = '{{ id }}' -- required
AND Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
AND include[] = '{{ include[] }}'
AND urgency = '{{ urgency }}'
;
INSERT
examples
- create_user_notification_rule
- Manifest
Create a new notification rule.
Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.
For more information see the API Concepts Document
Scoped OAuth requires: users:contact_methods.write
INSERT INTO pagerduty.users.notification_rules (
data__notification_rule,
id,
Accept,
Content-Type
)
SELECT
'{{ notification_rule }}' /* required */,
'{{ id }}',
'{{ Accept }}',
'{{ Content-Type }}'
RETURNING
notification_rule
;
# Description fields are for documentation purposes
- name: notification_rules
props:
- name: id
value: string
description: Required parameter for the notification_rules resource.
- name: notification_rule
value: object
description: |
A rule for contacting the user.
- name: Accept
value: string
description: The `Accept` header is used as a versioning header.
- name: Content-Type
value: string
DELETE
examples
- delete_user_notification_rule
Remove a user's notification rule.
Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.
For more information see the API Concepts Document
Scoped OAuth requires: users:contact_methods.write
DELETE FROM pagerduty.users.notification_rules
WHERE id = '{{ id }}' --required
AND notification_rule_id = '{{ notification_rule_id }}' --required
AND Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
;
Lifecycle Methods
- _get_user_notification_rules
- _get_user_notification_rule
- update_user_notification_rule
List notification rules of your PagerDuty user.
Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.
For more information see the API Concepts Document
Scoped OAuth requires: users:contact_methods.read
EXEC pagerduty.users.notification_rules._get_user_notification_rules
@id='{{ id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}',
@include[]='{{ include[] }}',
@urgency='{{ urgency }}'
;
Get details about a user's notification rule.
Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.
For more information see the API Concepts Document
Scoped OAuth requires: users:contact_methods.read
EXEC pagerduty.users.notification_rules._get_user_notification_rule
@id='{{ id }}' --required,
@notification_rule_id='{{ notification_rule_id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}',
@include[]='{{ include[] }}'
;
Update a user's notification rule.
Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.
For more information see the API Concepts Document
Scoped OAuth requires: users:contact_methods.write
EXEC pagerduty.users.notification_rules.update_user_notification_rule
@id='{{ id }}' --required,
@notification_rule_id='{{ notification_rule_id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}'
@@json=
'{
"notification_rule": "{{ notification_rule }}"
}'
;