Skip to content

Commit

Permalink
[Hub Generated] Review request for Microsoft.Insights to add version …
Browse files Browse the repository at this point in the history
…stable/2018-03-01 (Azure#7920)

* fix(metricAlert_API): add missing properties to web test metric alert

* docs(metricAlert_API): change properties description

* fix(metricAlert_API): remove templateType from webtest metric alert rules

* fix(metricAlert_API): change subscription description

* fix(metricAlert_API): prettier checks

* fix(): lint warnings

* fix(): lint warnings

* fix(): run prettier

* fix(metricAlert_API): add 'None' option to AggregationType enum in order to be align with 2018-01-01 metricDefintions_API.json

* fix(metricAlert_API): align AggregationType enum with metricDefinitions

* fix(): revert changes to un-brack ARM api

* fix(): change webTestId description

* fix(): add none to timeAggregation enum for compatbility

* fix(): remove type: string and none value from timeAggregation enum
  • Loading branch information
adibiton authored and josuh committed Mar 4, 2020
1 parent 55838b1 commit 98f2c7d
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -696,6 +728,7 @@
],
"properties": {
"operator": {
"type": "string",
"enum": [
"Equals",
"NotEquals",
Expand Down Expand Up @@ -770,6 +803,7 @@
"discriminator": "criterionType",
"properties": {
"criterionType": {
"type": "string",
"enum": [
"StaticThresholdCriterion",
"DynamicThresholdCriterion"
Expand All @@ -795,10 +829,10 @@
"timeAggregation": {
"enum": [
"Average",
"Count",
"Minimum",
"Maximum",
"Total",
"Count"
"Total"
],
"x-ms-enum": {
"name": "AggregationType",
Expand Down Expand Up @@ -837,6 +871,7 @@
],
"properties": {
"operator": {
"type": "string",
"enum": [
"GreaterThan",
"LessThan",
Expand All @@ -849,6 +884,7 @@
"description": "The operator used to compare the metric value against the threshold."
},
"alertSensitivity": {
"type": "string",
"enum": [
"Low",
"Medium",
Expand Down Expand Up @@ -931,4 +967,4 @@
"x-ms-parameter-location": "method"
}
}
}
}

0 comments on commit 98f2c7d

Please sign in to comment.