diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json new file mode 100644 index 000000000000..1929399d105b --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json @@ -0,0 +1,66 @@ +{ + "parameters": { + "subscriptionId": "12345678-1234-1234-1234-123456789101", + "resourceGroupName": "rg-example", + "ruleName": "webtest-name-example", + "api-version": "2018-03-01", + "parameters": { + "location": "global", + "tags": { + "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": "Resource", + "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": "Resource" + }, + "properties": { + "description": "Automatically created alert rule for availability test \"component-example\" a", + "enabled": true, + "severity": 4, + "windowSize": "PT15M", + "evaluationFrequency": "PT1M", + "criteria": { + "failedLocationCount": 2, + "webTestId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", + "componentId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", + "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" + }, + "actions": [], + "scopes": [ + "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", + "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example" + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "location": "global", + "type": "Microsoft.Insights/metricAlerts", + "name": "webtest-name-example", + "id": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/metricalerts/webtest-name-example", + "tags": { + "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example": "Resource", + "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example": "Resource" + }, + "properties": { + "description": "Automatically created alert rule for availability test \"webtest-name-example\" a", + "severity": 4, + "enabled": true, + "scopes": [ + "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example", + "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example" + ], + "evaluationFrequency": "PT1M", + "windowSize": "PT15M", + "criteria": { + "webTestId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example", + "componentId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example", + "failedLocationCount": 2, + "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" + }, + "actions": [] + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json new file mode 100644 index 000000000000..498cfa7f1400 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "subscriptionId": "12345678-1234-1234-1234-123456789101", + "resourceGroupName": "rg-example", + "ruleName": "webtest-name-example", + "api-version": "2018-03-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "location": "global", + "type": "Microsoft.Insights/metricAlerts", + "name": "webtest-name-example", + "id": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/metricalerts/webtest-name-example", + "tags": { + "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example": "Resource", + "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example": "Resource" + }, + "properties": { + "description": "Automatically created alert rule for availability test \"webtest-name-example\"", + "severity": 4, + "enabled": true, + "scopes": [ + "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example", + "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example" + ], + "evaluationFrequency": "PT1M", + "windowSize": "PT15M", + "criteria": { + "webTestId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example", + "componentId": "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example", + "failedLocationCount": 2, + "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" + }, + "actions": [] + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/metricAlert_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/metricAlert_API.json index dfbf0b9cf660..f20f4baa2b79 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/metricAlert_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/metricAlert_API.json @@ -171,6 +171,9 @@ }, "Get a dynamic alert rule for multiple resources": { "$ref": "./examples/getDynamicMetricAlertMultipleResource.json" + }, + "Get a web test alert rule": { + "$ref": "./examples/getWebTestMetricAlert.json" } } }, @@ -235,6 +238,9 @@ }, "Create or update a dynamic alert rule for Multiple Resources": { "$ref": "./examples/createOrUpdateDynamicMetricAlertMultipleResource.json" + }, + "Create or update a web test alert rule": { + "$ref": "./examples/createOrUpdateWebTestMetricAlert.json" } } }, @@ -308,11 +314,11 @@ } ], "responses": { - "204": { - "description": "No content: the request was successful, but the response is empty" - }, "200": { "description": "Successful request to delete an metric alert rule" + }, + "204": { + "description": "No content: the request was successful, but the response is empty" } }, "x-ms-examples": { @@ -647,9 +653,11 @@ "discriminator": "odata.type", "properties": { "odata.type": { + "type": "string", "enum": [ "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", - "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" + "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", + "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" ], "x-ms-enum": { "name": "odatatype", @@ -682,6 +690,30 @@ }, "description": "Specifies the metric alert criteria for a single resource that has multiple metric criteria." }, + "WebtestLocationAvailabilityCriteria": { + "x-ms-discriminator-value": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria", + "type": "object", + "properties": { + "webTestId": { + "type": "string", + "description": "The Application Insights web test Id." + }, + "componentId": { + "type": "string", + "description": "The Application Insights resource Id." + }, + "failedLocationCount": { + "type": "number", + "description": "The number of failed locations." + } + }, + "required": [ + "webTestId", + "componentId", + "failedLocationCount" + ], + "description": "Specifies the metric alert rule criteria for a web test resource." + }, "MetricCriteria": { "x-ms-discriminator-value": "StaticThresholdCriterion", "type": "object", @@ -696,6 +728,7 @@ ], "properties": { "operator": { + "type": "string", "enum": [ "Equals", "NotEquals", @@ -770,6 +803,7 @@ "discriminator": "criterionType", "properties": { "criterionType": { + "type": "string", "enum": [ "StaticThresholdCriterion", "DynamicThresholdCriterion" @@ -795,10 +829,10 @@ "timeAggregation": { "enum": [ "Average", + "Count", "Minimum", "Maximum", - "Total", - "Count" + "Total" ], "x-ms-enum": { "name": "AggregationType", @@ -837,6 +871,7 @@ ], "properties": { "operator": { + "type": "string", "enum": [ "GreaterThan", "LessThan", @@ -849,6 +884,7 @@ "description": "The operator used to compare the metric value against the threshold." }, "alertSensitivity": { + "type": "string", "enum": [ "Low", "Medium", @@ -931,4 +967,4 @@ "x-ms-parameter-location": "method" } } -} +} \ No newline at end of file