opsgenie-go-sdk-v2 icon indicating copy to clipboard operation
opsgenie-go-sdk-v2 copied to clipboard

`service_incident_rule` uses ServiceId as required string, not array

Open Benbentwo opened this issue 2 years ago • 0 comments

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.

Benbentwo avatar Sep 22 '22 21:09 Benbentwo