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..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 @@ -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": [ @@ -252,7 +289,7 @@ } }, "definitions": { - "Resource": { + "Resource": { "properties": { "id": { "type": "string", @@ -271,7 +308,11 @@ }, "location": { "type": "string", - "description": "Resource location" + "description": "Resource location", + "x-ms-mutability": [ + "create", + "read" + ] }, "tags": { "additionalProperties": { @@ -305,6 +346,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 +395,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' ." } }, "required": [ @@ -379,7 +436,7 @@ "type": "number" }, "metricTrigger": { - "$ref": "#/definitions/MetricTrigger", + "$ref": "#/definitions/LogMetricTrigger", "description": "Trigger condition for metric query rule" } }, @@ -410,7 +467,7 @@ }, "description": "Azure action group" }, - "MetricTrigger": { + "LogMetricTrigger": { "type": "object", "properties": { "thresholdOperator": { @@ -480,7 +537,7 @@ "name": "QueryType", "modelAsString": true }, - "description": "Output of query to be used" + "description": "Set value to 'ResultAcount'" }, "LogSearchRule": { "description": "Log Search Rule Definition", @@ -541,6 +598,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 +662,7 @@ "severity" ] }, - "ErrorResponse": { + "ErrorResponse": { "description": "Describes the format of Error response.", "type": "object", "properties": { @@ -643,4 +717,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +}