salt.states.pagerduty_service

Manage PagerDuty services

Escalation policies can be referenced by pagerduty ID or by namea.

For example:

ensure test service
pagerduty_service.present:
  • name: 'my service'
  • escalation_policy_id: 'my escalation policy'
  • type: nagios

[etc]

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

Ensure a pagerduty service does not exist. Name can be the service name or pagerduty service id.

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

Ensure pagerduty service exists. This method accepts as arguments everything defined in https://developer.pagerduty.com/documentation/rest/services/create

Note that many arguments are mutually exclusive, depending on the "type" argument.

Examples:

# create a PagerDuty email service at test-email@DOMAIN.pagerduty.com ensure generic email service exists:

pagerduty_service.present:
  • name: my email service

  • service:

    description: "email service controlled by salt" escalation_policy_id: "my escalation policy" type: "generic_email" service_key: "test-email"

# create a pagerduty service using cloudwatch integration ensure my cloudwatch service exists:

pagerduty_service.present:
  • name: my cloudwatch service

  • service:

    escalation_policy_id: "my escalation policy" type: aws_cloudwatch description: "my cloudwatch service controlled by salt"

TODO: aws_cloudwatch type should be integrated with boto_sns