Smart Detector Alert Rules - Get
获取特定的智能检测器警报规则。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{alertRuleName}?api-version=2019-06-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{alertRuleName}?api-version=2019-06-01&expandDetector={expandDetector}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
alert
|
path | True |
string |
警报规则的名称。 |
|
resource
|
path | True |
string |
资源组的名称。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string |
客户端 API 版本。 |
|
expand
|
query |
boolean |
指示是否应扩展智能检测器。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
成功请求以获取智能检测器警报规则。 |
|
| Other Status Codes |
描述操作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Get a Smart Detector alert rule
示例请求
GET https://management.azure.com/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule?api-version=2019-06-01
示例响应
{
"id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule",
"type": "Microsoft.AlertsManagement/smartDetectorAlertRules",
"name": "MyAlertRule",
"location": "global",
"tags": {},
"properties": {
"description": "Sample smart detector alert rule description",
"state": "Enabled",
"severity": "Sev3",
"frequency": "PT5M",
"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/MyActionGroups/providers/microsoft.insights/actionGroups/MyActionGroup"
}
],
"throttling": {
"duration": "PT20M"
}
}
}
定义
| 名称 | 说明 |
|---|---|
|
Action |
警报规则使用的“作组”信息。 |
|
Alert |
警报规则信息 |
|
Alert |
警报规则状态。 |
| Detector |
检测器信息。 默认情况下不会填充此项,除非它在 expandDetector 中指定 |
| Severity |
警报规则严重性。 |
|
Smart |
描述错误响应的格式。 |
|
Throttling |
警报规则的可选限制信息。 |
ActionGroupsInformation
警报规则使用的“作组”信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| customEmailSubject |
string |
在电子邮件通知中使用的可选自定义电子邮件主题。 |
| customWebhookPayload |
string |
用于 Web 挂钩通知的可选自定义 Web 挂钩有效负载。 |
| groupIds |
string[] |
操作组资源 ID。 |
AlertRule
警报规则信息
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| id |
string |
资源 ID。 |
|
| location |
string |
global |
资源位置。 |
| name |
string |
资源名称。 |
|
| properties.actionGroups |
警报规则操作。 |
||
| properties.description |
string |
警报规则说明。 |
|
| properties.detector |
警报规则的检测器。 |
||
| properties.frequency |
string (duration) |
ISO8601格式的警报规则频率。 时间粒度必须以分钟为单位,最小值为 5 分钟。 |
|
| properties.scope |
string[] |
警报规则资源范围。 |
|
| properties.severity |
警报规则严重性。 |
||
| properties.state |
警报规则状态。 |
||
| properties.throttling |
警报规则限制信息。 |
||
| tags |
object |
资源标记。 |
|
| type |
string |
资源类型。 |
AlertRuleState
警报规则状态。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
Detector
检测器信息。 默认情况下不会填充此项,除非它在 expandDetector 中指定
| 名称 | 类型 | 说明 |
|---|---|---|
| description |
string |
智能检测器说明。 默认情况下不会填充此项,除非它在 expandDetector 中指定 |
| id |
string |
检测器 ID。 |
| imagePaths |
string[] |
智能检测器图像路径。 默认情况下不会填充此项,除非它在 expandDetector 中指定 |
| name |
string |
智能检测器名称。 默认情况下不会填充此项,除非它在 expandDetector 中指定 |
| parameters |
object |
检测器的参数。 |
| supportedResourceTypes |
string[] |
智能检测器支持的资源类型。 默认情况下不会填充此项,除非它在 expandDetector 中指定 |
Severity
警报规则严重性。
| 值 | 说明 |
|---|---|
| Sev0 | |
| Sev1 | |
| Sev2 | |
| Sev3 | |
| Sev4 |
SmartDetectorErrorResponse
描述错误响应的格式。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码 |
| message |
string |
指示操作失败的原因的错误消息。 |
ThrottlingInformation
警报规则的可选限制信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| duration |
string (duration) |
在再次通知警报规则之前,需要等待的持续时间(ISO8601格式)。 时间粒度必须以分钟为单位,最小值为 0 分钟 |