From 72296e857cd32b321f0df07acb0e07d0ad59cb2e Mon Sep 17 00:00:00 2001 From: avjerafi <64891828+avjerafi@users.noreply.github.com> Date: Sun, 3 Jul 2022 11:33:15 +0300 Subject: [PATCH 01/12] Adds base for updating Microsoft.Insights from version stable/2021-08-01 to version 2022-06-15 --- .../createOrUpdateScheduledQueryRule.json | 200 ++++++ ...UpdateScheduledQueryRuleResourceGroup.json | 158 +++++ ...rUpdateScheduledQueryRuleSubscription.json | 209 ++++++ .../examples/deleteScheduledQueryRule.json | 12 + .../examples/getScheduledQueryRule.json | 76 ++ ...istScheduledQueryRulesByResourceGroup.json | 131 ++++ ...listScheduledQueryRulesBySubscription.json | 130 ++++ .../examples/patchScheduledQueryRule.json | 67 ++ .../2022-06-15/scheduledQueryRule_API.json | 671 ++++++++++++++++++ 9 files changed, 1654 insertions(+) create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json new file mode 100644 index 000000000000..b74a1be324dd --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json @@ -0,0 +1,200 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "resourceGroupName": "QueryResourceGroupName", + "ruleName": "perf", + "api-version": "2021-08-01", + "parameters": { + "location": "eastus", + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", + "name": "perf", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", + "name": "perf", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json new file mode 100644 index 000000000000..f760191d4535 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json @@ -0,0 +1,158 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "resourceGroupName": "QueryResourceGroupName", + "ruleName": "heartbeat", + "api-version": "2021-08-01", + "parameters": { + "location": "eastus", + "properties": { + "description": "Health check rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Heartbeat", + "timeAggregation": "Count", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 360, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat", + "name": "heartbeat", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Health check rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Heartbeat", + "timeAggregation": "Count", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 360, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat", + "name": "heartbeat", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Health check rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Heartbeat", + "timeAggregation": "Count", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 360, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json new file mode 100644 index 000000000000..bb82eda913f9 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json @@ -0,0 +1,209 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "resourceGroupName": "QueryResourceGroupName", + "ruleName": "perf", + "api-version": "2021-08-01", + "parameters": { + "location": "eastus", + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", + "name": "perf", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", + "name": "perf", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json new file mode 100644 index 000000000000..63f4e4698641 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "resourceGroupName": "QueryResourceGroupName", + "ruleName": "heartbeat", + "api-version": "2021-08-01" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json new file mode 100644 index 000000000000..a6dbc3ff9ca3 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "resourceGroupName": "QueryResourceGroupName", + "ruleName": "perf", + "api-version": "2021-08-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", + "name": "perf", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json new file mode 100644 index 000000000000..55f43ae296e1 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json @@ -0,0 +1,131 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "resourceGroupName": "QueryResourceGroupName", + "api-version": "2021-08-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", + "name": "perf", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + }, + { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat", + "name": "heartbeat", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Health check rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Heartbeat", + "timeAggregation": "Count", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 360, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + ] + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json new file mode 100644 index 000000000000..fe0395c9ed10 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json @@ -0,0 +1,130 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "api-version": "2021-08-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", + "name": "perf", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Performance rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Perf | where ObjectName == \"Processor\"", + "timeAggregation": "Average", + "metricMeasureColumn": "% Processor Time", + "resourceIdColumn": "resourceId", + "dimensions": [ + { + "name": "ComputerIp", + "operator": "Exclude", + "values": [ + "192.168.1.1" + ] + }, + { + "name": "OSType", + "operator": "Include", + "values": [ + "*" + ] + } + ], + "operator": "GreaterThan", + "threshold": 70, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + }, + { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/MyResourceGroupName2/providers/microsoft.insights/scheduledqueryrules/heartbeat", + "name": "heartbeat", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Health check rule", + "severity": 4, + "enabled": true, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Heartbeat", + "timeAggregation": "Count", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 360, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + ] + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json new file mode 100644 index 000000000000..a1cb704b6a4e --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json @@ -0,0 +1,67 @@ +{ + "parameters": { + "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", + "resourceGroupName": "QueryResourceGroupName", + "ruleName": "heartbeat", + "api-version": "2021-08-01", + "parameters": { + "properties": { + "enabled": false + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat", + "name": "heartbeat", + "type": "microsoft.insights/scheduledqueryrules", + "location": "eastus", + "tags": {}, + "properties": { + "description": "Health check rule", + "severity": 4, + "enabled": false, + "evaluationFrequency": "PT5M", + "scopes": [ + "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147" + ], + "targetResourceTypes": [ + "Microsoft.Compute/virtualMachines" + ], + "windowSize": "PT10M", + "criteria": { + "allOf": [ + { + "query": "Heartbeat", + "timeAggregation": "Count", + "dimensions": [], + "operator": "GreaterThan", + "threshold": 360, + "failingPeriods": { + "numberOfEvaluationPeriods": 1, + "minFailingPeriodsToAlert": 1 + } + } + ] + }, + "muteActionsDuration": "PT30M", + "actions": { + "actionGroups": [ + "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" + ], + "customProperties": { + "key11": "value11", + "key12": "value12" + } + }, + "autoMitigate": true, + "isWorkspaceAlertsStorageConfigured": true, + "checkWorkspaceAlertsStorageConfigured": true, + "skipQueryValidation": true + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json new file mode 100644 index 000000000000..523edc37c20a --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json @@ -0,0 +1,671 @@ +{ + "swagger": "2.0", + "info": { + "version": "2021-08-01", + "title": "Scheduled Query Rules API", + "description": "Azure Monitor client to create/update/delete Scheduled Query Rules." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules": { + "get": { + "tags": [ + "ScheduledQueryRules" + ], + "description": "Retrieve a scheduled query rule definitions in a subscription.", + "operationId": "ScheduledQueryRules_ListBySubscription", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of scheduled query rules", + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResourceCollection" + } + }, + "default": { + "description": "BadRequest", + "schema": { + "$ref": "#/definitions/ErrorContract" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List scheduled query rules by subscription": { + "$ref": "./examples/listScheduledQueryRulesBySubscription.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules": { + "get": { + "tags": [ + "ScheduledQueryRules" + ], + "description": "Retrieve scheduled query rule definitions in a resource group.", + "operationId": "ScheduledQueryRules_ListByResourceGroup", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of scheduled query rules", + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResourceCollection" + } + }, + "default": { + "description": "BadRequest", + "schema": { + "$ref": "#/definitions/ErrorContract" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List scheduled query rules by resource group": { + "$ref": "./examples/listScheduledQueryRulesByResourceGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}": { + "get": { + "tags": [ + "ScheduledQueryRules" + ], + "description": "Retrieve an scheduled query rule definition.", + "operationId": "ScheduledQueryRules_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request to get a scheduled query rule", + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResource" + } + }, + "default": { + "description": "BadRequest", + "schema": { + "$ref": "#/definitions/ErrorContract" + } + } + }, + "x-ms-examples": { + "Get a scheduled query rule for single resource": { + "$ref": "./examples/getScheduledQueryRule.json" + } + } + }, + "put": { + "tags": [ + "ScheduledQueryRules" + ], + "description": "Creates or updates a scheduled query rule.", + "operationId": "ScheduledQueryRules_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResource" + }, + "description": "The parameters of the rule to create or update." + } + ], + "responses": { + "200": { + "description": "Successful request to update a scheduled query rule", + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResource" + } + }, + "201": { + "description": "Created a scheduled query rule", + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorContract" + } + } + }, + "x-ms-examples": { + "Create or update a scheduled query rule for Single Resource": { + "$ref": "./examples/createOrUpdateScheduledQueryRule.json" + }, + "Create or update a scheduled query rule on Resource group(s)": { + "$ref": "./examples/createOrUpdateScheduledQueryRuleResourceGroup.json" + }, + "Create or update a scheduled query rule on Subscription ": { + "$ref": "./examples/createOrUpdateScheduledQueryRuleSubscription.json" + } + } + }, + "patch": { + "tags": [ + "ScheduledQueryRules" + ], + "description": "Update a scheduled query rule.", + "operationId": "ScheduledQueryRules_Update", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResourcePatch" + }, + "description": "The parameters of the rule to update." + } + ], + "responses": { + "200": { + "description": "Successful request to update a scheduled query rule", + "schema": { + "$ref": "#/definitions/ScheduledQueryRuleResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorContract" + } + } + }, + "x-ms-examples": { + "Create or update a scheduled query rule": { + "$ref": "./examples/patchScheduledQueryRule.json" + } + } + }, + "delete": { + "tags": [ + "ScheduledQueryRules" + ], + "description": "Deletes a scheduled query rule.", + "operationId": "ScheduledQueryRules_Delete", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorContract" + } + }, + "200": { + "description": "Successful request to delete a scheduled query rule" + }, + "204": { + "description": "No content: the request was successful, but the response is empty" + } + }, + "x-ms-examples": { + "Delete a scheduled query rule": { + "$ref": "./examples/deleteScheduledQueryRule.json" + } + } + } + } + }, + "definitions": { + "Actions": { + "type": "object", + "description": "Actions to invoke when the alert fires.", + "properties": { + "actionGroups": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Action Group resource Ids to invoke when the alert fires." + }, + "customProperties": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "The dictionary of custom properties to include with the post operation. These data are appended to the alert payload." + }, + "description": "The properties of an alert payload." + } + } + }, + "ScheduledQueryRuleProperties": { + "type": "object", + "properties": { + "createdWithApiVersion": { + "type": "string", + "readOnly": true, + "description": "The api-version used when creating this alert rule" + }, + "isLegacyLogAnalyticsRule": { + "type": "boolean", + "readOnly": true, + "description": "True if alert rule is legacy Log Analytic rule" + }, + "description": { + "type": "string", + "description": "The description of the scheduled query rule." + }, + "displayName": { + "type": "string", + "description": "The display name of the alert rule" + }, + "severity": { + "type": "integer", + "format": "int64", + "description": "Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ], + "x-ms-enum": { + "name": "AlertSeverity", + "modelAsString": true + } + }, + "enabled": { + "type": "boolean", + "description": "The flag which indicates whether this scheduled query rule is enabled. Value should be true or false" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of resource id's that this scheduled query rule is scoped to." + }, + "evaluationFrequency": { + "type": "string", + "format": "duration", + "description": "How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert." + }, + "windowSize": { + "type": "string", + "format": "duration", + "description": "The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert." + }, + "overrideQueryTimeRange": { + "type": "string", + "format": "duration", + "description": "If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert." + }, + "targetResourceTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert" + }, + "criteria": { + "$ref": "#/definitions/ScheduledQueryRuleCriteria", + "description": "The rule criteria that defines the conditions of the scheduled query rule." + }, + "muteActionsDuration": { + "type": "string", + "format": "duration", + "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": "object", + "$ref": "#/definitions/Actions", + "description": "Actions to invoke when the alert fires." + }, + "isWorkspaceAlertsStorageConfigured": { + "type": "boolean", + "readOnly": true, + "description": "The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false." + }, + "checkWorkspaceAlertsStorageConfigured": { + "type": "boolean", + "description": "The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert." + }, + "skipQueryValidation": { + "type": "boolean", + "description": "The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert." + }, + "autoMitigate": { + "type": "boolean", + "description": "The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert." + } + }, + "description": "scheduled query rule Definition" + }, + "ScheduledQueryRuleResource": { + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/TrackedResource" + } + ], + "required": [ + "properties" + ], + "properties": { + "kind": { + "type": "string", + "description": "Indicates the type of scheduled query rule. The default is LogAlert.", + "enum": [ + "LogAlert", + "LogToMetric" + ], + "x-ms-enum": { + "name": "Kind", + "modelAsString": true + } + }, + "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. " + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "description": "SystemData of ScheduledQueryRule.", + "readOnly": true + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ScheduledQueryRuleProperties", + "description": "The rule properties of the resource.", + "required": [ + "enabled", + "criteria", + "scopes" + ] + } + }, + "description": "The scheduled query rule resource." + }, + "ScheduledQueryRuleResourcePatch": { + "type": "object", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ScheduledQueryRuleProperties", + "description": "The scheduled query rule properties of the resource." + } + }, + "description": "The scheduled query rule resource for patch operations." + }, + "ScheduledQueryRuleResourceCollection": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ScheduledQueryRuleResource" + }, + "description": "The values for the scheduled query rule resources." + }, + "nextLink": { + "description": "Provides the link to retrieve the next set of elements.", + "type": "string", + "readOnly": true + } + }, + "description": "Represents a collection of scheduled query rule resources." + }, + "ScheduledQueryRuleCriteria": { + "type": "object", + "description": "The rule criteria that defines the conditions of the scheduled query rule.", + "properties": { + "allOf": { + "type": "array", + "description": "A list of conditions to evaluate against the specified scopes", + "items": { + "$ref": "#/definitions/Condition" + }, + "x-ms-identifiers": [] + } + } + }, + "Condition": { + "type": "object", + "description": "A condition of the scheduled query rule.", + "properties": { + "query": { + "type": "string", + "description": "Log query alert" + }, + "timeAggregation": { + "type": "string", + "description": "Aggregation type. Relevant and required only for rules of the kind LogAlert.", + "enum": [ + "Count", + "Average", + "Minimum", + "Maximum", + "Total" + ], + "x-ms-enum": { + "name": "timeAggregation", + "modelAsString": true + } + }, + "metricMeasureColumn": { + "type": "string", + "description": "The column containing the metric measure number. Relevant only for rules of the kind LogAlert." + }, + "resourceIdColumn": { + "type": "string", + "description": "The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert." + }, + "dimensions": { + "type": "array", + "items": { + "$ref": "#/definitions/Dimension" + }, + "description": "List of Dimensions conditions", + "x-ms-identifiers": [] + }, + "operator": { + "type": "string", + "enum": [ + "Equals", + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ], + "x-ms-enum": { + "name": "conditionOperator", + "modelAsString": true + }, + "description": "The criteria operator. Relevant and required only for rules of the kind LogAlert." + }, + "threshold": { + "type": "number", + "format": "double", + "description": "the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert." + }, + "failingPeriods": { + "type": "object", + "description": "The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.", + "properties": { + "numberOfEvaluationPeriods": { + "type": "integer", + "format": "int64", + "default": 1, + "description": "The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1" + }, + "minFailingPeriodsToAlert": { + "type": "integer", + "format": "int64", + "default": 1, + "description": "The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1" + } + } + }, + "metricName": { + "type": "string", + "description": "The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric." + } + } + }, + "Dimension": { + "type": "object", + "description": "Dimension splitting and filtering definition", + "properties": { + "name": { + "type": "string", + "description": "Name of the dimension" + }, + "operator": { + "type": "string", + "description": "Operator for dimension values", + "enum": [ + "Include", + "Exclude" + ], + "x-ms-enum": { + "name": "dimensionOperator", + "modelAsString": true + } + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of dimension values" + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "ErrorContract": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "error": { + "description": "The error details.", + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + } + } + }, + "parameters": { + "RuleNameParameter": { + "name": "ruleName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the rule.", + "x-ms-parameter-location": "method" + } + } +} From f575224a9dd0c66a939a2ddccc261b42ebfc2894 Mon Sep 17 00:00:00 2001 From: avjerafi <64891828+avjerafi@users.noreply.github.com> Date: Sun, 3 Jul 2022 11:33:18 +0300 Subject: [PATCH 02/12] Updates readme --- .../monitor/resource-manager/readme.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 14d8b23ec644..5985477f69ab 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -36,12 +36,20 @@ title: MonitorManagementClient description: Monitor Management Client openapi-type: arm tag: package-2022-06 - directive: - suppress: Example Validations - reason: There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off. + reason: 'There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off.' ``` + +### Tag: package-2022-06 + +These settings apply only when `--tag=package-2022-06` is specified on the command line. + +```yaml $(tag) == 'package-2022-06' +input-file: + - Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json +``` ### Tag: package-2022-06 These settings apply only when `--tag=package-2022-06` is specified on the command line @@ -284,7 +292,7 @@ input-file: These settings apply only when `--tag=package-2021-08` is specified on the command line. -```yaml $(tag) == 'package-2021-08' +``` yaml $(tag) == 'package-2021-08' input-file: - Microsoft.Insights/stable/2021-08-01/scheduledQueryRule_API.json ``` @@ -364,7 +372,7 @@ input-file: These settings apply only when `--tag=package-2021-05-only` is specified on the command line. -```yaml $(tag) == 'package-2021-05-only' +``` yaml $(tag) == 'package-2021-05-only' input-file: - Microsoft.Insights/stable/2021-05-01/metrics_API.json - Microsoft.Insights/stable/2021-05-01/metricDefinitions_API.json @@ -375,7 +383,7 @@ input-file: These settings apply only when `--tag=package-2021-05-01-preview-only` is specified on the command line. -```yaml $(tag) == 'package-2021-05-01-preview-only' +``` yaml $(tag) == 'package-2021-05-01-preview-only' input-file: - Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json - Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettings_API.json From 0e8fdf5337228c1f2b6dfbb12824aa0694c8e535 Mon Sep 17 00:00:00 2001 From: avjerafi <64891828+avjerafi@users.noreply.github.com> Date: Sun, 3 Jul 2022 11:33:20 +0300 Subject: [PATCH 03/12] Updates API version in new specs and examples --- .../2022-06-15/examples/createOrUpdateScheduledQueryRule.json | 2 +- .../examples/createOrUpdateScheduledQueryRuleResourceGroup.json | 2 +- .../examples/createOrUpdateScheduledQueryRuleSubscription.json | 2 +- .../stable/2022-06-15/examples/deleteScheduledQueryRule.json | 2 +- .../stable/2022-06-15/examples/getScheduledQueryRule.json | 2 +- .../examples/listScheduledQueryRulesByResourceGroup.json | 2 +- .../examples/listScheduledQueryRulesBySubscription.json | 2 +- .../stable/2022-06-15/examples/patchScheduledQueryRule.json | 2 +- .../stable/2022-06-15/scheduledQueryRule_API.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json index b74a1be324dd..5f020780c9fe 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRule.json @@ -3,7 +3,7 @@ "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", "resourceGroupName": "QueryResourceGroupName", "ruleName": "perf", - "api-version": "2021-08-01", + "api-version": "2022-06-15", "parameters": { "location": "eastus", "properties": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json index f760191d4535..de35838f0faf 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleResourceGroup.json @@ -3,7 +3,7 @@ "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", "resourceGroupName": "QueryResourceGroupName", "ruleName": "heartbeat", - "api-version": "2021-08-01", + "api-version": "2022-06-15", "parameters": { "location": "eastus", "properties": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json index bb82eda913f9..cb00daf794b2 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/createOrUpdateScheduledQueryRuleSubscription.json @@ -3,7 +3,7 @@ "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", "resourceGroupName": "QueryResourceGroupName", "ruleName": "perf", - "api-version": "2021-08-01", + "api-version": "2022-06-15", "parameters": { "location": "eastus", "properties": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json index 63f4e4698641..76cdb99e88e9 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/deleteScheduledQueryRule.json @@ -3,7 +3,7 @@ "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", "resourceGroupName": "QueryResourceGroupName", "ruleName": "heartbeat", - "api-version": "2021-08-01" + "api-version": "2022-06-15" }, "responses": { "200": {}, diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json index a6dbc3ff9ca3..b20f35b1d380 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/getScheduledQueryRule.json @@ -3,7 +3,7 @@ "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", "resourceGroupName": "QueryResourceGroupName", "ruleName": "perf", - "api-version": "2021-08-01" + "api-version": "2022-06-15" }, "responses": { "200": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json index 55f43ae296e1..5ed5c7021eaf 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesByResourceGroup.json @@ -2,7 +2,7 @@ "parameters": { "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", "resourceGroupName": "QueryResourceGroupName", - "api-version": "2021-08-01" + "api-version": "2022-06-15" }, "responses": { "200": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json index fe0395c9ed10..8be3290b3e7d 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/listScheduledQueryRulesBySubscription.json @@ -1,7 +1,7 @@ { "parameters": { "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", - "api-version": "2021-08-01" + "api-version": "2022-06-15" }, "responses": { "200": { diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json index a1cb704b6a4e..d4f21c74b367 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/patchScheduledQueryRule.json @@ -3,7 +3,7 @@ "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", "resourceGroupName": "QueryResourceGroupName", "ruleName": "heartbeat", - "api-version": "2021-08-01", + "api-version": "2022-06-15", "parameters": { "properties": { "enabled": false diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json index 523edc37c20a..311372f232ee 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2021-08-01", + "version": "2022-06-15", "title": "Scheduled Query Rules API", "description": "Azure Monitor client to create/update/delete Scheduled Query Rules." }, From 4905eaa82f789e409afcd7f51225f47a4a350bbf Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Sun, 3 Jul 2022 15:02:29 +0300 Subject: [PATCH 04/12] Fixed package tag naming conflict --- .../monitor/resource-manager/readme.md | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 5985477f69ab..57c435843dd2 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -35,20 +35,42 @@ title: MonitorManagementClient ``` yaml description: Monitor Management Client openapi-type: arm -tag: package-2022-06 +tag: package-2022-07 directive: - suppress: Example Validations reason: 'There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off.' ``` -### Tag: package-2022-06 +### Tag: package-2022-07 -These settings apply only when `--tag=package-2022-06` is specified on the command line. +These settings apply only when `--tag=package-2022-07` is specified on the command line. -```yaml $(tag) == 'package-2022-06' +```yaml $(tag) == 'package-2022-07' input-file: - - Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json +- Microsoft.Insights/stable/2015-04-01/autoscale_API.json +- Microsoft.Insights/stable/2015-04-01/operations_API.json +- Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json +- Microsoft.Insights/stable/2016-03-01/alertRules_API.json +- Microsoft.Insights/stable/2016-03-01/logProfiles_API.json +- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettings_API.json +- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettingsCategories_API.json +- Microsoft.Insights/stable/2022-06-01/actionGroups_API.json +- Microsoft.Insights/stable/2015-04-01/activityLogs_API.json +- Microsoft.Insights/stable/2015-04-01/eventCategories_API.json +- Microsoft.Insights/stable/2015-04-01/tenantActivityLogs_API.json +- Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json +- Microsoft.Insights/stable/2018-01-01/metrics_API.json +- Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json +- Microsoft.Insights/stable/2018-03-01/metricAlert_API.json +- Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json +- Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json +- Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json +- Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json +- Microsoft.Insights/stable/2020-10-01/activityLogAlerts_API.json +- Microsoft.Insights/preview/2021-09-01-preview/dataCollectionEndpoints_API.json +- Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRuleAssociations_API.json +- Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json ``` ### Tag: package-2022-06 From 9a1e2fee0ddb3fd7b3f9d2c9dd7c54b8522d166e Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Sun, 3 Jul 2022 16:12:28 +0300 Subject: [PATCH 05/12] Separated SQR into package-2022-06-15-only --- .../monitor/resource-manager/readme.md | 30 +++---------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 57c435843dd2..b138b9e9eb52 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -42,35 +42,13 @@ directive: ``` -### Tag: package-2022-07 +### Tag: package-2022-06-15-only -These settings apply only when `--tag=package-2022-07` is specified on the command line. +These settings apply only when `--tag=package-2022-06-15-only` is specified on the command line. -```yaml $(tag) == 'package-2022-07' +```yaml $(tag) == 'package-2022-06-15-only' input-file: -- Microsoft.Insights/stable/2015-04-01/autoscale_API.json -- Microsoft.Insights/stable/2015-04-01/operations_API.json -- Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json -- Microsoft.Insights/stable/2016-03-01/alertRules_API.json -- Microsoft.Insights/stable/2016-03-01/logProfiles_API.json -- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettings_API.json -- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettingsCategories_API.json -- Microsoft.Insights/stable/2022-06-01/actionGroups_API.json -- Microsoft.Insights/stable/2015-04-01/activityLogs_API.json -- Microsoft.Insights/stable/2015-04-01/eventCategories_API.json -- Microsoft.Insights/stable/2015-04-01/tenantActivityLogs_API.json -- Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json -- Microsoft.Insights/stable/2018-01-01/metrics_API.json -- Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json -- Microsoft.Insights/stable/2018-03-01/metricAlert_API.json -- Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json -- Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json -- Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json -- Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json -- Microsoft.Insights/stable/2020-10-01/activityLogAlerts_API.json -- Microsoft.Insights/preview/2021-09-01-preview/dataCollectionEndpoints_API.json -- Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRuleAssociations_API.json -- Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json + - Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json ``` ### Tag: package-2022-06 From cb63619e89e98d58b11cb5a79342fa5f0a060fe6 Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Wed, 6 Jul 2022 11:18:16 +0300 Subject: [PATCH 06/12] Fixed default package tag --- specification/monitor/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index b138b9e9eb52..d98b9638c5f0 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -35,7 +35,7 @@ title: MonitorManagementClient ``` yaml description: Monitor Management Client openapi-type: arm -tag: package-2022-07 +tag: package-2022-06 directive: - suppress: Example Validations reason: 'There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off.' From 1858929c2bf159967034211d3d287a2e4f2e173b Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Mon, 11 Jul 2022 20:25:27 +0300 Subject: [PATCH 07/12] Adding SQR 2022-06-15 version as part of package-2022-06 --- specification/monitor/resource-manager/readme.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index d98b9638c5f0..b67968f0a300 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -35,21 +35,12 @@ title: MonitorManagementClient ``` yaml description: Monitor Management Client openapi-type: arm -tag: package-2022-06 +tag: package-2022-06-15-only directive: - suppress: Example Validations reason: 'There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off.' ``` - -### Tag: package-2022-06-15-only - -These settings apply only when `--tag=package-2022-06-15-only` is specified on the command line. - -```yaml $(tag) == 'package-2022-06-15-only' -input-file: - - Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json -``` ### Tag: package-2022-06 These settings apply only when `--tag=package-2022-06` is specified on the command line @@ -71,7 +62,7 @@ input-file: - Microsoft.Insights/stable/2018-01-01/metrics_API.json - Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json - Microsoft.Insights/stable/2018-03-01/metricAlert_API.json -- Microsoft.Insights/stable/2018-04-16/scheduledQueryRule_API.json +- Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json - Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json - Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json - Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json From d58f80070f821c23c1d25776d2da3a05d0e89897 Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Wed, 13 Jul 2022 09:18:04 +0300 Subject: [PATCH 08/12] Fixed default tag to be package-2022-06 --- specification/monitor/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index b67968f0a300..4d5ab3fd9c2b 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -35,7 +35,7 @@ title: MonitorManagementClient ``` yaml description: Monitor Management Client openapi-type: arm -tag: package-2022-06-15-only +tag: package-2022-06 directive: - suppress: Example Validations reason: 'There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off.' From f3a1b8dc357ec2c041dc5826398c1da68a4615f7 Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Thu, 14 Jul 2022 09:46:09 +0300 Subject: [PATCH 09/12] Added lenient-model-deduplication flag --- specification/monitor/resource-manager/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 4d5ab3fd9c2b..9700cd8ee513 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -36,6 +36,8 @@ title: MonitorManagementClient description: Monitor Management Client openapi-type: arm tag: package-2022-06 +modelerfour: + lenient-model-deduplication: true directive: - suppress: Example Validations reason: 'There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off.' From e69386f0e1459bf23f06748362094426f62d4946 Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Thu, 14 Jul 2022 15:16:56 +0300 Subject: [PATCH 10/12] Replaced common-types references to Resource,ErrorResponse with local definitions with different name --- .../2022-06-15/scheduledQueryRule_API.json | 107 ++++++++++++++++-- 1 file changed, 99 insertions(+), 8 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json index 311372f232ee..3cbdee370d2d 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json @@ -436,15 +436,46 @@ }, "ScheduledQueryRuleResource": { "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/TrackedResource" - } - ], "required": [ - "properties" + "properties", + "location" ], "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the resource" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags." + }, + "location": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + }, "kind": { "type": "string", "description": "Indicates the type of scheduled query rule. The default is LogAlert.", @@ -478,7 +509,8 @@ ] } }, - "description": "The scheduled query rule resource." + "description": "The scheduled query rule resource.", + "x-ms-azure-resource": true }, "ScheduledQueryRuleResourcePatch": { "type": "object", @@ -653,9 +685,68 @@ "properties": { "error": { "description": "The error details.", - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseDetails" + } + } + }, + "ErrorResponseDetails": { + "title": "Error Response", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)", + "type": "object", + "properties": { + "code": { + "readOnly": true, + "type": "string", + "description": "The error code." + }, + "message": { + "readOnly": true, + "type": "string", + "description": "The error message." + }, + "target": { + "readOnly": true, + "type": "string", + "description": "The error target." + }, + "details": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResponseDetails" + }, + "x-ms-identifiers": [ + "message", + "target" + ], + "description": "The error details." + }, + "additionalInfo": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorAdditionalInfo" + }, + "x-ms-identifiers": [], + "description": "The error additional info." } } + }, + "ErrorAdditionalInfo": { + "type": "object", + "properties": { + "type": { + "readOnly": true, + "type": "string", + "description": "The additional info type." + }, + "info": { + "readOnly": true, + "type": "object", + "description": "The additional info." + } + }, + "description": "The resource management error additional info." } }, "parameters": { From 67aea81d96c9dccd5fac51e86077381ed984d360 Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Sat, 16 Jul 2022 09:41:12 +0300 Subject: [PATCH 11/12] Renamed ErrorAdditionalInfo to ErrorResponseAdditionalInfo to avoid conflicts --- .../stable/2022-06-15/scheduledQueryRule_API.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json index 3cbdee370d2d..6c86742fd754 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-15/scheduledQueryRule_API.json @@ -725,14 +725,14 @@ "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/ErrorAdditionalInfo" + "$ref": "#/definitions/ErrorResponseAdditionalInfo" }, "x-ms-identifiers": [], "description": "The error additional info." } } }, - "ErrorAdditionalInfo": { + "ErrorResponseAdditionalInfo": { "type": "object", "properties": { "type": { From 4385027afc609795083b43774154e6a3ade32e31 Mon Sep 17 00:00:00 2001 From: Avi Jerafi Date: Thu, 21 Jul 2022 08:39:22 +0300 Subject: [PATCH 12/12] Removed lenient-model-deduplication flag --- specification/monitor/resource-manager/readme.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 9700cd8ee513..4d5ab3fd9c2b 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -36,8 +36,6 @@ title: MonitorManagementClient description: Monitor Management Client openapi-type: arm tag: package-2022-06 -modelerfour: - lenient-model-deduplication: true directive: - suppress: Example Validations reason: 'There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off.'