You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following configuration doesn't find the Vendor "Sentry," but instead "IPSentry," obliging me to instead put the Sentry vendor's id in a local.
data "pagerduty_vendor" "sentry" {
name = "Sentry"
}
I haven't looked at the code, but I have looked at the PagerDuty API. Running curl -X GET --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'Authorization: Token token=<your token>' 'https://api.pagerduty.com/vendors?query=Sentry' gives back both vendors, with IPSentry first.
{
"vendors": [
{
"id": "PY3OLY6",
"type": "vendor",
"summary": "IPSentry",
"self": "https://api.pagerduty.com/vendors/PY3OLY6",
"html_url": null,
"name": "IPSentry",
"website_url": "http://ipsentry.com/",
"long_name": "IPSentry",
"logo_url": "",
"thumbnail_url": "",
"description": "IPSentry is a Windows based network monitoring software package used by thousands of information system specialists, system administrators, and IT solution providers around the world.",
"integration_guide_url": "https://www.pagerduty.com/docs/guides/ipsentry-integration-guide/",
"connectable": false,
"generic_service_type": "api",
"alert_creation_default": "create_alerts_and_incidents",
"alert_creation_editable": true,
"is_pd_cef": false
},
{
"id": "PKG4M95",
"type": "vendor",
"summary": "Sentry",
"self": "https://api.pagerduty.com/vendors/PKG4M95",
"html_url": null,
"name": "Sentry",
"website_url": "https://getsentry.com/welcome/",
"long_name": "Sentry",
"logo_url": "https://s3.amazonaws.com/pdpartner/sentry_large.png",
"thumbnail_url": "https://s3.amazonaws.com/pdpartner/sentry_thumb.png",
"description": "Sentry provides real-time crash reporting for your web apps, mobile apps, and games.",
"integration_guide_url": "https://www.pagerduty.com/docs/guides/sentry-integration-guide/",
"connectable": false,
"generic_service_type": "api",
"alert_creation_default": "create_alerts_and_incidents",
"alert_creation_editable": true,
"is_pd_cef": false
}
],
"query": "Sentry",
"limit": 25,
"offset": 0,
"total": null,
"more": false
}
I think it'd be a good idea to find the object with the matching name field in the array, rather than just taking the first one. This would also require users to specify the full, exact name of the vendor in the data source's name, which is what I assumed was the case from the start; as it stands, I get the same results using "Sen".
The text was updated successfully, but these errors were encountered:
Having looked at the code, I was wrong: it does look for an object with a matching name, it just does it in such a way that will always find the first item in the result list.
it seems like the fix would be as simple as changing this line to only match against the entire string.
The following configuration doesn't find the Vendor "Sentry," but instead "IPSentry," obliging me to instead put the Sentry vendor's id in a local.
I haven't looked at the code, but I have looked at the PagerDuty API. Running
curl -X GET --header 'Accept: application/vnd.pagerduty+json;version=2' --header 'Authorization: Token token=<your token>' 'https://api.pagerduty.com/vendors?query=Sentry'
gives back both vendors, with IPSentry first.I think it'd be a good idea to find the object with the matching
name
field in the array, rather than just taking the first one. This would also require users to specify the full, exact name of the vendor in the data source'sname
, which is what I assumed was the case from the start; as it stands, I get the same results using"Sen"
.The text was updated successfully, but these errors were encountered: