opsgenie / opsgenie-go-sdk-v2

Opsgenie GO SDK v2
Apache License 2.0
34 stars 63 forks source link

How to get the ID of a newly created alert #134

Open arno4000 opened 1 year ago

arno4000 commented 1 year ago

I am creating an alert with the alertClient.Create() function https://docs.opsgenie.com/docs/opsgenie-go-api-v2#create-alert.

How can I get the ID of the newly created alert? Currently, I am setting a self-generated ID as alias and then query the alert with the alias ID to get the alert ID. Is there a way to directly get the ID of the alert, or is this not possible as the alert is created async in the background?

The response object with the type alert.AsyncAlertResult only contains a request ID. Is there a way to get the alert ID with the request ID?

foxthedream commented 8 months ago

Same here. Can someone from the team respond. It is not in your documentation but it does imply the above is correct. Is the only way of query/closing alerts is by using the alias?