Smart Detector Alert Rules - Patch
Patch a specific Smart Detector alert rule.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{alertRuleName}?api-version=2019-06-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
alert
|
path | True |
string |
The name of the alert rule. |
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
path | True |
string |
The ID of the target subscription. |
api-version
|
query | True |
string |
Client Api Version. |
Request Body
Name | Type | Description |
---|---|---|
properties.actionGroups |
The alert rule actions. |
|
properties.description |
string |
The alert rule description. |
properties.frequency |
string |
The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes. |
properties.severity |
The alert rule severity. |
|
properties.state |
The alert rule state. |
|
properties.throttling |
The alert rule throttling information. |
|
tags |
object |
The resource tags. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Successful request to patch Smart Detector alert rule. |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Patch alert rules
Sample request
PATCH https://management.azure.com/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule?api-version=2019-06-01
{
"tags": {
"newKey": "newVal"
},
"properties": {
"description": "New description for patching",
"frequency": "PT1M"
}
}
Sample response
{
"id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule",
"type": "Microsoft.AlertsManagement/smartDetectorAlertRules",
"name": "MyAlertRule",
"location": "global",
"tags": {
"newKey": "newVal"
},
"properties": {
"description": "New description for patching",
"state": "Enabled",
"severity": "Sev3",
"frequency": "PT1M",
"detector": {
"id": "VMMemoryLeak"
},
"scope": [
"/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyVms/providers/Microsoft.Compute/virtualMachines/vm1"
],
"actionGroups": [
{
"actionGroupId": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/actionGroups/providers/microsoft.insights/actiongroups/MyActionGroup"
}
],
"throttling": {
"duration": "PT20M"
}
}
}
Definitions
Name | Description |
---|---|
Action |
The Action Groups information, used by the alert rule. |
Alert |
The alert rule information |
Alert |
The alert rule patch information |
Alert |
The alert rule state. |
Detector |
The detector information. By default this is not populated, unless it's specified in expandDetector |
Severity |
The alert rule severity. |
Smart |
Describe the format of an Error response. |
Throttling |
Optional throttling information for the alert rule. |
ActionGroupsInformation
The Action Groups information, used by the alert rule.
Name | Type | Description |
---|---|---|
customEmailSubject |
string |
An optional custom email subject to use in email notifications. |
customWebhookPayload |
string |
An optional custom web-hook payload to use in web-hook notifications. |
groupIds |
string[] |
The Action Group resource IDs. |
AlertRule
The alert rule information
Name | Type | Default value | Description |
---|---|---|---|
id |
string |
The resource ID. |
|
location |
string |
global |
The resource location. |
name |
string |
The resource name. |
|
properties.actionGroups |
The alert rule actions. |
||
properties.description |
string |
The alert rule description. |
|
properties.detector |
The alert rule's detector. |
||
properties.frequency |
string |
The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes. |
|
properties.scope |
string[] |
The alert rule resources scope. |
|
properties.severity |
The alert rule severity. |
||
properties.state |
The alert rule state. |
||
properties.throttling |
The alert rule throttling information. |
||
tags |
object |
The resource tags. |
|
type |
string |
The resource type. |
AlertRulePatchObject
The alert rule patch information
Name | Type | Description |
---|---|---|
id |
string |
The resource ID. |
name |
string |
The resource name. |
properties.actionGroups |
The alert rule actions. |
|
properties.description |
string |
The alert rule description. |
properties.frequency |
string |
The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes. |
properties.severity |
The alert rule severity. |
|
properties.state |
The alert rule state. |
|
properties.throttling |
The alert rule throttling information. |
|
tags |
object |
The resource tags. |
type |
string |
The resource type. |
AlertRuleState
The alert rule state.
Name | Type | Description |
---|---|---|
Disabled |
string |
|
Enabled |
string |
Detector
The detector information. By default this is not populated, unless it's specified in expandDetector
Name | Type | Description |
---|---|---|
description |
string |
The Smart Detector description. By default this is not populated, unless it's specified in expandDetector |
id |
string |
The detector id. |
imagePaths |
string[] |
The Smart Detector image path. By default this is not populated, unless it's specified in expandDetector |
name |
string |
The Smart Detector name. By default this is not populated, unless it's specified in expandDetector |
parameters |
object |
The detector's parameters.' |
supportedResourceTypes |
string[] |
The Smart Detector supported resource types. By default this is not populated, unless it's specified in expandDetector |
Severity
The alert rule severity.
Name | Type | Description |
---|---|---|
Sev0 |
string |
|
Sev1 |
string |
|
Sev2 |
string |
|
Sev3 |
string |
|
Sev4 |
string |
SmartDetectorErrorResponse
Describe the format of an Error response.
Name | Type | Description |
---|---|---|
code |
string |
Error code |
message |
string |
Error message indicating why the operation failed. |
ThrottlingInformation
Optional throttling information for the alert rule.
Name | Type | Description |
---|---|---|
duration |
string |
The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes |