Hi, I want to delete service routes that are inside an Event Orchestration automatically via Python, but I don’t see any documentation about any endpoint from the API to do it. Can someone give me more feedback about this? Thanks :)
Hi
You can use the “Update the Router for an Event Orchestration” endpoint to delete a rule. It requires some munging of the ruleset, so I’m not sure it will be great for what you’re trying to do.
You can see from the request sample on the docs page that this endpoint will receive a PUT request that contains the full ruleset you want to apply to the orchestration. If you leave out a rule, that rule will effectively be deleted from your set. The “start” set is treated like a single object.
I brute-forced through it in an example here. Basically what I’m doing is:
- requesting the event orchestration (I only have one on this account, so ymmv)
- getting the ID of the orchestration I want to change rules on because I need it for the next request endpoint
- requesting the router data (the rules)
- looping through the rules and
- skipping the one i want to delete while preserving the other rules
Then I rebuild the json with the new ruleset and push it back up to the API.
Not especially pretty but might give you some ideas.
HTH,
--mandi
Reply
Login to PagerDuty Commons
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.