From c2e43f82e91ff7ad691381df56c535164b354cba Mon Sep 17 00:00:00 2001 From: avjerafi <64891828+avjerafi@users.noreply.github.com> Date: Thu, 24 Jun 2021 11:50:40 +0300 Subject: [PATCH] Dev monitor microsoft.insights 2021 02 01 preview custom properties (#14942) * Modified Actions definition, added missing type property for objects * Removed directive to delete ResourceGroupNameParameter * Added suppression for OperationsAPIImplementation Co-authored-by: Avi Jerafi --- .../createOrUpdateScheduledQueryRule.json | 48 +++++++++---------- ...UpdateScheduledQueryRuleResourceGroup.json | 48 +++++++++---------- ...rUpdateScheduledQueryRuleSubscription.json | 48 +++++++++---------- .../examples/getScheduledQueryRule.json | 16 +++---- ...istScheduledQueryRulesByResourceGroup.json | 32 ++++++------- ...listScheduledQueryRulesBySubscription.json | 32 ++++++------- .../examples/patchScheduledQueryRule.json | 16 +++---- .../scheduledQueryRule_API.json | 24 ++++++---- .../monitor/resource-manager/readme.md | 8 ++-- 9 files changed, 139 insertions(+), 133 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRule.json index a5f4a76a85e9..4e52e254e432 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRule.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRule.json @@ -48,15 +48,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } }, @@ -111,15 +111,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } }, @@ -173,15 +173,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json index 808247601259..dd34bbdebb64 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json @@ -34,15 +34,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } }, @@ -83,15 +83,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } }, @@ -131,15 +131,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json index bd3bfab4d0d7..4c4e90962745 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json @@ -51,15 +51,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } }, @@ -117,15 +117,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } }, @@ -182,15 +182,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/getScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/getScheduledQueryRule.json index 01d24ea4ae94..c5785d29624b 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/getScheduledQueryRule.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/getScheduledQueryRule.json @@ -56,15 +56,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesByResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesByResourceGroup.json index 03b6e2d84f36..32c65a82c215 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesByResourceGroup.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesByResourceGroup.json @@ -60,15 +60,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } }, { @@ -105,15 +105,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } ] diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesBySubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesBySubscription.json index 16dacf228515..6e08765816d7 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesBySubscription.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/listScheduledQueryRulesBySubscription.json @@ -59,15 +59,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } }, { @@ -104,15 +104,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } ] diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/patchScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/patchScheduledQueryRule.json index 8d7dd8d59bb8..bdc7b71cec97 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/patchScheduledQueryRule.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/examples/patchScheduledQueryRule.json @@ -47,15 +47,15 @@ ] }, "muteActionsDuration": "PT30M", - "actions": [ - { - "actionGroupId": "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup", - "webHookProperties": { - "key11": "value11", - "key12": "value12" - } + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" } - ] + } } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/scheduledQueryRule_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/scheduledQueryRule_API.json index c10fe1c4a857..67dcfbd16ce3 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-02-01-preview/scheduledQueryRule_API.json @@ -309,25 +309,29 @@ } }, "definitions": { - "Action": { + "Actions": { "type": "object", "description": "Actions to invoke when the alert fires.", "properties": { - "actionGroupId": { - "type": "string", - "description": "Action Group resource Id to invoke when the alert fires." + "actionGroups": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Action Group resource Ids to invoke when the alert fires." }, - "webHookProperties": { + "customProperties": { "type": "object", "additionalProperties": { "type": "string", - "description": "The dictionary of custom properties to include with the post operation. These data are appended to the webhook payload." + "description": "The dictionary of custom properties to include with the post operation. These data are appended to the alert payload." }, - "description": "The properties of a webhook object." + "description": "The properties of an alert payload." } } }, "ScheduledQueryRuleProperties": { + "type": "object", "properties": { "createdWithApiVersion": { "type": "string", @@ -405,9 +409,9 @@ "description": "Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert." }, "actions": { - "type": "array", + "type": "object", "items": { - "$ref": "#/definitions/Action" + "$ref": "#/definitions/Actions" }, "description": "Actions to invoke when the alert fires." }, @@ -481,6 +485,7 @@ "type": "object", "properties": { "tags": { + "type": "object", "additionalProperties": { "type": "string" }, @@ -495,6 +500,7 @@ "description": "The scheduled query rule resource for patch operations." }, "ScheduledQueryRuleResourceCollection": { + "type": "object", "properties": { "value": { "type": "array", diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 151f6decc291..298f45aac96d 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -712,6 +712,10 @@ directive: where: $.paths from: activityLogAlerts_API.json reason: 'Operations API is defined in a separate swagger spec for Microsoft.Insights namespace (https://github.com/Azure/azure-rest-api-specs/blob/master/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/operations_API.json)' + - suppress: OperationsAPIImplementation + where: $.paths + from: scheduledQueryRule_API.json + reason: 'Operations API is defined in a separate swagger spec for Microsoft.Insights namespace (https://github.com/Azure/azure-rest-api-specs/blob/master/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/operations_API.json)' - suppress: EnumInsteadOfBoolean where: $.definitions.AlertRuleProperties.properties.enabled from: activityLogAlerts_API.json @@ -757,10 +761,6 @@ directive: where: $.parameters transform: delete $["ResourceGroupNameParameter"] reason: ResourceGroupNameParameter is taken from v2/types.json -- from: scheduledQueryRule_API.json - where: $.parameters - transform: delete $["ResourceGroupNameParameter"] - reason: ResourceGroupNameParameter is taken from v2/types.json - from: autoscale_API.json where: $.parameters transform: delete $["ResourceGroupNameParameter"]