-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add responders{type = "escalation"}
in opsgenie_alert_policy
#293
Comments
I'm not familiar with the code base, but I believe this is defined here:
responder := alert.Responder{
Type: alert.ResponderType(config["type"].(string)),
Id: responderID,
Name: name,
Username: username,
} |
I have just tested the API and it seems to be possible to set a #TEAM_ID=""
#ESCALATION_ID=""
#OPSGENIE_API_KEY=""
ALERT_POLICY_ID="$( curl -X POST \
https://api.eu.opsgenie.com/v2/policies?teamId=$TEAM_ID \
--header "Authorization: GenieKey $OPSGENIE_API_KEY" \
--header 'Content-Type: application/json' \
--data \
'{
"continue": false,
"type": "alert",
"name": "test",
"enabled": false,
"policyDescription": "test",
"filter": {
"type": "match-all"
},
"responders": [
{
"type": "escalation",
"id": "'$ESCALATION_ID'"
}
],
"alias": "{{alias}}",
"message": "{{message}}",
"description": "{{description}}",
"source": "{{source}}",
"entity": "{{entity}}",
"actions": [],
"tags": [],
"details": {},
"ignoreOriginalActions": false,
"ignoreOriginalDetails": false,
"ignoreOriginalResponders": true,
"ignoreOriginalTags": false
}' | jq -r '.data.id' )"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 806 0 163 100 643 714 2819 --:--:-- --:--:-- --:--:-- 3535
curl -X GET \
https://api.eu.opsgenie.com/v2/policies/$ALERT_POLICY_ID?teamId=$TEAM_ID \
--header "Authorization: GenieKey $OPSGENIE_API_KEY" | jq '.data.responders[].type'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 593 0 593 0 0 4145 0 --:--:-- --:--:-- --:--:-- 4176
"escalation" I have submmited a suggestion to edit the API documentation. |
Hi, @grubernaut @fnuva @tombuildsstuff @janhorstmann |
I went ahead and tested this locally and realised that responder type is also validated in opsgenie-go-sdk-v2. I have also created an issue and a simple PR there. @frknyldz I have seen that you are doing releases. Could you provide me with some guidance and maybe help on how to move this along? |
Hi everyone, this issue has been fixed in v0.6.27. Kindly check ! |
Hi,
this is a feature request to support
in resource
opsgenie_alert_policy
.Although the API documentation states that only
user
andteam
are possible values to theresponders
field, the web interface definitely allows setting anescalation
. When doing so theterraform-provider-opsgenie
correctly identifies thetype = "escalation"
as configuration drift:Please add
responders{type = "escalation"}
inopsgenie_alert_policy
.Affected Resource(s)
Terraform Configuration Files
Output
The text was updated successfully, but these errors were encountered: