opsgenie-go-sdk-v2
opsgenie-go-sdk-v2 copied to clipboard
`service_incident_rule` uses ServiceId as required string, not array
Context
When creating a team's incident ruleset via API we currently must use service ID as a string. This must be a valid Id as well (as seen in the validation section).
When trying to create the team incident ruleset via web however, we notice we can add multiple services to a ruleset. This allows us to state "when alert X comes with data Y, we know service A and B are down!" Similarly through an empty array, we could declare a generic incident that can mark high priority alerts without immediately specifying impact.
Symptoms
- Creating Incidents from Alerts becomes severely restricted in a programmatic manner.
- Terraform Provider Runs into the exact same issue [docs]
References:
- https://github.com/opsgenie/opsgenie-go-sdk-v2/blob/master/service/service_incident_rule_request.go#L14
- Json Payload to web:
{
"incidentRuleDto": {
"id": "",
"name": null,
"description": null,
"order": null,
"serviceIds": [],
...
Solution
We need an update such that the ServiceId is an array and brought up to web API versions structure.