Skip to content
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

Fix result selector for schedule alert rules as 'enabled' value coming as string #11196

Merged
merged 2 commits into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"loc.friendlyName": "Query Azure Monitor alerts",
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=870240)",
"loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?linkid=870240)",
"loc.description": "Observe the configured Azure Monitor rules for active alerts",
"loc.instanceNameFormat": "Query Azure Monitor alerts",
"loc.releaseNotes": "What's new in Version 1.0:<br/>&nbsp;Added support for query unified Azure monitor alerts.",
Expand All @@ -23,4 +23,4 @@
"loc.input.help.alertState": "Filter by state of the alert instance. Default value is to select all.",
"loc.input.label.monitorCondition": "Monitor condition",
"loc.input.help.monitorCondition": "Monitor condition represents whether the underlying conditions have crossed the defined alert rule thresholds."
}
}
6 changes: 3 additions & 3 deletions Tasks/AzureMonitorV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
],
"version": {
"Major": 1,
"Minor": 151,
"Patch": 2
"Minor": 157,
"Patch": 0
},
"instanceNameFormat": "Query Azure Monitor alerts",
"groups": [
Expand Down Expand Up @@ -187,7 +187,7 @@
"ResourceGroupName": "$(ResourceGroupName)"
},
"requestContent": "{\"requests\":[{\"httpMethod\":\"GET\",\"relativeUrl\":\"/subscriptions/{{{endpoint.subscriptionId}}}/resourceGroups/{{{ResourceGroupName}}}/providers/microsoft.insights/activityLogAlerts?api-Version=2017-04-01\"}, {\"httpMethod\":\"GET\",\"relativeUrl\":\"/subscriptions/{{{endpoint.subscriptionId}}}/resourceGroups/{{{ResourceGroupName}}}/providers/microsoft.insights/metricAlerts?api-version=2018-03-01\"}, {\"httpMethod\":\"GET\",\"relativeUrl\":\"/subscriptions/{{{endpoint.subscriptionId}}}/resourceGroups/{{{ResourceGroupName}}}/providers/microsoft.insights/scheduledqueryrules?api-version=2018-04-16\"}]}",
"resultSelector": "jsonpath:$.responses[?(@.httpStatusCode == 200)].content.value[?(@.properties.enabled == true)]",
"resultSelector": "jsonpath:$.responses[?(@.httpStatusCode == 200)].content.value[?(@.properties.enabled == true || @.properties.enabled == 'true')]",
"resultTemplate": "{ \"Value\" : \"{{#removePrefixFromPath type 'Microsoft.Insights'}}{{/removePrefixFromPath}}/{{{name}}}\", \"DisplayValue\" : \"{{{name}}} [{{#removePrefixFromPath type 'Microsoft.Insights'}}{{/removePrefixFromPath}}]\" }"
}
],
Expand Down
6 changes: 3 additions & 3 deletions Tasks/AzureMonitorV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
],
"version": {
"Major": 1,
"Minor": 151,
"Patch": 2
"Minor": 157,
"Patch": 0
},
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
"groups": [
Expand Down Expand Up @@ -187,7 +187,7 @@
"ResourceGroupName": "$(ResourceGroupName)"
},
"requestContent": "{\"requests\":[{\"httpMethod\":\"GET\",\"relativeUrl\":\"/subscriptions/{{{endpoint.subscriptionId}}}/resourceGroups/{{{ResourceGroupName}}}/providers/microsoft.insights/activityLogAlerts?api-Version=2017-04-01\"}, {\"httpMethod\":\"GET\",\"relativeUrl\":\"/subscriptions/{{{endpoint.subscriptionId}}}/resourceGroups/{{{ResourceGroupName}}}/providers/microsoft.insights/metricAlerts?api-version=2018-03-01\"}, {\"httpMethod\":\"GET\",\"relativeUrl\":\"/subscriptions/{{{endpoint.subscriptionId}}}/resourceGroups/{{{ResourceGroupName}}}/providers/microsoft.insights/scheduledqueryrules?api-version=2018-04-16\"}]}",
"resultSelector": "jsonpath:$.responses[?(@.httpStatusCode == 200)].content.value[?(@.properties.enabled == true)]",
"resultSelector": "jsonpath:$.responses[?(@.httpStatusCode == 200)].content.value[?(@.properties.enabled == true || @.properties.enabled == 'true')]",
"resultTemplate": "{ \"Value\" : \"{{#removePrefixFromPath type 'Microsoft.Insights'}}{{/removePrefixFromPath}}/{{{name}}}\", \"DisplayValue\" : \"{{{name}}} [{{#removePrefixFromPath type 'Microsoft.Insights'}}{{/removePrefixFromPath}}]\" }"
}
],
Expand Down