API Documentation for Service Event Rules

rest-api
feature-request
questions
event-rules

(Gabriel Parreiras) #1

Hi,

I want to manipulate some service event rules using the API, but I can’t find any documentation on that. Can you please give some guidance?

Thanks,


(Jay Paige) #2

Hey Gabriel! Thanks so much for waiting! At the moment, we currently do not offer the functionality of adding or removing event rules via API. However, I would love to gather more information on the problem you are trying to solve and pass along your feedback to our Product team. Would you mind me asking for a brief description of this need? Once I have that information, I can then submit your request to our product team here at PagerDuty.


(Gabriel Parreiras) #3

Hi Jay,
We are using Event Rules to filter alarms that need immediate action from those that don’t.
We want to be able to keep that configuration in code, and with a script (Ruby/Python) we would use the API to configure the service on PD.
Our configuration code would be something like:

---
services:
  - id: PNW9UGL
    environment: dev

event_rules:
  - predicate:
      type: contains
      subject: details.AlarmName
      substring: Target5XXCloudwatchAlarm
    actions:
      - type: set_field
        field: severity
        value: critical

Thanks.


(Jay Paige) #4

Hey Gabriel! Thanks so much for waiting. Perfect! Let me pass this information along to our product teams for review. Let me know if you have any further questions. Have a great rest of your day Gabriel!


(Rudolf Csiba) #5

Hey, we would like to automate Event Rule management for our service, but based on the API Reference there is still no API for Event Rules yet. Can you please give some update on this? Thanks.


(Brandon) #6

I was hoping to do the same type of automation. My plan was to use terraform to configure an individual service per application and use the new global event rules to route alerts to those services. Then, utilize service event rules to further classify the individual alerts based on that application’s behavior. Please get an API up for both global event rules and service event rules. Additionally, make sure your terraform provider is updated to support both of those. This would be super helpful in our devops automation.


(Derek Szydlowski) #7

Any update on the this getting in the roadmap or if it was completed?