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
- list
The user's notification rule requested.
| Name | Datatype | Description |
|---|---|---|
id | string | |
contact_method | object | (opaque JSON 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 | A string that determines the schema of the object. This must be the standard name for the entity, suffixed by _reference if the object is a reference. |
urgency | string | Which incident urgency this rule is used for. Account must have the urgencies ability to have a low urgency notification rule. (high, low) |
A list of notification rules.
| Name | Datatype | Description |
|---|---|---|
id | string | |
contact_method | object | (opaque JSON 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 | A string that determines the schema of the object. This must be the standard name for the entity, suffixed by _reference if the object is a reference. |
urgency | string | Which incident urgency this rule is used for. Account must have the urgencies ability to have a low urgency notification rule. (high, low) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, notification_rule_id | include[] | Get details about a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br /> |
list | select | id | include[], urgency | List notification rules of your PagerDuty user.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br /> |
create | insert | id, notification_rule | Create a new notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br /> | |
update | update | id, notification_rule_id, notification_rule | Update a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br /> | |
delete | delete | id, notification_rule_id | Remove a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br /> |
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. |
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
- list
Get details about a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br />
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 include[] = '{{ include[] }}'
;
List notification rules of your PagerDuty user.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br />
SELECT
id,
contact_method,
html_url,
self,
start_delay_in_minutes,
summary,
type,
urgency
FROM pagerduty.users.notification_rules
WHERE id = '{{ id }}' -- required
AND include[] = '{{ include[] }}'
AND urgency = '{{ urgency }}'
;
INSERT examples
- create
- Manifest
Create a new notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
INSERT INTO pagerduty.users.notification_rules (
notification_rule,
id
)
SELECT
'{{ notification_rule }}' /* required */,
'{{ id }}'
RETURNING
notification_rule
;
# Description fields are for documentation purposes
- name: notification_rules
props:
- name: id
value: "{{ id }}"
description: Required parameter for the notification_rules resource.
- name: notification_rule
description: |
A rule for contacting the user.
value:
id: "{{ id }}"
summary: "{{ summary }}"
type: "{{ type }}"
self: "{{ self }}"
html_url: "{{ html_url }}"
start_delay_in_minutes: {{ start_delay_in_minutes }}
contact_method:
id: "{{ id }}"
summary: "{{ summary }}"
type: "{{ type }}"
self: "{{ self }}"
html_url: "{{ html_url }}"
urgency: "{{ urgency }}"
UPDATE examples
- update
Update a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
UPDATE pagerduty.users.notification_rules
SET
notification_rule = '{{ notification_rule }}'
WHERE
id = '{{ id }}' --required
AND notification_rule_id = '{{ notification_rule_id }}' --required
AND notification_rule = '{{ notification_rule }}' --required
RETURNING
notification_rule;
DELETE examples
- delete
Remove a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
DELETE FROM pagerduty.users.notification_rules
WHERE id = '{{ id }}' --required
AND notification_rule_id = '{{ notification_rule_id }}' --required
;