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

Update scheduledQueryRule_API.json To use the right error contract #11898

Merged
merged 23 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1ac2357
Update scheduledQueryRule_API.json
adklinge Dec 2, 2020
4b14a00
Update createOrUpdateScheduledQueryRules.json
adklinge Dec 6, 2020
be58c30
Update scheduledQueryRule_API.json
adklinge Dec 6, 2020
e6fae47
Fix to item ; https://portal.azure-devex-tools.com/amekpis/correctnes…
adklinge Dec 6, 2020
2e8067a
added display name to the new API version
adklinge Dec 6, 2020
c6189e5
Fixed descriptions
adklinge Dec 6, 2020
d23f09e
Added OverrideQueryTimeRange to Swagger on new API version
adklinge Dec 6, 2020
ca0910f
returned enabled property back to bool
adklinge Dec 6, 2020
78b5813
Merge branch 'adklinge/round_trip_error_fix'
adklinge Dec 7, 2020
504c205
Update scheduledQueryRule_API.json
adklinge Dec 7, 2020
98e27ba
Update scheduledQueryRule_API.json
adklinge Dec 7, 2020
efea44f
revert lindent correvction to avoid breaking chnage
adklinge Dec 8, 2020
6d579df
run prettier and fixed SubscriptionIdParameter
adklinge Dec 31, 2020
088cea0
revert subscripton id to the former description
adklinge Jan 11, 2021
bb6a56f
rebased from master
adklinge Jan 17, 2021
5e18e0e
aligned diagnosticSettings with master
adklinge Jan 17, 2021
00ccd7c
removed locaiton from example
adklinge Jan 20, 2021
527c5db
returned location to example
adklinge Jan 24, 2021
0395af7
supress false alaram OBJECT_ADDITIONAL_PROPERTIES error
adklinge Jan 25, 2021
e541ec8
fix suppression
adklinge Jan 25, 2021
cd57300
fix merge conflict
adklinge Jan 25, 2021
c35edf4
merged from master
adklinge Jan 25, 2021
39fb8a0
removed where clause
adklinge Jan 25, 2021
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
Expand Up @@ -333,6 +333,10 @@
"type": "string",
"description": "The description of the scheduled query rule."
},
"displayName": {
adklinge marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"description": "The display name of the alert rule"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In cases where the rule was migrated from the Legacy Log Analytic API

},
"severity": {
"type": "number",
"description": "Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest",
Expand Down Expand Up @@ -369,6 +373,11 @@
"format": "duration",
"description": "The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size)."
},
"OverrideQueryTimeRange": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"type": "string",
"format": "duration",
"description": "If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods)"
},
"targetResourceTypes": {
"type": "array",
"items": {
Expand Down Expand Up @@ -405,6 +414,16 @@
"properties"
],
"properties": {
"kind" :{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"type": "string",
"readOnly": true,
"description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value."
},
"etag" :{
"type": "string",
"readOnly": true,
"description" : "The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. "
},
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/ScheduledQueryRuleProperties",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"properties": {
"description": "log alert description",
"enabled": "true",
"lastUpdatedTime": "2017-06-23T21:23:52.0221265Z",
"provisioningState": "Succeeded",
"source": {
"query": "Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)",
"dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}": {
adklinge marked this conversation as resolved.
Show resolved Hide resolved
"put": {
"description": "Creates or updates an log search rule.",
"tags": [
Expand Down Expand Up @@ -68,7 +68,7 @@
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorContract"
}
},
"200": {
Expand Down Expand Up @@ -120,7 +120,7 @@
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorContract"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
},
"200": {
Expand Down Expand Up @@ -169,7 +169,7 @@
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorContract"
}
},
"200": {
Expand Down Expand Up @@ -209,7 +209,7 @@
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorContract"
}
},
"200": {
Expand All @@ -226,7 +226,7 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/microsoft.insights/scheduledQueryRules": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules": {
"get": {
"tags": [
"scheduledQueryRules"
Expand All @@ -248,7 +248,7 @@
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorContract"
}
},
"200": {
Expand All @@ -269,7 +269,7 @@
"x-ms-odata": "#/definitions/LogSearchRuleResource"
}
},
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules": {
"get": {
"tags": [
"scheduledQueryRules"
Expand All @@ -294,7 +294,7 @@
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorContract"
}
},
"200": {
Expand Down Expand Up @@ -347,6 +347,16 @@
"type": "string"
},
"description": "Resource tags"
},
"kind" :{
"type": "string",
"readOnly": true,
"description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value."
},
"etag" :{
"type": "string",
"readOnly": true,
"description" : "The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. "
}
},
"required": [
Expand Down Expand Up @@ -520,10 +530,13 @@
"ConditionalOperator": {
"type": "string",
"enum": [
"GreaterThanOrEqual",
"LessThanOrEqual",
"GreaterThan",
"LessThan",
"Equal"
],
"default" : "GreaterThanOrEqual",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix to s360 violation :
https://portal.azure-devex-tools.com/amekpis/correctness/detail?errorId=D6E5FC34-0663-472E-952E-8B9F5C0C8D17
When ConditionalOperator is not specified by PUT, the service populates it with the default value of 'GreaterThanOrEqual'.
Therefor, this is not a breaking (we do not change the service current behavior) change but an alignment of the swagger.

"x-ms-enum": {
"name": "ConditionalOperator",
"modelAsString": true
Expand All @@ -536,6 +549,7 @@
"Consecutive",
"Total"
],
"default" : "Consecutive",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix to s360 violation :
https://portal.azure-devex-tools.com/amekpis/correctness/detail?errorId=D6E5FC34-0663-472E-952E-8B9F5C0C8D17
When "MetricTriggerType" is not specified by PUT, the service populates it with the default value of 'Consecutive'.
Therefor, this is not a breaking (we do not change the service current behavior) change but an alignment of the swagger.

"x-ms-enum": {
"name": "metricTriggerType",
"modelAsString": true
Expand Down Expand Up @@ -575,6 +589,10 @@
"type": "string",
"description": "The description of the Log Search rule."
},
"displayName": {
"type": "string",
"description": "The display name of the alert rule"
},
"enabled": {
"type": "string",
"description": "The flag which indicates whether the Log Search rule is enabled. Value should be true or false",
Expand Down Expand Up @@ -765,6 +783,16 @@
"criteria"
]
},
"ErrorContract": {
"description": "Describes the format of Error response.",
"type": "object",
"properties": {
"error": {
"description": "The error details.",
"$ref": "#/definitions/ErrorResponse"
}
}
},
"ErrorResponse": {
"description": "Describes the format of Error response.",
"type": "object",
Expand Down