Switch Event Rules to Event Orchestration on a Service via API

Hello,

I am currently testing event orchestration configuration via API. The rule-config via API is fine, but in order to use it, event orchestration first has to be activated per service. The default is “Event Rules”, see image below

How do I switch from rules to orchestration via API, I can’t find a proper setting.

It is not possible to rebuild or reorganize the Service-Structure another way. I would like to fully automate this configuration and not leave it in a semi-automatic state.

The corresponding entry in the docs:

Thanks and kind regards
Daniel

Hey @daniel.smith,

There is an API endpoint you can provide the target service id and a true flag to turn on Event Orchestrations. It seems to be a lightweight call and idempotent. I’ve used this with a few extra calls to start shifting all of the services in our instance to Event Orchestration myself.

https://developer.pagerduty.com/api-reference/855659be83d9e-update-the-service-orchestration-active-status-for-a-service

1 Like

Dear @Preocts,

thanks for the reply and you’re right, that seems to be the correct API endpoint.

Still, I can’t manage to activate the service orchestration with this. Although I try to set it via the PUT, the return value is always “false”. The “Service Event rules” stay active this way - “Service Event Orchestration” remains disabled.

It’s also the same the other way around: if I enable the Service orchestration through the GUI and GET the active status it matches my GUI setting (true). If I want to change this to “false” through API, the setting is not changed and remains in the old state.

It’s a rather small Request compared to others and I don’t think I missed something but: did I actually manage to miss something here? Or does the API call just not work?

Thanks and regards
Daniel

@daniel.smith

Looking at your payload in the screenshot it seems you are sending {"active": "true"}. The value the payload wants is a boolean. Try {"active": true} instead.

I recently (three days ago) used this endpoint against several thousand services so I can assure you that it was working then. :wink:

1 Like

Hey @Preocts,

you are so right! I did not second guess the placeholder in the body of the API template which is in double quotes and I then just replaced …donkey-hat for me…

Thank you very much! =)

image

1 Like

Hello there.

While it seems to be easy to activate it via API, is it possible to do the same via terraform?
We are using official terraform provider, and we configure Service orchestration rules for every service we create. However, the services have Service Orchestration disabled by default.

Kind regards,
Ilia.

@ilia I suggest adding an issue in the PD Terraform provider Github repo for this. I’ll let the team know as well.