你当前正在访问 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

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

ruleName
path True

string

规则的名称。

subscriptionId
path True

string

目标订阅的 ID。

api-version
query True

string

要用于此操作的 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

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

properties.muteActionsDuration

string

触发警报后,) 以 ISO 8601 持续时间格式将所选时间段的操作 (静音。 仅与 LogAlert 类型的规则相关。

properties.overrideQueryTimeRange

string

如果指定,则替代查询时间范围, (默认值为 WindowSize*NumberOfEvaluationPeriods) 。 仅与 LogAlert 类型的规则相关。

properties.severity

AlertSeverity

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

properties.skipQueryValidation

boolean

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

properties.targetResourceTypes

string[]

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

properties.windowSize

string

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

tags

object

资源标记。

响应

名称 类型 说明
200 OK

ScheduledQueryRuleResource

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

201 Created

ScheduledQueryRuleResource

已创建计划查询规则

Other Status Codes

ErrorContract

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

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
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

Sample Request

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
  }
}

Sample Response

{
  "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)

Sample Request

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
  }
}

Sample Response

{
  "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

Sample Request

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
  }
}

Sample Response

{
  "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

criteria 运算符。 仅对 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

Integer

1

Integer

2

Integer

3

Integer

4

Integer

Condition

计划查询规则的条件。

名称 类型 说明
dimensions

Dimension[]

维度条件列表

failingPeriods

FailingPeriods

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

metricMeasureColumn

string

包含指标度量值编号的列。 仅与 LogAlert 类型的规则相关。

metricName

string

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

operator

conditionOperator

criteria 运算符。 仅对 LogAlert 类型的规则相关且是必需的。

query

string

日志查询警报

resourceIdColumn

string

包含资源 ID 的列。列的内容必须是格式为资源 ID 的 URI。仅与 LogAlert 类型的规则相关。

threshold

number

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

timeAggregation

timeAggregation

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

conditionOperator

criteria 运算符。 仅对 LogAlert 类型的规则相关且是必需的。

名称 类型 说明
Equals

string

GreaterThan

string

GreaterThanOrEqual

string

LessThan

string

LessThanOrEqual

string

createdByType

创建资源的标识类型。

名称 类型 说明
Application

string

Key

string

ManagedIdentity

string

User

string

Dimension

维度拆分和筛选定义

名称 类型 说明
name

string

维度的名称

operator

dimensionOperator

维度值的运算符

values

string[]

维度值列表

dimensionOperator

维度值的运算符

名称 类型 说明
Exclude

string

Include

string

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorContract

描述错误响应的格式。

名称 类型 说明
error

ErrorResponse

错误响应
错误详细信息。

ErrorResponse

错误响应

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorResponse[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

FailingPeriods

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

名称 类型 默认值 说明
minFailingPeriodsToAlert

integer

1

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

numberOfEvaluationPeriods

integer

1

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

Kind

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

名称 类型 说明
LogAlert

string

LogToMetric

string

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。 例如 - /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

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

properties.isLegacyLogAnalyticsRule

boolean

如果警报规则是旧式 Log Analytic 规则,则为 True

properties.isWorkspaceAlertsStorageConfigured

boolean

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

properties.muteActionsDuration

string

触发警报后,) 以 ISO 8601 持续时间格式将所选时间段的操作 (静音。 仅与 LogAlert 类型的规则相关。

properties.overrideQueryTimeRange

string

如果指定,则替代查询时间范围, (默认值为 WindowSize*NumberOfEvaluationPeriods) 。 仅与 LogAlert 类型的规则相关。

properties.scopes

string[]

此计划查询规则的作用域为的资源 ID 列表。

properties.severity

AlertSeverity

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

properties.skipQueryValidation

boolean

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

properties.targetResourceTypes

string[]

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

properties.windowSize

string

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

systemData

systemData

ScheduledQueryRule 的 SystemData。

tags

object

资源标记。

type

string

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

systemData

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

名称 类型 说明
createdAt

string

资源的创建时间戳 (UTC) 。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识类型。

lastModifiedAt

string

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

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

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

timeAggregation

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

名称 类型 说明
Average

string

Count

string

Maximum

string

Minimum

string

Total

string