From 2e4c790d16eb6be9299db7a75798bca1697fd5e9 Mon Sep 17 00:00:00 2001 From: abversqr Date: Thu, 12 Apr 2018 16:43:32 +0530 Subject: [PATCH 01/14] Added GA API version for Scheduled Query Rule Added GA API version for Scheduled Query Rule --- .../createOrUpdateScheduledQueryRules.json | 142 ++++ .../examples/deleteScheduledQueryRules.json | 22 + .../examples/getScheduledQueryRules.json | 59 ++ .../examples/listScheduledQueryRules.json | 100 +++ .../2018-04-16/scheduledQueryRule_API.json | 794 ++++++++++++++++++ .../monitor/resource-manager/readme.md | 1 + 6 files changed, 1118 insertions(+) create mode 100644 specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json new file mode 100644 index 000000000000..865f464b8ed2 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json @@ -0,0 +1,142 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "Rac46PostSwapRG", + "ruleName": "logalertfoo", + "api-version": "2018-04-16", + "parameters": { + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L1", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus", + "queryType": "ResultCount" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + }, + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3, + "metricTrigger": { + "thresholdOperator": "GreaterThan", + "threshold": 5, + "metricTriggerType": "Consecutive", + "metricColumn": "ColumnName" + } + } + } + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L1", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus", + "queryType": "ResultCount" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + }, + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3, + "metricTrigger": { + "thresholdOperator": "GreaterThan", + "threshold": 5, + "metricTriggerType": "Consecutive", + "metricColumn": "ColumnName" + } + } + } + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L3", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "ResultCount", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3 + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json new file mode 100644 index 000000000000..6d6deb5e7d8a --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "Rac46PostSwapRG", + "ruleName": "logalertfoo", + "api-version": "2018-04-16" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "description": "Successful request to delete a log search rule" + } + }, + "204": { + "headers": {}, + "body": { + "description": "No Content. Resource not found" + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json new file mode 100644 index 000000000000..9166bd2e06b3 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "Rac46PostSwapRG", + "ruleName": "logalertfoo", + "api-version": "2018-04-16" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L1", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "ResultCount", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3 + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + } + + }, + "404": { + "headers": {}, + "body": { + "description": "Not Found. Log Search Rule does not exists" + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json new file mode 100644 index 000000000000..7b07c3f0ddba --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "subscriptionId": "14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", + "resourceGroupName": "gigtest", + "api-version": "2018-03-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "false", + "skuType": "L2", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "Number", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 2, + "metricTrigger": { + "thresholdOperator": "LessThan", + "threshold": 2, + "metricTriggerType": "Total", + "metricColumn": "user_Id" + } + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + }, + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L2", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "ResultCount", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3 + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + } + ] + } + } + } +} diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json new file mode 100644 index 000000000000..ee18be1174d1 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -0,0 +1,794 @@ +{ + "swagger": "2.0", + "info": { + "title": "Microsoft Insights API", + "version": "2018-04-16", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "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}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}": { + "put": { + "description": "Creates or updates an log search rule.\r\nRequest method: PUT\t\tRequest URI: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/scheduledQueryRules/{logsearch-rule-name}?api-version={api-version}", + "tags": [ + "scheduledQueryRules" + ], + "operationId": "createOrUpdateScheduledQueryRules", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/LogSearchRuleResource" + }, + "description": "The parameters of the rule to create or update." + } + ], + "responses": { + "200": { + "description": "Successful request to update an Log Search rule", + "schema": { + "$ref": "#/definitions/LogSearchRuleResource" + }, + "examples": { + "application/json": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L1", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus", + "queryType": "ResultCount" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + }, + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3, + "metricTrigger": { + "thresholdOperator": "GreaterThan", + "threshold": 5, + "metricTriggerType": "Consecutive", + "metricColumn": "ColumnName" + } + } + } + } + } + } + }, + "201": { + "description": "Created alert rule", + "schema": { + "$ref": "#/definitions/LogSearchRuleResource" + }, + "examples": { + "application/json": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L3", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "ResultCount", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3 + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + } + } + } + } + }, + "get": { + "description": "Gets an Log Search rule", + "tags": [ + "scheduledQueryRules" + ], + "operationId": "getScheduledQueryRule", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Successful request to get a Log Search rule", + "schema": { + "$ref": "#/definitions/LogSearchRuleResource" + }, + "examples": { + "application/json": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L1", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "ResultCount", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3 + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + } + } + }, + "404": { + "description": "Not Found. Log Search Rule does not exists" + } + } + }, + "delete": { + "description": "Deletes a Log Search rule", + "tags": [ + "scheduledQueryRules" + ], + "operationId": "deleteScheduledQueryRules", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Successful request to delete a Log Search rule" + }, + "204": { + "description": "No Content. Resource not found" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules": { + "get": { + "tags": [ + "scheduledQueryRules" + ], + "operationId": "getListScheduledQueryRules", + "description": "List the Log Search rules within a resource group.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilterParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of alert rules", + "schema": { + "$ref": "#/definitions/LogSearchRuleResourceCollection" + }, + "examples": { + "application/json": { + "value": [ + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "false", + "skuType": "L2", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "Number", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 2, + "metricTrigger": { + "thresholdOperator": "LessThan", + "threshold": 2, + "metricTriggerType": "Total", + "metricColumn": "user_Id" + } + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + }, + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L2", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "ResultCount", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3 + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + } + ] + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-odata": "#/definitions/LogSearchRuleResource" + } + } + }, + "definitions": { + "Resource": { + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "name": { + "type": "string", + "description": "Azure resource name" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "location": { + "type": "string", + "description": "Resource location" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "required": [ + "location" + ], + "x-ms-azure-resource": true, + "description": "An azure resource object" + }, + "LogSearchRuleResource": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "properties" + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/LogSearchRule", + "description": "The rule properties of the resource." + } + }, + "description": "The Log Search Rule resource." + }, + "LogSearchRuleResourceCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/LogSearchRuleResource" + }, + "description": "The values for the Log Search Rule resources." + } + }, + "description": "Represents a collection of Log Search rule resources." + }, + "Source": { + "type": "object", + "description": "Specifies the log search query.", + "properties": { + "query": { + "type": "string", + "description": "Log search query." + }, + "authorizedResources": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of Resource referred into query" + }, + "datasourceId": { + "type": "string", + "description": "The resource uri over which log search query is to be run." + }, + "queryType": { + "$ref": "#/definitions/QueryType", + "description": "Set value to ResultCount if query should be returning search result count. Set it to Number if its a metric query." + } + }, + "required": [ + "query", + "datasourceId" + ] + }, + "Schedule": { + "type": "object", + "description": "Defines how often to run the search and the time interval.", + "properties": { + "frequencyInMinutes": { + "type": "integer", + "format": "int32", + "description": "frequency (in minutes) at which rule condition should be evaluated." + }, + "timeWindowInMinutes": { + "type": "integer", + "format": "int32", + "description": "Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes)." + } + }, + "required": [ + "frequencyInMinutes", + "timeWindowInMinutes" + ] + }, + "TriggerCondition": { + "description": "The condition that results in the Log Search rule.", + "properties": { + "thresholdOperator": { + "$ref": "#/definitions/ConditionalOperator", + "description": "Evaluation operation for rule - 'GreaterThan' or 'LessThan." + }, + "threshold": { + "description": "Result or count threshold based on which rule should be triggered.", + "format": "double", + "type": "number" + }, + "metricTrigger": { + "$ref": "#/definitions/MetricTrigger", + "description": "Trigger condition for metric query rule" + } + }, + "required": [ + "thresholdOperator", + "threshold" + ], + "type": "object" + }, + "AzNsActionGroup": { + "type": "object", + "properties": { + "actionGroup": { + "type": "array", + "description": "azns notification group reference.", + "items": { + "type": "string" + } + }, + "emailSubject": { + "type": "string", + "description": "Custom subject for Azns email" + }, + "customWebhookPayload": { + "type": "string", + "description": "Custom webhook payload to be send to azns action group" + } + }, + "description": "azns notification group" + }, + "MetricTrigger": { + "type": "object", + "properties": { + "thresholdOperator": { + "$ref": "#/definitions/ConditionalOperator", + "description": "Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'." + }, + "threshold": { + "format": "double", + "type": "number" + }, + "metricTriggerType": { + "$ref": "#/definitions/MetricTriggerType", + "description": "Metric Trigger Type - 'Consecutive' or 'Total'" + }, + "metricColumn": { + "type": "string", + "description": "Evaluation of metric on a particular column" + } + } + }, + "ConditionalOperator": { + "type": "string", + "enum": [ + "GreaterThan", + "LessThan", + "Equal" + ], + "x-ms-enum": { + "name": "ConditionalOperator", + "modelAsString": true + } + }, + "MetricTriggerType": { + "type": "string", + "enum": [ + "Consecutive", + "Total" + ], + "x-ms-enum": { + "name": "metricTriggerType", + "modelAsString": true + } + }, + "AlertSeverity": { + "type": "string", + "enum": [ + "1", + "2", + "3", + "4" + ], + "x-ms-enum": { + "name": "AlertSeverity", + "modelAsString": true + } + }, + "AlertStatus": { + "type": "string", + "enum": [ + "Active", + "Inactive" + ], + "x-ms-enum": { + "name": "AlertStatus", + "modelAsString": true + } + }, + "QueryType": { + "type": "string", + "enum": [ + "ResultCount", + "Number" + ], + "x-ms-enum": { + "name": "QueryType", + "modelAsString": true + } + }, + "LogSearchRule": { + "properties": { + "description": { + "type": "string", + "description": "The description of the Log Search rule." + }, + "Enabled": { + "type": "string", + "description": "The flag which indicates whether the Log Search rule is enabled. Value should be true or false", + "enum": [ + "true", + "false" + ], + "x-ms-enum": { + "name": "Enabled", + "modelAsString": true + } + }, + "skuType": { + "type": "string", + "enum": [ + "L1", + "L2", + "L3" + ], + "x-ms-enum": { + "name": "skuType", + "modelAsString": true + }, + "description": "SKU Type {L1, L2, L3}" + }, + "lastUpdatedTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "Last time the rule was updated in IS08601 format." + }, + "provisioningState": { + "readOnly": true, + "type": "string", + "description": "Provisioning state of the scheduledquery rule" + }, + "source": { + "$ref": "#/definitions/Source" + }, + "schedule": { + "$ref": "#/definitions/Schedule" + }, + "action": { + "$ref": "#/definitions/Action" + } + }, + "required": [ + "schedule", + "source", + "action" + ] + }, + "Action": { + "type": "object", + "discriminator": "odata.type", + "properties": { + "odata.type": { + "type": "string", + "description": "Specifies the alerting action. This is can be either be AlertingAction or LogToMetricAction" + } + }, + "required": [ + "odata.type" + ] + }, + "AlertingAction": { + "x-ms-discriminator-value": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Action" + } + ], + "properties": { + "lastFiredTime": { + "readOnly": true, + "type": "string", + "format": "date=time", + "description": "Last time the rule was fired in IS08601 format." + }, + "severity": { + "$ref": "#/definitions/AlertSeverity", + "description": "Severity of the alert" + }, + "status": { + "$ref": "#/definitions/AlertStatus", + "readOnly": true, + "description": "Alert state" + }, + "aznsAction": { + "$ref": "#/definitions/AzNsActionGroup", + "description": "azns notification group reference." + }, + "throttleTillDate": { + "type": "string", + "format": "date-time", + "description": "Time untill alert should not be fired in ISO8601 format." + }, + "trigger": { + "$ref": "#/definitions/TriggerCondition", + "description": "The trigger condition that results in the alert rule being." + } + }, + "required": [ + "aznsAction", + "trigger" + ] + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription Id." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "RuleNameParameter": { + "name": "ruleName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the rule.", + "x-ms-parameter-location": "method" + }, + "FilterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "description": "The filter to apply on the operation. For more information please see https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx", + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 4e7602b9fb14..4edfbcdae7be 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -54,6 +54,7 @@ input-file: - microsoft.insights/preview/2017-11-01-preview/baseline_API.json - microsoft.insights/preview/2017-11-01-preview/calculateBaseline_API.json - microsoft.insights/stable/2018-03-01/metricAlert_API.json +- microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json ``` From d183bad923d3a0a4092d21203f850db6cde9f4e9 Mon Sep 17 00:00:00 2001 From: abversqr Date: Tue, 17 Apr 2018 23:16:01 +0530 Subject: [PATCH 02/14] Resolving Comments Resolving Comments --- .../2018-04-16/scheduledQueryRule_API.json | 212 ++++++++++++++---- 1 file changed, 172 insertions(+), 40 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index ee18be1174d1..8af5de4b8e86 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -3,9 +3,6 @@ "info": { "title": "Microsoft Insights API", "version": "2018-04-16", - "x-ms-code-generation-settings": { - "name": "MonitorManagementClient" - }, "description": "Azure Monitor client to create/update/delete Scheduled Query Rules" }, "host": "management.azure.com", @@ -39,11 +36,11 @@ "paths": { "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}": { "put": { - "description": "Creates or updates an log search rule.\r\nRequest method: PUT\t\tRequest URI: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/scheduledQueryRules/{logsearch-rule-name}?api-version={api-version}", + "description": "Creates or updates an log search rule.", "tags": [ "scheduledQueryRules" ], - "operationId": "createOrUpdateScheduledQueryRules", + "operationId": "ScheduledQueryRules_CreateOrUpdate", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" @@ -168,6 +165,9 @@ } } } + }, + "x-ms-examples": { + "Create or Update rule": { "$ref": "./examples/createOrUpdateScheduledQueryRules.json" } } }, "get": { @@ -175,7 +175,7 @@ "tags": [ "scheduledQueryRules" ], - "operationId": "getScheduledQueryRule", + "operationId": "ScheduledQueryRules_Get", "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" @@ -241,6 +241,9 @@ "404": { "description": "Not Found. Log Search Rule does not exists" } + }, + "x-ms-examples": { + "Get rule": { "$ref": "./examples/getScheduledQueryRules.json" } } }, "delete": { @@ -248,7 +251,7 @@ "tags": [ "scheduledQueryRules" ], - "operationId": "deleteScheduledQueryRules", + "operationId": "ScheduledQueryRules_Delete", "parameters": [ { "$ref": "#/parameters/ResourceGroupNameParameter" @@ -270,15 +273,143 @@ "204": { "description": "No Content. Resource not found" } + }, + "x-ms-examples": { + "Delete rule": { "$ref": "./examples/deleteScheduledQueryRules.json" } } } }, + "/subscriptions/{subscriptionId}/providers/microsoft.insights/scheduledQueryRules": { + "get": { + "tags": [ + "scheduledQueryRules" + ], + "operationId": "ScheduledQueryRules_ListBySubscription", + "description": "List the Log Search rules within a subscription group.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilterParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of alert rules", + "schema": { + "$ref": "#/definitions/LogSearchRuleResourceCollection" + }, + "examples": { + "application/json": { + "value": [ + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "false", + "skuType": "L2", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "Number", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 2, + "metricTrigger": { + "thresholdOperator": "LessThan", + "threshold": 2, + "metricTriggerType": "Total", + "metricColumn": "user_Id" + } + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + }, + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + }, + "properties": { + "description": "log alert description", + "Enabled": "true", + "skuType": "L2", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "Type=HearBeat", + "queryType": "ResultCount", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "status": "Inactive", + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3 + }, + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + } + } + } + } + ] + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "List rules": { "$ref": "./examples/listScheduledQueryRules.json" } + }, + "x-ms-odata": "#/definitions/LogSearchRuleResource" + } + }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules": { "get": { "tags": [ "scheduledQueryRules" ], - "operationId": "getListScheduledQueryRules", + "operationId": "ScheduledQueryRules_ListByResourceGroup", "description": "List the Log Search rules within a resource group.", "parameters": [ { @@ -395,6 +526,9 @@ "x-ms-pageable": { "nextLinkName": null }, + "x-ms-examples": { + "List rules": { "$ref": "./examples/listScheduledQueryRules.json" } + }, "x-ms-odata": "#/definitions/LogSearchRuleResource" } } @@ -409,6 +543,7 @@ }, "name": { "type": "string", + "readOnly": true, "description": "Azure resource name" }, "type": { @@ -588,7 +723,8 @@ "x-ms-enum": { "name": "ConditionalOperator", "modelAsString": true - } + }, + "description": "Result Condition Evaluation criteria. Supported Values - 'GreaterThan' or 'LessThan' or 'Equal'." }, "MetricTriggerType": { "type": "string", @@ -599,11 +735,13 @@ "x-ms-enum": { "name": "metricTriggerType", "modelAsString": true - } + }, + "description": "Metric Trigger Evaluation Type" }, "AlertSeverity": { "type": "string", "enum": [ + "0", "1", "2", "3", @@ -612,31 +750,22 @@ "x-ms-enum": { "name": "AlertSeverity", "modelAsString": true - } - }, - "AlertStatus": { - "type": "string", - "enum": [ - "Active", - "Inactive" - ], - "x-ms-enum": { - "name": "AlertStatus", - "modelAsString": true - } + }, + "description" : "Severity Level of Alert" }, "QueryType": { "type": "string", "enum": [ - "ResultCount", - "Number" + "ResultCount" ], "x-ms-enum": { "name": "QueryType", "modelAsString": true - } + }, + "description" : "Output of query to be used" }, "LogSearchRule": { + "description" : "Log Search Rule Definition", "properties": { "description": { "type": "string", @@ -676,16 +805,29 @@ "provisioningState": { "readOnly": true, "type": "string", + "enum": [ + "Succeeded", + "Deploying", + "Canceled", + "Failed" + ], + "x-ms-enum": { + "name": "provisioningState", + "modelAsString": true + }, "description": "Provisioning state of the scheduledquery rule" }, "source": { - "$ref": "#/definitions/Source" + "$ref": "#/definitions/Source", + "description": "Data Source against which rule will Query Data" }, "schedule": { - "$ref": "#/definitions/Schedule" + "$ref": "#/definitions/Schedule", + "description": "Schedule (Frequnecy, Time Window) for rule." }, "action": { - "$ref": "#/definitions/Action" + "$ref": "#/definitions/Action", + "description": "Action needs to be taken on rule execution." } }, "required": [ @@ -700,7 +842,7 @@ "properties": { "odata.type": { "type": "string", - "description": "Specifies the alerting action. This is can be either be AlertingAction or LogToMetricAction" + "description": "Specifies the action. Only supported value - AlertingAction " } }, "required": [ @@ -708,6 +850,7 @@ ] }, "AlertingAction": { + "description" : "Specifiy action need to be taken when rule type is Alert", "x-ms-discriminator-value": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "type": "object", "allOf": [ @@ -716,21 +859,10 @@ } ], "properties": { - "lastFiredTime": { - "readOnly": true, - "type": "string", - "format": "date=time", - "description": "Last time the rule was fired in IS08601 format." - }, "severity": { "$ref": "#/definitions/AlertSeverity", "description": "Severity of the alert" }, - "status": { - "$ref": "#/definitions/AlertStatus", - "readOnly": true, - "description": "Alert state" - }, "aznsAction": { "$ref": "#/definitions/AzNsActionGroup", "description": "azns notification group reference." From df40ac3bbf17ea0180dd4adff2af3094065feca0 Mon Sep 17 00:00:00 2001 From: abversqr Date: Wed, 18 Apr 2018 23:43:25 +0530 Subject: [PATCH 03/14] Made SKU as top level proprty and including generic error response format Couple of changes - 1. Made SKU as top level proprty as mentioned here - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md#put-resource 2. including generic error response format --- .../createOrUpdateScheduledQueryRules.json | 8 +- .../examples/getScheduledQueryRules.json | 11 +-- .../examples/listScheduledQueryRules.json | 12 ++- .../2018-04-16/scheduledQueryRule_API.json | 74 +++++++++++++------ 4 files changed, 70 insertions(+), 35 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json index 865f464b8ed2..29cdb671be71 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json @@ -61,7 +61,6 @@ "properties": { "description": "log alert description", "Enabled": "true", - "skuType": "L1", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -93,6 +92,9 @@ } } } + }, + "sku": { + "name": "L1" } } }, @@ -109,7 +111,6 @@ "properties": { "description": "log alert description", "Enabled": "true", - "skuType": "L3", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -135,6 +136,9 @@ "customWebhookPayload": "{}" } } + }, + "sku": { + "name": "L3" } } } diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json index 9166bd2e06b3..d0d66444eb9f 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json @@ -19,7 +19,6 @@ "properties": { "description": "log alert description", "Enabled": "true", - "skuType": "L1", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -45,15 +44,11 @@ "customWebhookPayload": "{}" } } + }, + "sku": { + "name": "L3" } } - - }, - "404": { - "headers": {}, - "body": { - "description": "Not Found. Log Search Rule does not exists" - } } } } \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json index 7b07c3f0ddba..69278015ae0b 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json @@ -20,7 +20,6 @@ "properties": { "description": "log alert description", "Enabled": "false", - "skuType": "L2", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -52,6 +51,9 @@ "customWebhookPayload": "{}" } } + }, + "sku": { + "name": "L3" } }, { @@ -65,7 +67,6 @@ "properties": { "description": "log alert description", "Enabled": "true", - "skuType": "L2", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -74,8 +75,8 @@ "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" }, "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 + "frequencyInMinutes": 10, + "timeWindowInMinutes": 30 }, "action": { "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", @@ -91,6 +92,9 @@ "customWebhookPayload": "{}" } } + }, + "sku": { + "name": "L2" } } ] diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index 8af5de4b8e86..3b6433f7c40c 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -65,6 +65,12 @@ } ], "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, "200": { "description": "Successful request to update an Log Search rule", "schema": { @@ -191,6 +197,12 @@ } ], "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, "200": { "description": "Successful request to get a Log Search rule", "schema": { @@ -237,9 +249,6 @@ } } } - }, - "404": { - "description": "Not Found. Log Search Rule does not exists" } }, "x-ms-examples": { @@ -583,6 +592,10 @@ "x-ms-client-flatten": true, "$ref": "#/definitions/LogSearchRule", "description": "The rule properties of the resource." + }, + "sku": { + "$ref": "#/definitions/Sku", + "description": "Sku of the Log Search Rule" } }, "description": "The Log Search Rule resource." @@ -736,7 +749,7 @@ "name": "metricTriggerType", "modelAsString": true }, - "description": "Metric Trigger Evaluation Type" + "description": "Metric Trigger Evaluation Type" }, "AlertSeverity": { "type": "string", @@ -751,7 +764,7 @@ "name": "AlertSeverity", "modelAsString": true }, - "description" : "Severity Level of Alert" + "description": "Severity Level of Alert" }, "QueryType": { "type": "string", @@ -762,10 +775,10 @@ "name": "QueryType", "modelAsString": true }, - "description" : "Output of query to be used" + "description": "Output of query to be used" }, "LogSearchRule": { - "description" : "Log Search Rule Definition", + "description": "Log Search Rule Definition", "properties": { "description": { "type": "string", @@ -783,19 +796,6 @@ "modelAsString": true } }, - "skuType": { - "type": "string", - "enum": [ - "L1", - "L2", - "L3" - ], - "x-ms-enum": { - "name": "skuType", - "modelAsString": true - }, - "description": "SKU Type {L1, L2, L3}" - }, "lastUpdatedTime": { "readOnly": true, "type": "string", @@ -850,7 +850,7 @@ ] }, "AlertingAction": { - "description" : "Specifiy action need to be taken when rule type is Alert", + "description": "Specifiy action need to be taken when rule type is Alert", "x-ms-discriminator-value": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "type": "object", "allOf": [ @@ -881,6 +881,38 @@ "aznsAction", "trigger" ] + }, + "Sku": { + "description": "SKU of rule", + "properties": { + "name": { + "description": "The name of the SKU (L1, L2, L3)", + "type": "string", + "enum": [ + "L1", + "L2", + "L3" + ], + "x-ms-enum": { + "name": "sku", + "modelAsString": true + } + } + } + }, + "ErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } } }, "parameters": { From 7578160670750a68d05f77ec8163b25bb72f391e Mon Sep 17 00:00:00 2001 From: abversqr Date: Mon, 23 Apr 2018 22:09:55 +0530 Subject: [PATCH 04/14] Minor Changes to align implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Removed SKU - Billing Model is still under discussion, hence need not to be exposed to customers. 2. Enabled field ichanged to align with camel case. 3. 'throttleTillDate' in properties.action changed to 'throttlingInMin' to denote correct meaning and it’s data type changed to number instead of date. 4. 'status' to be removed in properties.action from examples. 5. 'severity' made a required field in properties.action. 6. Removed Examples from original spec json --- .../createOrUpdateScheduledQueryRules.json | 15 +- .../examples/getScheduledQueryRules.json | 6 +- .../examples/listScheduledQueryRules.json | 12 +- .../2018-04-16/scheduledQueryRule_API.json | 348 +----------------- 4 files changed, 15 insertions(+), 366 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json index 29cdb671be71..22a1929b3dce 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json @@ -11,8 +11,7 @@ }, "properties": { "description": "log alert description", - "Enabled": "true", - "skuType": "L1", + "enabled": "true", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -27,7 +26,6 @@ "action": { "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "severity": "1", - "status": "Inactive", "aznsAction": { "actionGroup": [], "emailSubject": "Email Header", @@ -60,7 +58,7 @@ }, "properties": { "description": "log alert description", - "Enabled": "true", + "enabled": "true", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -75,7 +73,6 @@ "action": { "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "severity": "1", - "status": "Inactive", "aznsAction": { "actionGroup": [], "emailSubject": "Email Header", @@ -92,9 +89,6 @@ } } } - }, - "sku": { - "name": "L1" } } }, @@ -110,7 +104,7 @@ }, "properties": { "description": "log alert description", - "Enabled": "true", + "enabled": "true", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -136,9 +130,6 @@ "customWebhookPayload": "{}" } } - }, - "sku": { - "name": "L3" } } } diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json index d0d66444eb9f..c301c7dd582c 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json @@ -18,7 +18,7 @@ }, "properties": { "description": "log alert description", - "Enabled": "true", + "enabled": "true", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -33,7 +33,6 @@ "action": { "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "severity": "1", - "status": "Inactive", "trigger": { "thresholdOperator": "GreaterThan", "threshold": 3 @@ -44,9 +43,6 @@ "customWebhookPayload": "{}" } } - }, - "sku": { - "name": "L3" } } } diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json index 69278015ae0b..bc4340e2f628 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json @@ -19,7 +19,7 @@ }, "properties": { "description": "log alert description", - "Enabled": "false", + "enabled": "false", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -34,7 +34,6 @@ "action": { "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "severity": "1", - "status": "Inactive", "trigger": { "thresholdOperator": "GreaterThan", "threshold": 2, @@ -51,9 +50,6 @@ "customWebhookPayload": "{}" } } - }, - "sku": { - "name": "L3" } }, { @@ -66,7 +62,7 @@ }, "properties": { "description": "log alert description", - "Enabled": "true", + "enabled": "true", "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { @@ -81,7 +77,6 @@ "action": { "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "severity": "1", - "status": "Inactive", "trigger": { "thresholdOperator": "GreaterThan", "threshold": 3 @@ -92,9 +87,6 @@ "customWebhookPayload": "{}" } } - }, - "sku": { - "name": "L2" } } ] diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index 3b6433f7c40c..b3a17841200f 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -75,100 +75,12 @@ "description": "Successful request to update an Log Search rule", "schema": { "$ref": "#/definitions/LogSearchRuleResource" - }, - "examples": { - "application/json": { - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", - "name": "logalertfoo", - "type": "Microsoft.Insights/scheduledQueryRules", - "location": "West US", - "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" - }, - "properties": { - "description": "log alert description", - "Enabled": "true", - "skuType": "L1", - "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", - "provisioningState": "Succeeded", - "source": { - "query": "Type=HearBeat", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus", - "queryType": "ResultCount" - }, - "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 - }, - "action": { - "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - "severity": "1", - "status": "Inactive", - "aznsAction": { - "actionGroup": [], - "emailSubject": "Email Header", - "customWebhookPayload": "{}" - }, - "trigger": { - "thresholdOperator": "GreaterThan", - "threshold": 3, - "metricTrigger": { - "thresholdOperator": "GreaterThan", - "threshold": 5, - "metricTriggerType": "Consecutive", - "metricColumn": "ColumnName" - } - } - } - } - } } }, "201": { "description": "Created alert rule", "schema": { "$ref": "#/definitions/LogSearchRuleResource" - }, - "examples": { - "application/json": { - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", - "name": "logalertfoo", - "type": "Microsoft.Insights/scheduledQueryRules", - "location": "West US", - "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" - }, - "properties": { - "description": "log alert description", - "Enabled": "true", - "skuType": "L3", - "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", - "provisioningState": "Succeeded", - "source": { - "query": "Type=HearBeat", - "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" - }, - "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 - }, - "action": { - "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - "severity": "1", - "status": "Inactive", - "trigger": { - "thresholdOperator": "GreaterThan", - "threshold": 3 - }, - "aznsAction": { - "actionGroup": [], - "emailSubject": "Email Header", - "customWebhookPayload": "{}" - } - } - } - } } } }, @@ -207,47 +119,6 @@ "description": "Successful request to get a Log Search rule", "schema": { "$ref": "#/definitions/LogSearchRuleResource" - }, - "examples": { - "application/json": { - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", - "name": "logalertfoo", - "type": "Microsoft.Insights/scheduledQueryRules", - "location": "West US", - "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" - }, - "properties": { - "description": "log alert description", - "Enabled": "true", - "skuType": "L1", - "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", - "provisioningState": "Succeeded", - "source": { - "query": "Type=HearBeat", - "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" - }, - "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 - }, - "action": { - "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - "severity": "1", - "status": "Inactive", - "trigger": { - "thresholdOperator": "GreaterThan", - "threshold": 3 - }, - "aznsAction": { - "actionGroup": [], - "emailSubject": "Email Header", - "customWebhookPayload": "{}" - } - } - } - } } } }, @@ -311,96 +182,6 @@ "description": "Successful request for a list of alert rules", "schema": { "$ref": "#/definitions/LogSearchRuleResourceCollection" - }, - "examples": { - "application/json": { - "value": [ - { - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", - "name": "logalertfoo", - "type": "Microsoft.Insights/scheduledQueryRules", - "location": "West US", - "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" - }, - "properties": { - "description": "log alert description", - "Enabled": "false", - "skuType": "L2", - "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", - "provisioningState": "Succeeded", - "source": { - "query": "Type=HearBeat", - "queryType": "Number", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" - }, - "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 - }, - "action": { - "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - "severity": "1", - "status": "Inactive", - "trigger": { - "thresholdOperator": "GreaterThan", - "threshold": 2, - "metricTrigger": { - "thresholdOperator": "LessThan", - "threshold": 2, - "metricTriggerType": "Total", - "metricColumn": "user_Id" - } - }, - "aznsAction": { - "actionGroup": [], - "emailSubject": "Email Header", - "customWebhookPayload": "{}" - } - } - } - }, - { - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", - "name": "logalertfoo", - "type": "Microsoft.Insights/scheduledQueryRules", - "location": "West US", - "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" - }, - "properties": { - "description": "log alert description", - "Enabled": "true", - "skuType": "L2", - "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", - "provisioningState": "Succeeded", - "source": { - "query": "Type=HearBeat", - "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" - }, - "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 - }, - "action": { - "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - "severity": "1", - "status": "Inactive", - "trigger": { - "thresholdOperator": "GreaterThan", - "threshold": 3 - }, - "aznsAction": { - "actionGroup": [], - "emailSubject": "Email Header", - "customWebhookPayload": "{}" - } - } - } - } - ] - } } } }, @@ -439,96 +220,6 @@ "description": "Successful request for a list of alert rules", "schema": { "$ref": "#/definitions/LogSearchRuleResourceCollection" - }, - "examples": { - "application/json": { - "value": [ - { - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", - "name": "logalertfoo", - "type": "Microsoft.Insights/scheduledQueryRules", - "location": "West US", - "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" - }, - "properties": { - "description": "log alert description", - "Enabled": "false", - "skuType": "L2", - "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", - "provisioningState": "Succeeded", - "source": { - "query": "Type=HearBeat", - "queryType": "Number", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" - }, - "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 - }, - "action": { - "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - "severity": "1", - "status": "Inactive", - "trigger": { - "thresholdOperator": "GreaterThan", - "threshold": 2, - "metricTrigger": { - "thresholdOperator": "LessThan", - "threshold": 2, - "metricTriggerType": "Total", - "metricColumn": "user_Id" - } - }, - "aznsAction": { - "actionGroup": [], - "emailSubject": "Email Header", - "customWebhookPayload": "{}" - } - } - } - }, - { - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", - "name": "logalertfoo", - "type": "Microsoft.Insights/scheduledQueryRules", - "location": "West US", - "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" - }, - "properties": { - "description": "log alert description", - "Enabled": "true", - "skuType": "L2", - "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", - "provisioningState": "Succeeded", - "source": { - "query": "Type=HearBeat", - "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" - }, - "schedule": { - "frequencyInMinutes": 15, - "timeWindowInMinutes": 15 - }, - "action": { - "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", - "severity": "1", - "status": "Inactive", - "trigger": { - "thresholdOperator": "GreaterThan", - "threshold": 3 - }, - "aznsAction": { - "actionGroup": [], - "emailSubject": "Email Header", - "customWebhookPayload": "{}" - } - } - } - } - ] - } } } }, @@ -592,10 +283,6 @@ "x-ms-client-flatten": true, "$ref": "#/definitions/LogSearchRule", "description": "The rule properties of the resource." - }, - "sku": { - "$ref": "#/definitions/Sku", - "description": "Sku of the Log Search Rule" } }, "description": "The Log Search Rule resource." @@ -784,7 +471,7 @@ "type": "string", "description": "The description of the Log Search rule." }, - "Enabled": { + "enabled": { "type": "string", "description": "The flag which indicates whether the Log Search rule is enabled. Value should be true or false", "enum": [ @@ -792,7 +479,7 @@ "false" ], "x-ms-enum": { - "name": "Enabled", + "name": "enabled", "modelAsString": true } }, @@ -867,10 +554,10 @@ "$ref": "#/definitions/AzNsActionGroup", "description": "azns notification group reference." }, - "throttleTillDate": { - "type": "string", - "format": "date-time", - "description": "Time untill alert should not be fired in ISO8601 format." + "throttlingInMin": { + "type": "integer", + "format": "int32", + "description": "time (in minutes) for which Alerts should be throttled" }, "trigger": { "$ref": "#/definitions/TriggerCondition", @@ -879,28 +566,11 @@ }, "required": [ "aznsAction", - "trigger" + "trigger", + "severity" ] }, - "Sku": { - "description": "SKU of rule", - "properties": { - "name": { - "description": "The name of the SKU (L1, L2, L3)", - "type": "string", - "enum": [ - "L1", - "L2", - "L3" - ], - "x-ms-enum": { - "name": "sku", - "modelAsString": true - } - } - } - }, - "ErrorResponse": { + "ErrorResponse": { "description": "Describes the format of Error response.", "type": "object", "properties": { From c39fa0c7fc962b316716df3ce48933d3e5ef2340 Mon Sep 17 00:00:00 2001 From: abversqr Date: Mon, 23 Apr 2018 22:36:19 +0530 Subject: [PATCH 05/14] Updated Example to reflect AI instances in tags and 'dataSourceId" Updated Example to reflect AI instances in tags and 'dataSourceId" --- .../examples/createOrUpdateScheduledQueryRules.json | 13 ++++++------- .../2018-04-16/examples/getScheduledQueryRules.json | 4 ++-- .../examples/listScheduledQueryRules.json | 8 ++++---- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json index 22a1929b3dce..38992bbf28cf 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json @@ -7,7 +7,7 @@ "parameters": { "location": "West US", "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI": "Resource" }, "properties": { "description": "log alert description", @@ -16,7 +16,7 @@ "provisioningState": "Succeeded", "source": { "query": "Type=HearBeat", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", "queryType": "ResultCount" }, "schedule": { @@ -54,7 +54,7 @@ "type": "Microsoft.Insights/scheduledQueryRules", "location": "West US", "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI": "Resource" }, "properties": { "description": "log alert description", @@ -63,7 +63,7 @@ "provisioningState": "Succeeded", "source": { "query": "Type=HearBeat", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus", + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", "queryType": "ResultCount" }, "schedule": { @@ -100,7 +100,7 @@ "type": "Microsoft.Insights/scheduledQueryRules", "location": "West US", "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI": "Resource" }, "properties": { "description": "log alert description", @@ -110,7 +110,7 @@ "source": { "query": "Type=HearBeat", "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 15, @@ -119,7 +119,6 @@ "action": { "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "severity": "1", - "status": "Inactive", "trigger": { "thresholdOperator": "GreaterThan", "threshold": 3 diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json index c301c7dd582c..5e4dd71bff42 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json @@ -14,7 +14,7 @@ "type": "Microsoft.Insights/scheduledQueryRules", "location": "West US", "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo": "Resource" + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI": "Resource" }, "properties": { "description": "log alert description", @@ -24,7 +24,7 @@ "source": { "query": "Type=HearBeat", "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 15, diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json index bc4340e2f628..85da92d3b01e 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json @@ -15,7 +15,7 @@ "type": "Microsoft.Insights/scheduledQueryRules", "location": "West US", "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI": "Resource" }, "properties": { "description": "log alert description", @@ -25,7 +25,7 @@ "source": { "query": "Type=HearBeat", "queryType": "Number", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 15, @@ -58,7 +58,7 @@ "type": "Microsoft.Insights/scheduledQueryRules", "location": "West US", "tags": { - "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus": "Resource" + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI": "Resource" }, "properties": { "description": "log alert description", @@ -68,7 +68,7 @@ "source": { "query": "Type=HearBeat", "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/workspaces/servicedeskeus" + "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 10, From 5762ef5cc0be489330069cb5ad9a4a423d0dc2f6 Mon Sep 17 00:00:00 2001 From: abversqr Date: Mon, 23 Apr 2018 23:07:54 +0530 Subject: [PATCH 06/14] made 'tags' details more descriptive --- .../stable/2018-04-16/scheduledQueryRule_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index b3a17841200f..2937decdbc67 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -259,7 +259,7 @@ "additionalProperties": { "type": "string" }, - "description": "Resource tags" + "description": "Resource tags - Should be same as 'datasourceId'" } }, "required": [ From caabc1bdf96dd0e3a0229eea6d82dc603aa66da3 Mon Sep 17 00:00:00 2001 From: abversqr Date: Mon, 23 Apr 2018 23:36:23 +0530 Subject: [PATCH 07/14] Restore Tags Description Restore Tags Description --- .../stable/2018-04-16/scheduledQueryRule_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index 2937decdbc67..b3a17841200f 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -259,7 +259,7 @@ "additionalProperties": { "type": "string" }, - "description": "Resource tags - Should be same as 'datasourceId'" + "description": "Resource tags" } }, "required": [ From ef757865568f06153fe418688bf530ab335530a1 Mon Sep 17 00:00:00 2001 From: abversqr Date: Tue, 24 Apr 2018 22:53:16 +0530 Subject: [PATCH 08/14] Fixed Exmaple Validation Fixed errores reported by running command "oav validate-example" --- .../2018-04-16/examples/deleteScheduledQueryRules.json | 8 ++------ .../2018-04-16/examples/listScheduledQueryRules.json | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json index 6d6deb5e7d8a..f9fba36800dd 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/deleteScheduledQueryRules.json @@ -8,15 +8,11 @@ "responses": { "200": { "headers": {}, - "body": { - "description": "Successful request to delete a log search rule" - } + "body": null }, "204": { "headers": {}, - "body": { - "description": "No Content. Resource not found" - } + "body": null } } } \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json index 85da92d3b01e..647fd61de3fa 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json @@ -24,7 +24,7 @@ "provisioningState": "Succeeded", "source": { "query": "Type=HearBeat", - "queryType": "Number", + "queryType": "ResultCount", "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { From fb180fb311d73934d0f5150f72638cc3de155ea0 Mon Sep 17 00:00:00 2001 From: abversqr Date: Tue, 24 Apr 2018 23:18:32 +0530 Subject: [PATCH 09/14] Added Default Response payload in all APIs Changes - 1. Added Default Response payload in all APIs 2. Made azNs description more clear --- .../2018-04-16/scheduledQueryRule_API.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index b3a17841200f..48058876c014 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -147,6 +147,12 @@ } ], "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, "200": { "description": "Successful request to delete a Log Search rule" }, @@ -178,6 +184,12 @@ } ], "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, "200": { "description": "Successful request for a list of alert rules", "schema": { @@ -216,6 +228,12 @@ } ], "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, "200": { "description": "Successful request for a list of alert rules", "schema": { @@ -376,7 +394,7 @@ "properties": { "actionGroup": { "type": "array", - "description": "azns notification group reference.", + "description": "Azure Group reference.", "items": { "type": "string" } From 6fb4ce9a1deac0f0c42a0ba53c4918e0e3cc3885 Mon Sep 17 00:00:00 2001 From: abversqr Date: Wed, 2 May 2018 12:13:18 +0530 Subject: [PATCH 10/14] Updating descriptions + property name change Updating descriptions + property name change --- .../createOrUpdateScheduledQueryRules.json | 12 ++++++------ .../examples/getScheduledQueryRules.json | 4 ++-- .../examples/listScheduledQueryRules.json | 8 ++++---- .../2018-04-16/scheduledQueryRule_API.json | 16 ++++++++-------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json index 38992bbf28cf..c22fd5e8c4aa 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/createOrUpdateScheduledQueryRules.json @@ -15,8 +15,8 @@ "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { - "query": "Type=HearBeat", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", + "query": "requests", + "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", "queryType": "ResultCount" }, "schedule": { @@ -62,8 +62,8 @@ "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { - "query": "Type=HearBeat", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", + "query": "requests", + "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", "queryType": "ResultCount" }, "schedule": { @@ -108,9 +108,9 @@ "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { - "query": "Type=HearBeat", + "query": "requests", "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" + "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 15, diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json index 5e4dd71bff42..d76619f03ad3 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/getScheduledQueryRules.json @@ -22,9 +22,9 @@ "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { - "query": "Type=HearBeat", + "query": "requests", "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" + "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 15, diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json index 647fd61de3fa..81c5d1757134 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/listScheduledQueryRules.json @@ -23,9 +23,9 @@ "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { - "query": "Type=HearBeat", + "query": "requests", "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" + "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 15, @@ -66,9 +66,9 @@ "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", "provisioningState": "Succeeded", "source": { - "query": "Type=HearBeat", + "query": "requests", "queryType": "ResultCount", - "datasourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" + "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI" }, "schedule": { "frequencyInMinutes": 10, diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index 48058876c014..61ac9ebaeb7c 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -332,7 +332,7 @@ }, "description": "List of Resource referred into query" }, - "datasourceId": { + "dataSourceId": { "type": "string", "description": "The resource uri over which log search query is to be run." }, @@ -343,7 +343,7 @@ }, "required": [ "query", - "datasourceId" + "dataSourceId" ] }, "Schedule": { @@ -394,21 +394,21 @@ "properties": { "actionGroup": { "type": "array", - "description": "Azure Group reference.", + "description": "Azure Action Group reference.", "items": { "type": "string" } }, "emailSubject": { "type": "string", - "description": "Custom subject for Azns email" + "description": "Custom subject override for all email ids in Azure action group" }, "customWebhookPayload": { "type": "string", - "description": "Custom webhook payload to be send to azns action group" + "description": "Custom payload to be sent for all webook URI in Azure action group" } }, - "description": "azns notification group" + "description": "Azure action group" }, "MetricTrigger": { "type": "object", @@ -570,12 +570,12 @@ }, "aznsAction": { "$ref": "#/definitions/AzNsActionGroup", - "description": "azns notification group reference." + "description": "Azure action group reference." }, "throttlingInMin": { "type": "integer", "format": "int32", - "description": "time (in minutes) for which Alerts should be throttled" + "description": "time (in minutes) for which Alerts should be throttled or suppressed." }, "trigger": { "$ref": "#/definitions/TriggerCondition", From de08b2e374570aa06e3573c4fed982d5954b5030 Mon Sep 17 00:00:00 2001 From: abversqr Date: Mon, 21 May 2018 22:53:20 +0530 Subject: [PATCH 11/14] Patch Support for SQR API --- .../examples/patchScheduledQueryRules.json | 61 +++++++++++++++ .../2018-04-16/scheduledQueryRule_API.json | 74 ++++++++++++++++++- 2 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/patchScheduledQueryRules.json diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/patchScheduledQueryRules.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/patchScheduledQueryRules.json new file mode 100644 index 000000000000..a7275bfcf41d --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/examples/patchScheduledQueryRules.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2018-04-16", + "subscriptionId": "subid", + "resourceGroupName": "my-resource-group", + "ruleName": "logalertfoo", + "parameters": { + "properties": { + "enabled": "true" + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/scheduledQueryRules/logalertfoo", + "name": "logalertfoo", + "type": "Microsoft.Insights/scheduledQueryRules", + "location": "West US", + "tags": { + "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI": "Resource" + }, + "properties": { + "description": "log alert description", + "enabled": "true", + "lastUpdatedTime": "2017-06-23T21:23:52.0221265Z", + "provisioningState": "Succeeded", + "source": { + "query": "requests", + "dataSourceId": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/components/sampleAI", + "queryType": "ResultCount" + }, + "schedule": { + "frequencyInMinutes": 15, + "timeWindowInMinutes": 15 + }, + "action": { + "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", + "severity": "1", + "aznsAction": { + "actionGroup": [], + "emailSubject": "Email Header", + "customWebhookPayload": "{}" + }, + "trigger": { + "thresholdOperator": "GreaterThan", + "threshold": 3, + "metricTrigger": { + "thresholdOperator": "GreaterThan", + "threshold": 5, + "metricTriggerType": "Consecutive", + "metricColumn": "ColumnName" + } + } + } + } + } + } + } +} diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index 61ac9ebaeb7c..95a9183fd193 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -126,6 +126,43 @@ "Get rule": { "$ref": "./examples/getScheduledQueryRules.json" } } }, + "patch": { + "tags": [ "scheduledQueryRules" ], + "description": "Update log search Rule.", + "operationId": "scheduledQueryRules_Update", + "parameters": [ + { "$ref": "#/parameters/SubscriptionIdParameter" }, + { "$ref": "#/parameters/ResourceGroupNameParameter" }, + { "$ref": "#/parameters/RuleNameParameter" }, + { "$ref": "#/parameters/ApiVersionParameter" }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/LogSearchRuleResourcePatch" + }, + "description": "The parameters of the rule to update." + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to update an Log Search rule", + "schema": { + "$ref": "#/definitions/LogSearchRuleResource" + } + } + }, + "x-ms-examples": { + "Patch Log Search Rule": { "$ref": "./examples/patchScheduledQueryRules.json" } + } + }, "delete": { "description": "Deletes a Log Search rule", "tags": [ @@ -305,6 +342,22 @@ }, "description": "The Log Search Rule resource." }, + "LogSearchRuleResourcePatch": { + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/LogSearchRulePatch", + "description": "The log search rule properties of the resource." + } + }, + "description": "The log search rule resource for patch operations." + }, "LogSearchRuleResourceCollection": { "properties": { "value": { @@ -338,7 +391,7 @@ }, "queryType": { "$ref": "#/definitions/QueryType", - "description": "Set value to ResultCount if query should be returning search result count. Set it to Number if its a metric query." + "description": "Set value to ResultCount if query should be returning search result count." } }, "required": [ @@ -541,6 +594,23 @@ "action" ] }, + "LogSearchRulePatch": { + "description": "Log Search Rule Definition for Patching", + "properties": { + "enabled": { + "type": "string", + "description": "The flag which indicates whether the Log Search rule is enabled. Value should be true or false", + "enum": [ + "true", + "false" + ], + "x-ms-enum": { + "name": "enabled", + "modelAsString": true + } + } + } + }, "Action": { "type": "object", "discriminator": "odata.type", @@ -588,7 +658,7 @@ "severity" ] }, - "ErrorResponse": { + "ErrorResponse": { "description": "Describes the format of Error response.", "type": "object", "properties": { From 0fa2c60b9a9e552cdcb523005b2136ae474a4d89 Mon Sep 17 00:00:00 2001 From: abversqr Date: Thu, 24 May 2018 13:42:56 +0530 Subject: [PATCH 12/14] Updated description for queryType Updated description for queryType --- .../stable/2018-04-16/scheduledQueryRule_API.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index 39e6ce47ee63..ae97756d55e1 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -391,7 +391,7 @@ }, "queryType": { "$ref": "#/definitions/QueryType", - "description": "Set value to ResultCount if query should be returning search result count." + "description": "Set value to 'ResultCount' ." } }, "required": [ @@ -713,4 +713,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} From 987328f4b83f05b39c1f10bf7277117fcbec2b63 Mon Sep 17 00:00:00 2001 From: abversqr Date: Thu, 24 May 2018 16:23:20 +0530 Subject: [PATCH 13/14] Update scheduledQueryRule_API.json --- .../stable/2018-04-16/scheduledQueryRule_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index ae97756d55e1..43685aac9663 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -533,7 +533,7 @@ "name": "QueryType", "modelAsString": true }, - "description": "Output of query to be used" + "description": "Set value to 'ResultAcount'" }, "LogSearchRule": { "description": "Log Search Rule Definition", From b37d3ace14508e3bc3f87ee29b7f2ad0b7025f67 Mon Sep 17 00:00:00 2001 From: abversqr Date: Tue, 5 Jun 2018 16:23:37 +0530 Subject: [PATCH 14/14] Resolving multiple model issue Changes - 1. Renamed "MetricTrigger" to "LogMetricTrigger" 2. Aligned "Resources" to other specs --- .../stable/2018-04-16/scheduledQueryRule_API.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json index 43685aac9663..b64239742df5 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2018-04-16/scheduledQueryRule_API.json @@ -289,7 +289,7 @@ } }, "definitions": { - "Resource": { + "Resource": { "properties": { "id": { "type": "string", @@ -308,7 +308,11 @@ }, "location": { "type": "string", - "description": "Resource location" + "description": "Resource location", + "x-ms-mutability": [ + "create", + "read" + ] }, "tags": { "additionalProperties": { @@ -432,7 +436,7 @@ "type": "number" }, "metricTrigger": { - "$ref": "#/definitions/MetricTrigger", + "$ref": "#/definitions/LogMetricTrigger", "description": "Trigger condition for metric query rule" } }, @@ -463,7 +467,7 @@ }, "description": "Azure action group" }, - "MetricTrigger": { + "LogMetricTrigger": { "type": "object", "properties": { "thresholdOperator": {