你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Scheduled Query Rules - Create Or Update

创建或更新计划的查询规则。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}?api-version=2021-08-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 名称不区分大小写。

ruleName
path True

string

规则的名称。

subscriptionId
path True

string

minLength: 1

目标订阅的 ID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源所在的地理位置

properties.criteria True

ScheduledQueryRuleCriteria

定义计划查询规则条件的规则条件。

properties.enabled True

boolean

指示是否启用此计划查询规则的标志。 值应为 true 或 false

properties.scopes True

string[]

此计划查询规则的范围是资源 ID 的列表。

kind

Kind

指示计划查询规则的类型。 默认值为 LogAlert。

properties.actions

Actions

触发警报时要调用的操作。

properties.autoMitigate

boolean

指示是否应自动解决警报的标志。 默认值为 true。 仅适用于 LogAlert 类型的规则。

properties.checkWorkspaceAlertsStorageConfigured

boolean

指示此计划查询规则是否应存储在客户的存储中的标志。 默认值为 false。 仅适用于 LogAlert 类型的规则。

properties.description

string

计划查询规则的说明。

properties.displayName

string

警报规则的显示名称

properties.evaluationFrequency

string (duration)

以 ISO 8601 持续时间格式计算计划查询规则的频率。 仅针对 LogAlert 类型的规则相关且必需。

properties.muteActionsDuration

string (duration)

触发警报后,在所选时间段(采用 ISO 8601 持续时间格式)将操作静音。 仅适用于 LogAlert 类型的规则。

properties.overrideQueryTimeRange

string (duration)

如果指定,则覆盖查询时间范围(默认值为 WindowSize*NumberOfEvaluationPeriods)。 仅适用于 LogAlert 类型的规则。

properties.severity

AlertSeverity (int64)

警报的严重性。 应该是 [0-4] 之间的整数。 值 0 最严重。 仅针对 LogAlert 类型的规则相关且必需。

properties.skipQueryValidation

boolean

指示是否应验证提供的查询的标志。 默认值为 false。 仅适用于 LogAlert 类型的规则。

properties.targetResourceTypes

string[]

创建/更新警报的目标资源的资源类型的列表。 例如,如果范围是资源组,targetResourceTypes Microsoft.Compute/virtualMachines,则会针对资源组中满足警报条件的每个虚拟机触发不同的警报。 仅适用于 LogAlert 类型的规则

properties.windowSize

string (duration)

将在其中执行警报查询的时间段(采用 ISO 8601 持续时间格式)(箱大小)。 仅针对 LogAlert 类型的规则相关且必需。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

ScheduledQueryRuleResource

成功请求以更新计划的查询规则

201 Created

ScheduledQueryRuleResource

创建了计划的查询规则

Other Status Codes

ErrorContract

描述操作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create or update a scheduled query rule for Single Resource
Create or update a scheduled query rule on Resource group(s)
Create or update a scheduled query rule on Subscription

Create or update a scheduled query rule for Single Resource

示例请求

PUT https://management.azure.com/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourceGroups/QueryResourceGroupName/providers/Microsoft.Insights/scheduledQueryRules/perf?api-version=2021-08-01

{
  "location": "eastus",
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

示例响应

{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}
{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

Create or update a scheduled query rule on Resource group(s)

示例请求

PUT https://management.azure.com/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourceGroups/QueryResourceGroupName/providers/Microsoft.Insights/scheduledQueryRules/heartbeat?api-version=2021-08-01

{
  "location": "eastus",
  "properties": {
    "description": "Health check rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Heartbeat",
          "timeAggregation": "Count",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 360,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

示例响应

{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat",
  "name": "heartbeat",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Health check rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Heartbeat",
          "timeAggregation": "Count",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 360,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}
{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat",
  "name": "heartbeat",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Health check rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Heartbeat",
          "timeAggregation": "Count",
          "dimensions": [],
          "operator": "GreaterThan",
          "threshold": 360,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

Create or update a scheduled query rule on Subscription

示例请求

PUT https://management.azure.com/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourceGroups/QueryResourceGroupName/providers/Microsoft.Insights/scheduledQueryRules/perf?api-version=2021-08-01

{
  "location": "eastus",
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

示例响应

{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}
{
  "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf",
  "name": "perf",
  "type": "microsoft.insights/scheduledqueryrules",
  "location": "eastus",
  "tags": {},
  "properties": {
    "description": "Performance rule",
    "severity": 4,
    "enabled": true,
    "evaluationFrequency": "PT5M",
    "scopes": [
      "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"
    ],
    "targetResourceTypes": [
      "Microsoft.Compute/virtualMachines"
    ],
    "windowSize": "PT10M",
    "criteria": {
      "allOf": [
        {
          "query": "Perf | where ObjectName == \"Processor\"",
          "timeAggregation": "Average",
          "metricMeasureColumn": "% Processor Time",
          "resourceIdColumn": "resourceId",
          "dimensions": [
            {
              "name": "ComputerIp",
              "operator": "Exclude",
              "values": [
                "192.168.1.1"
              ]
            },
            {
              "name": "OSType",
              "operator": "Include",
              "values": [
                "*"
              ]
            }
          ],
          "operator": "GreaterThan",
          "threshold": 70,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          }
        }
      ]
    },
    "muteActionsDuration": "PT30M",
    "actions": {
      "actionGroups": [
        "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"
      ],
      "customProperties": {
        "key11": "value11",
        "key12": "value12"
      }
    },
    "autoMitigate": true,
    "isWorkspaceAlertsStorageConfigured": true,
    "checkWorkspaceAlertsStorageConfigured": true,
    "skipQueryValidation": true
  }
}

定义

名称 说明
Actions

触发警报时要调用的操作。

AlertSeverity

警报的严重性。 应该是 [0-4] 之间的整数。 值 0 最严重。 仅针对 LogAlert 类型的规则相关且必需。

Condition

计划查询规则的条件。

conditionOperator

条件运算符。 仅针对 LogAlert 类型的规则相关且必需。

createdByType

创建资源的标识的类型。

Dimension

维度拆分和筛选定义

dimensionOperator

维度值的运算符

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorContract

描述错误响应的格式。

ErrorResponse

错误响应

FailingPeriods

在引发警报所需的所选回溯时间范围内所需的最小冲突数。 仅适用于 LogAlert 类型的规则。

Kind

指示计划查询规则的类型。 默认值为 LogAlert。

ScheduledQueryRuleCriteria

定义计划查询规则条件的规则条件。

ScheduledQueryRuleResource

计划的查询规则资源。

systemData

与创建和上次修改资源相关的元数据。

timeAggregation

聚合类型。 仅针对 LogAlert 类型的规则相关且必需。

Actions

触发警报时要调用的操作。

名称 类型 说明
actionGroups

string[]

触发警报时要调用的操作组资源 ID。

customProperties

object

警报有效负载的属性。

AlertSeverity

警报的严重性。 应该是 [0-4] 之间的整数。 值 0 最严重。 仅针对 LogAlert 类型的规则相关且必需。

说明
0
1
2
3
4

Condition

计划查询规则的条件。

名称 类型 说明
dimensions

Dimension[]

维度条件列表

failingPeriods

FailingPeriods

在引发警报所需的所选回溯时间范围内所需的最小冲突数。 仅适用于 LogAlert 类型的规则。

metricMeasureColumn

string

包含指标度量值的列。 仅适用于 LogAlert 类型的规则。

metricName

string

要发送的指标的名称。 仅对 LogToMetric 类型的规则相关且必需。

operator

conditionOperator

条件运算符。 仅针对 LogAlert 类型的规则相关且必需。

query

string

日志查询警报

resourceIdColumn

string

包含资源 ID 的列。列的内容必须是格式为资源 ID 的 URI。仅适用于 LogAlert 类型的规则。

threshold

number (double)

激活警报的条件阈值。 仅针对 LogAlert 类型的规则相关且必需。

timeAggregation

timeAggregation

聚合类型。 仅针对 LogAlert 类型的规则相关且必需。

conditionOperator

条件运算符。 仅针对 LogAlert 类型的规则相关且必需。

说明
Equals
GreaterThan
GreaterThanOrEqual
LessThan
LessThanOrEqual

createdByType

创建资源的标识的类型。

说明
Application
Key
ManagedIdentity
User

Dimension

维度拆分和筛选定义

名称 类型 说明
name

string

维度的名称

operator

dimensionOperator

维度值的运算符

values

string[]

维度值列表

dimensionOperator

维度值的运算符

说明
Exclude
Include

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorContract

描述错误响应的格式。

名称 类型 说明
error

ErrorResponse

错误响应
错误详细信息。

ErrorResponse

错误响应

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorResponse[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

FailingPeriods

在引发警报所需的所选回溯时间范围内所需的最小冲突数。 仅适用于 LogAlert 类型的规则。

名称 类型 默认值 说明
minFailingPeriodsToAlert

integer (int64)

1

触发警报的冲突数。 应小于或等于 numberOfEvaluationPeriods。 默认值为 1

numberOfEvaluationPeriods

integer (int64)

1

聚合回溯点数。 回溯时间窗口是根据聚合粒度(windowSize)和所选聚合点数计算的。 默认值为 1

Kind

指示计划查询规则的类型。 默认值为 LogAlert。

说明
LogAlert
LogToMetric

ScheduledQueryRuleCriteria

定义计划查询规则条件的规则条件。

名称 类型 说明
allOf

Condition[]

要针对指定范围评估的条件列表

ScheduledQueryRuleResource

计划的查询规则资源。

名称 类型 说明
etag

string

etag 字段 不需要。 如果在响应正文中提供,则还必须根据正常的 etag 约定将其作为标头提供。 实体标记用于比较同一请求资源的两个或多个实体。 HTTP/1.1 在 etag(第 14.19 节)、If-Match(第 14.24 节)、If-None-Match(第 14.26 节)和 If-Range(第 14.27 节)标头字段中使用实体标记。

id

string

资源的完全限定资源 ID。 Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

kind

Kind

指示计划查询规则的类型。 默认值为 LogAlert。

location

string

资源所在的地理位置

name

string

资源的名称

properties.actions

Actions

触发警报时要调用的操作。

properties.autoMitigate

boolean

指示是否应自动解决警报的标志。 默认值为 true。 仅适用于 LogAlert 类型的规则。

properties.checkWorkspaceAlertsStorageConfigured

boolean

指示此计划查询规则是否应存储在客户的存储中的标志。 默认值为 false。 仅适用于 LogAlert 类型的规则。

properties.createdWithApiVersion

string

创建此警报规则时使用的 API 版本

properties.criteria

ScheduledQueryRuleCriteria

定义计划查询规则条件的规则条件。

properties.description

string

计划查询规则的说明。

properties.displayName

string

警报规则的显示名称

properties.enabled

boolean

指示是否启用此计划查询规则的标志。 值应为 true 或 false

properties.evaluationFrequency

string (duration)

以 ISO 8601 持续时间格式计算计划查询规则的频率。 仅针对 LogAlert 类型的规则相关且必需。

properties.isLegacyLogAnalyticsRule

boolean

如此 如果警报规则是旧版 Log Analytic 规则

properties.isWorkspaceAlertsStorageConfigured

boolean

指示是否已将此计划查询规则配置为存储在客户的存储中的标志。 默认值为 false。

properties.muteActionsDuration

string (duration)

触发警报后,在所选时间段(采用 ISO 8601 持续时间格式)将操作静音。 仅适用于 LogAlert 类型的规则。

properties.overrideQueryTimeRange

string (duration)

如果指定,则覆盖查询时间范围(默认值为 WindowSize*NumberOfEvaluationPeriods)。 仅适用于 LogAlert 类型的规则。

properties.scopes

string[]

此计划查询规则的范围是资源 ID 的列表。

properties.severity

AlertSeverity (int64)

警报的严重性。 应该是 [0-4] 之间的整数。 值 0 最严重。 仅针对 LogAlert 类型的规则相关且必需。

properties.skipQueryValidation

boolean

指示是否应验证提供的查询的标志。 默认值为 false。 仅适用于 LogAlert 类型的规则。

properties.targetResourceTypes

string[]

创建/更新警报的目标资源的资源类型的列表。 例如,如果范围是资源组,targetResourceTypes Microsoft.Compute/virtualMachines,则会针对资源组中满足警报条件的每个虚拟机触发不同的警报。 仅适用于 LogAlert 类型的规则

properties.windowSize

string (duration)

将在其中执行警报查询的时间段(采用 ISO 8601 持续时间格式)(箱大小)。 仅针对 LogAlert 类型的规则相关且必需。

systemData

systemData

ScheduledQueryRule 的 SystemData。

tags

object

资源标记。

type

string

资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

timeAggregation

聚合类型。 仅针对 LogAlert 类型的规则相关且必需。

说明
Average
Count
Maximum
Minimum
Total