Skip to content

Commit 4d91da0

Browse files
authored
Update scheduledQueryRule_API.json To use the right error contract (Azure#11898)
* Update scheduledQueryRule_API.json Fixed Error contract to fit the real structure * Update createOrUpdateScheduledQueryRules.json Removed readonly properties from example parameters * Update scheduledQueryRule_API.json Added property "displayName" to the structure * Fix to item ; https://portal.azure-devex-tools.com/amekpis/correctness/detail?errorId=A596EA9C-C8E9-4A72-90FE-4689DFCBA3F6 Fix to item ; https://portal.azure-devex-tools.com/amekpis/correctness/detail?errorId=A596EA9C-C8E9-4A72-90FE-4689DFCBA3F6 * added display name to the new API version * Fixed descriptions * Added OverrideQueryTimeRange to Swagger on new API version * returned enabled property back to bool * Update scheduledQueryRule_API.json Added missing enum values to ConditionalOperator property * Update scheduledQueryRule_API.json Aligned RP name to pascal format * revert lindent correvction to avoid breaking chnage * run prettier and fixed SubscriptionIdParameter * revert subscripton id to the former description * aligned diagnosticSettings with master * removed locaiton from example * returned location to example * supress false alaram OBJECT_ADDITIONAL_PROPERTIES error * fix suppression * fix merge conflict * removed where clause
1 parent d27f035 commit 4d91da0

File tree

4 files changed

+57
-8
lines changed

4 files changed

+57
-8
lines changed

specification/monitor/resource-manager/Microsoft.Insights/preview/2020-05-01-preview/scheduledQueryRule_API.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@
333333
"type": "string",
334334
"description": "The description of the scheduled query rule."
335335
},
336+
"displayName": {
337+
"type": "string",
338+
"description": "The display name of the alert rule"
339+
},
336340
"severity": {
337341
"type": "number",
338342
"description": "Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest",
@@ -369,6 +373,11 @@
369373
"format": "duration",
370374
"description": "The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size)."
371375
},
376+
"OverrideQueryTimeRange": {
377+
"type": "string",
378+
"format": "duration",
379+
"description": "If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods)"
380+
},
372381
"targetResourceTypes": {
373382
"type": "array",
374383
"items": {
@@ -405,6 +414,16 @@
405414
"properties"
406415
],
407416
"properties": {
417+
"kind": {
418+
"type": "string",
419+
"readOnly": true,
420+
"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."
421+
},
422+
"etag": {
423+
"type": "string",
424+
"readOnly": true,
425+
"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. "
426+
},
408427
"properties": {
409428
"x-ms-client-flatten": true,
410429
"$ref": "#/definitions/ScheduledQueryRuleProperties",

specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"properties": {
1111
"description": "log alert description",
1212
"enabled": "true",
13-
"lastUpdatedTime": "2017-06-23T21:23:52.0221265Z",
14-
"provisioningState": "Succeeded",
1513
"source": {
1614
"query": "Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)",
1715
"dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.OperationalInsights/workspaces/sampleWorkspace",

specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/scheduledQueryRule_API.json

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"default": {
6969
"description": "Error response describing why the operation failed.",
7070
"schema": {
71-
"$ref": "#/definitions/ErrorResponse"
71+
"$ref": "#/definitions/ErrorContract"
7272
}
7373
},
7474
"200": {
@@ -120,7 +120,7 @@
120120
"default": {
121121
"description": "Error response describing why the operation failed.",
122122
"schema": {
123-
"$ref": "#/definitions/ErrorResponse"
123+
"$ref": "#/definitions/ErrorContract"
124124
}
125125
},
126126
"200": {
@@ -169,7 +169,7 @@
169169
"default": {
170170
"description": "Error response describing why the operation failed.",
171171
"schema": {
172-
"$ref": "#/definitions/ErrorResponse"
172+
"$ref": "#/definitions/ErrorContract"
173173
}
174174
},
175175
"200": {
@@ -209,7 +209,7 @@
209209
"default": {
210210
"description": "Error response describing why the operation failed.",
211211
"schema": {
212-
"$ref": "#/definitions/ErrorResponse"
212+
"$ref": "#/definitions/ErrorContract"
213213
}
214214
},
215215
"200": {
@@ -248,7 +248,7 @@
248248
"default": {
249249
"description": "Error response describing why the operation failed.",
250250
"schema": {
251-
"$ref": "#/definitions/ErrorResponse"
251+
"$ref": "#/definitions/ErrorContract"
252252
}
253253
},
254254
"200": {
@@ -294,7 +294,7 @@
294294
"default": {
295295
"description": "Error response describing why the operation failed.",
296296
"schema": {
297-
"$ref": "#/definitions/ErrorResponse"
297+
"$ref": "#/definitions/ErrorContract"
298298
}
299299
},
300300
"200": {
@@ -347,6 +347,16 @@
347347
"type": "string"
348348
},
349349
"description": "Resource tags"
350+
},
351+
"kind": {
352+
"type": "string",
353+
"readOnly": true,
354+
"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."
355+
},
356+
"etag": {
357+
"type": "string",
358+
"readOnly": true,
359+
"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. "
350360
}
351361
},
352362
"required": [
@@ -520,10 +530,13 @@
520530
"ConditionalOperator": {
521531
"type": "string",
522532
"enum": [
533+
"GreaterThanOrEqual",
534+
"LessThanOrEqual",
523535
"GreaterThan",
524536
"LessThan",
525537
"Equal"
526538
],
539+
"default": "GreaterThanOrEqual",
527540
"x-ms-enum": {
528541
"name": "ConditionalOperator",
529542
"modelAsString": true
@@ -536,6 +549,7 @@
536549
"Consecutive",
537550
"Total"
538551
],
552+
"default": "Consecutive",
539553
"x-ms-enum": {
540554
"name": "metricTriggerType",
541555
"modelAsString": true
@@ -575,6 +589,10 @@
575589
"type": "string",
576590
"description": "The description of the Log Search rule."
577591
},
592+
"displayName": {
593+
"type": "string",
594+
"description": "The display name of the alert rule"
595+
},
578596
"enabled": {
579597
"type": "string",
580598
"description": "The flag which indicates whether the Log Search rule is enabled. Value should be true or false",
@@ -765,6 +783,16 @@
765783
"criteria"
766784
]
767785
},
786+
"ErrorContract": {
787+
"description": "Describes the format of Error response.",
788+
"type": "object",
789+
"properties": {
790+
"error": {
791+
"description": "The error details.",
792+
"$ref": "#/definitions/ErrorResponse"
793+
}
794+
}
795+
},
768796
"ErrorResponse": {
769797
"description": "Describes the format of Error response.",
770798
"type": "object",

specification/monitor/resource-manager/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,10 @@ directive:
612612
from: metricAlert_API.json
613613
where: $.definitions.MetricAlertResource
614614
reason: 'Action is expected to receive a subclass of Resource'
615+
- from : scheduledQueryRule_API.json
616+
suppress:
617+
- OBJECT_ADDITIONAL_PROPERTIES
618+
reason: "false alarm"
615619
```
616620

617621
### Tag: profile-hybrid-2019-03-01

0 commit comments

Comments
 (0)