salt.states.pagerduty_escalation_policy

Manage PagerDuty escalation policies.

Schedules and users can be referenced by pagerduty ID, or by name, or by email address.

For example:

ensure test escalation policy:
    pagerduty_escalation_policy.present:
        - name: bruce test escalation policy
        - escalation_rules:
            - targets:
                - type: schedule
                  id: 'bruce test schedule level1'
                - type: user
                  id: 'Bruce Sherrod'
              escalation_delay_in_minutes: 15
            - targets:
                - type: schedule
                  id: 'bruce test schedule level2'
              escalation_delay_in_minutes: 15
            - targets:
                - type: user
                  id: 'Bruce TestUser1'
                - type: user
                  id: 'Bruce TestUser2'
                - type: user
                  id: 'Bruce TestUser3'
                - type: user
                  id:  '[email protected]'
              escalation_delay_in_minutes: 15

salt.states.pagerduty_escalation_policy.absent(profile='pagerduty', subdomain=None, api_key=None, **kwargs)

Ensure that a PagerDuty escalation policy does not exist. Accepts all the arguments that pagerduty_escalation_policy.present accepts; but ignores all arguments except the name.

Name can be the escalation policy id or the escalation policy name.

salt.states.pagerduty_escalation_policy.present(profile='pagerduty', subdomain=None, api_key=None, **kwargs)

Ensure that a pagerduty escalation policy exists. Will create or update as needed.

This method accepts as args everything defined in https://developer.pagerduty.com/documentation/rest/escalation_policies/create. In addition, user and schedule id's will be translated from name (or email address) into PagerDuty unique ids. For example:

pagerduty_escalation_policy.present:
  • name: bruce test escalation policy

  • escalation_rules:
    • targets:
      • type: schedule id: 'bruce test schedule level1'

      • type: user id: 'Bruce Sherrod'

In this example, 'Bruce Sherrod' will be looked up and replaced with the PagerDuty id (usually a 7 digit all-caps string, e.g. PX6GQL7)

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pagerduty_escalation_policy.html