I have an alert with an alias like:
service@nano-prod||connections||data gateways||data||data://proxy-fg.prod.com
and sending a command to close:
curl -X POST "https://api.eu.opsgenie.com/v2/alerts/service@nano-prod||connections||data gateways||data||data://proxy-fg.prod.com/close?identifierType=alias" -H "Authorization: GenieKey 111b1111144-41111f-11111" -H "Content-Type: application/json" -d '{ "user":"Monitoring Script"}'
And I get an answer:
{"result":"Request will be processed","took":0.007,"requestId":"d62e7d50-4453-4879-be79-94b25c76ae72"}
Alerts with other aliases are closed with such a response, but in this situation this is not the case. Why?
Hey Alexey, Alan from the Opsgenie Support team here.
Testing this, it seems that the issue is that the alias is being parsed incorrectly due to the data:// part of the value - If you check your logs, you are probably going to see something similar to this:
Can not execute alert action. There is no open alert with alias
[service@nano-prod||connections||data gateways||data||data:/proxy-fg.prod.com].
Where we can see that one of the slashes is getting removed
One possible workaround for this would be to use URI encoding to get the value to be parsed correctly, here is an example that worked on my side:
curl --location 'https://api.opsgenie.com/v2/alerts/service%40nano-prod%7C%7Cconnections%7C%7Cdata%20gateways%7C%7Cdata%7C%7Cdata%3A%2F%2Fproxy-fg.prod.com/close?identifierType=alias' \
--header 'Content-Type: application/json' \
--header 'Authorization: GenieKey APIKEY' \
--data '{
}'
I hope this helps, and if you need more assistance with your instance, I would recommend creating a support ticket at Atlassian Support.
Cheers,
Alan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.