你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Microsoft.AlertsManagement actionRules
Bicep 资源定义
可以使用目标操作部署 actionRules 资源类型:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.AlertsManagement/actionRules 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.AlertsManagement/actionRules@2021-08-08' = {
location: 'string'
name: 'string'
properties: {
actions: [
{
actionType: 'string'
// For remaining properties, see Action objects
}
]
conditions: [
{
field: 'string'
operator: 'string'
values: [
'string'
]
}
]
description: 'string'
enabled: bool
schedule: {
effectiveFrom: 'string'
effectiveUntil: 'string'
recurrences: [
{
endTime: 'string'
startTime: 'string'
recurrenceType: 'string'
// For remaining properties, see Recurrence objects
}
]
timeZone: 'string'
}
scopes: [
'string'
]
}
tags: {
{customized property}: 'string'
}
}
操作对象
设置 actionType 属性以指定对象的类型。
对于 AddActionGroups,请使用:
{
actionGroupIds: [
'string'
]
actionType: 'AddActionGroups'
}
对于 RemoveAllActionGroups,请使用:
{
actionType: 'RemoveAllActionGroups'
}
重复对象
设置 recurrenceType 属性以指定对象的类型。
对于 每日,请使用:
{
recurrenceType: 'Daily'
}
对于每月 ,请使用:
{
daysOfMonth: [
int
]
recurrenceType: 'Monthly'
}
对于 每周,请使用:
{
daysOfWeek: [
'string'
]
recurrenceType: 'Weekly'
}
属性值
行动
名字 | 描述 | 价值 |
---|---|---|
actionType | 对于 addActionGroups类型,设置为“AddActionGroups”。 对于 removeAllActionGroups类型,设置为“RemoveAllActionGroups”。 | “AddActionGroups” “RemoveAllActionGroups”(必需) |
AddActionGroups
名字 | 描述 | 价值 |
---|---|---|
actionGroupIds | 要添加到警报处理规则的操作组 ID 列表。 | string[] (必需) |
actionType | 应应用的操作。 | “AddActionGroups”(必需) |
AlertProcessingRuleProperties
名字 | 描述 | 价值 |
---|---|---|
行动 | 要应用的操作。 | 操作[] (必需) |
条件 | 将筛选警报的条件。 | 条件[] |
描述 | 警报处理规则的说明。 | 字符串 |
启用 | 指示给定的警报处理规则是启用或禁用的。 | bool |
附表 | 警报处理规则的计划。 | 计划 |
范围 | 将应用警报处理规则的范围。 | string[] (必需) |
条件
名字 | 描述 | 价值 |
---|---|---|
田 | 给定条件的字段。 | “AlertContext” “AlertRuleId” “AlertRuleName” “Description” “MonitorCondition” “MonitorService” “严重性” “SignalType” “TargetResource” “TargetResourceGroup” “TargetResourceType” |
算子 | 给定条件的运算符。 | “Contains” “DoesNotContain” “Equals” “NotEquals” |
值 | 要匹配给定条件的值列表。 | string[] |
DailyRecurrence
名字 | 描述 | 价值 |
---|---|---|
recurrenceType | 指定何时应应用重复周期。 | “每日”(必需) |
ManagedResourceTags
名字 | 描述 | 价值 |
---|
Microsoft.AlertsManagement/actionRules
名字 | 描述 | 价值 |
---|---|---|
位置 | 资源位置 | string (必需) |
名字 | 资源名称 | string (必需) |
性能 | 警报处理规则属性。 | AlertProcessingRuleProperties |
标签 | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 标记 |
MonthlyRecurrence
名字 | 描述 | 价值 |
---|---|---|
daysOfMonth | 指定每月重复模式的值。 | int[] (必需) |
recurrenceType | 指定何时应应用重复周期。 | “Monthly”(必需) |
复发
名字 | 描述 | 价值 |
---|---|---|
endTime | 重复周期的结束时间。 | 字符串 |
recurrenceType | 对于 DailyRecurrence类型,设置为“每日”。 对于 MonthlyRecurrence类型,设置为“Monthly”。 对于 WeeklyRecurrence,请设置为“每周”。 | “每日” “Monthly” “每周”(必需) |
startTime | 重复周期的开始时间。 | 字符串 |
RemoveAllActionGroups
名字 | 描述 | 价值 |
---|---|---|
actionType | 应应用的操作。 | “RemoveAllActionGroups”(必需) |
附表
名字 | 描述 | 价值 |
---|---|---|
effectiveFrom | 计划从时间起生效。 在没有时区后缀的情况下采用 ISO-8601 格式的 Date-Time。 | 字符串 约束: Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$ |
effectiveUntil | 计划有效,直到时间。 在没有时区后缀的情况下采用 ISO-8601 格式的 Date-Time。 | 字符串 约束: Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$ |
复发 | 重复周期列表。 | 定期[] |
timeZone | 计划时区。 | 字符串 |
WeeklyRecurrence
名字 | 描述 | 价值 |
---|---|---|
daysOfWeek | 指定每周重复模式的值。 | 包含任一项的字符串数组: “Friday” “Monday” “Saturday” “星期日” “星期四” “Tuesday” “星期三”(必需) |
recurrenceType | 指定何时应应用重复周期。 | “每周”(必需) |
快速入门示例
以下快速入门示例部署此资源类型。
Bicep 文件 | 描述 |
---|---|
使用 Azure Monitor 为备份警报 设置通知 | 通过此模板,可以使用 Azure Monitor 为恢复服务保管库设置电子邮件通知,方法是部署警报处理规则和操作组 |
ARM 模板资源定义
可以使用目标操作部署 actionRules 资源类型:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.AlertsManagement/actionRules 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.AlertsManagement/actionRules",
"apiVersion": "2021-08-08",
"name": "string",
"location": "string",
"properties": {
"actions": [ {
"actionType": "string"
// For remaining properties, see Action objects
} ],
"conditions": [
{
"field": "string",
"operator": "string",
"values": [ "string" ]
}
],
"description": "string",
"enabled": "bool",
"schedule": {
"effectiveFrom": "string",
"effectiveUntil": "string",
"recurrences": [ {
"endTime": "string",
"startTime": "string",
"recurrenceType": "string"
// For remaining properties, see Recurrence objects
} ],
"timeZone": "string"
},
"scopes": [ "string" ]
},
"tags": {
"{customized property}": "string"
}
}
操作对象
设置 actionType 属性以指定对象的类型。
对于 AddActionGroups,请使用:
{
"actionGroupIds": [ "string" ],
"actionType": "AddActionGroups"
}
对于 RemoveAllActionGroups,请使用:
{
"actionType": "RemoveAllActionGroups"
}
重复对象
设置 recurrenceType 属性以指定对象的类型。
对于 每日,请使用:
{
"recurrenceType": "Daily"
}
对于每月 ,请使用:
{
"daysOfMonth": [ "int" ],
"recurrenceType": "Monthly"
}
对于 每周,请使用:
{
"daysOfWeek": [ "string" ],
"recurrenceType": "Weekly"
}
属性值
行动
名字 | 描述 | 价值 |
---|---|---|
actionType | 对于 addActionGroups类型,设置为“AddActionGroups”。 对于 removeAllActionGroups类型,设置为“RemoveAllActionGroups”。 | “AddActionGroups” “RemoveAllActionGroups”(必需) |
AddActionGroups
名字 | 描述 | 价值 |
---|---|---|
actionGroupIds | 要添加到警报处理规则的操作组 ID 列表。 | string[] (必需) |
actionType | 应应用的操作。 | “AddActionGroups”(必需) |
AlertProcessingRuleProperties
名字 | 描述 | 价值 |
---|---|---|
行动 | 要应用的操作。 | 操作[] (必需) |
条件 | 将筛选警报的条件。 | 条件[] |
描述 | 警报处理规则的说明。 | 字符串 |
启用 | 指示给定的警报处理规则是启用或禁用的。 | bool |
附表 | 警报处理规则的计划。 | 计划 |
范围 | 将应用警报处理规则的范围。 | string[] (必需) |
条件
名字 | 描述 | 价值 |
---|---|---|
田 | 给定条件的字段。 | “AlertContext” “AlertRuleId” “AlertRuleName” “Description” “MonitorCondition” “MonitorService” “严重性” “SignalType” “TargetResource” “TargetResourceGroup” “TargetResourceType” |
算子 | 给定条件的运算符。 | “Contains” “DoesNotContain” “Equals” “NotEquals” |
值 | 要匹配给定条件的值列表。 | string[] |
DailyRecurrence
名字 | 描述 | 价值 |
---|---|---|
recurrenceType | 指定何时应应用重复周期。 | “每日”(必需) |
ManagedResourceTags
名字 | 描述 | 价值 |
---|
Microsoft.AlertsManagement/actionRules
名字 | 描述 | 价值 |
---|---|---|
apiVersion | API 版本 | '2021-08-08' |
位置 | 资源位置 | string (必需) |
名字 | 资源名称 | string (必需) |
性能 | 警报处理规则属性。 | AlertProcessingRuleProperties |
标签 | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 标记 |
类型 | 资源类型 | “Microsoft.AlertsManagement/actionRules” |
MonthlyRecurrence
名字 | 描述 | 价值 |
---|---|---|
daysOfMonth | 指定每月重复模式的值。 | int[] (必需) |
recurrenceType | 指定何时应应用重复周期。 | “Monthly”(必需) |
复发
名字 | 描述 | 价值 |
---|---|---|
endTime | 重复周期的结束时间。 | 字符串 |
recurrenceType | 对于 DailyRecurrence类型,设置为“每日”。 对于 MonthlyRecurrence类型,设置为“Monthly”。 对于 WeeklyRecurrence,请设置为“每周”。 | “每日” “Monthly” “每周”(必需) |
startTime | 重复周期的开始时间。 | 字符串 |
RemoveAllActionGroups
名字 | 描述 | 价值 |
---|---|---|
actionType | 应应用的操作。 | “RemoveAllActionGroups”(必需) |
附表
名字 | 描述 | 价值 |
---|---|---|
effectiveFrom | 计划从时间起生效。 在没有时区后缀的情况下采用 ISO-8601 格式的 Date-Time。 | 字符串 约束: Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$ |
effectiveUntil | 计划有效,直到时间。 在没有时区后缀的情况下采用 ISO-8601 格式的 Date-Time。 | 字符串 约束: Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$ |
复发 | 重复周期列表。 | 定期[] |
timeZone | 计划时区。 | 字符串 |
WeeklyRecurrence
名字 | 描述 | 价值 |
---|---|---|
daysOfWeek | 指定每周重复模式的值。 | 包含任一项的字符串数组: “Friday” “Monday” “Saturday” “星期日” “星期四” “Tuesday” “星期三”(必需) |
recurrenceType | 指定何时应应用重复周期。 | “每周”(必需) |
快速入门模板
以下快速入门模板部署此资源类型。
模板 | 描述 |
---|---|
使用 Azure Monitor 为备份警报 设置通知 |
通过此模板,可以使用 Azure Monitor 为恢复服务保管库设置电子邮件通知,方法是部署警报处理规则和操作组 |
Terraform (AzAPI 提供程序)资源定义
可以使用目标操作部署 actionRules 资源类型:
- 资源组
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.AlertsManagement/actionRules 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.AlertsManagement/actionRules@2021-08-08"
name = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = jsonencode({
properties = {
actions = [
{
actionType = "string"
// For remaining properties, see Action objects
}
]
conditions = [
{
field = "string"
operator = "string"
values = [
"string"
]
}
]
description = "string"
enabled = bool
schedule = {
effectiveFrom = "string"
effectiveUntil = "string"
recurrences = [
{
endTime = "string"
startTime = "string"
recurrenceType = "string"
// For remaining properties, see Recurrence objects
}
]
timeZone = "string"
}
scopes = [
"string"
]
}
})
}
操作对象
设置 actionType 属性以指定对象的类型。
对于 AddActionGroups,请使用:
{
actionGroupIds = [
"string"
]
actionType = "AddActionGroups"
}
对于 RemoveAllActionGroups,请使用:
{
actionType = "RemoveAllActionGroups"
}
重复对象
设置 recurrenceType 属性以指定对象的类型。
对于 每日,请使用:
{
recurrenceType = "Daily"
}
对于每月 ,请使用:
{
daysOfMonth = [
int
]
recurrenceType = "Monthly"
}
对于 每周,请使用:
{
daysOfWeek = [
"string"
]
recurrenceType = "Weekly"
}
属性值
行动
名字 | 描述 | 价值 |
---|---|---|
actionType | 对于 addActionGroups类型,设置为“AddActionGroups”。 对于 removeAllActionGroups类型,设置为“RemoveAllActionGroups”。 | “AddActionGroups” “RemoveAllActionGroups”(必需) |
AddActionGroups
名字 | 描述 | 价值 |
---|---|---|
actionGroupIds | 要添加到警报处理规则的操作组 ID 列表。 | string[] (必需) |
actionType | 应应用的操作。 | “AddActionGroups”(必需) |
AlertProcessingRuleProperties
名字 | 描述 | 价值 |
---|---|---|
行动 | 要应用的操作。 | 操作[] (必需) |
条件 | 将筛选警报的条件。 | 条件[] |
描述 | 警报处理规则的说明。 | 字符串 |
启用 | 指示给定的警报处理规则是启用或禁用的。 | bool |
附表 | 警报处理规则的计划。 | 计划 |
范围 | 将应用警报处理规则的范围。 | string[] (必需) |
条件
名字 | 描述 | 价值 |
---|---|---|
田 | 给定条件的字段。 | “AlertContext” “AlertRuleId” “AlertRuleName” “Description” “MonitorCondition” “MonitorService” “严重性” “SignalType” “TargetResource” “TargetResourceGroup” “TargetResourceType” |
算子 | 给定条件的运算符。 | “Contains” “DoesNotContain” “Equals” “NotEquals” |
值 | 要匹配给定条件的值列表。 | string[] |
DailyRecurrence
名字 | 描述 | 价值 |
---|---|---|
recurrenceType | 指定何时应应用重复周期。 | “每日”(必需) |
ManagedResourceTags
名字 | 描述 | 价值 |
---|
Microsoft.AlertsManagement/actionRules
名字 | 描述 | 价值 |
---|---|---|
位置 | 资源位置 | string (必需) |
名字 | 资源名称 | string (必需) |
性能 | 警报处理规则属性。 | AlertProcessingRuleProperties |
标签 | 资源标记 | 标记名称和值的字典。 |
类型 | 资源类型 | “Microsoft.AlertsManagement/actionRules@2021-08-08” |
MonthlyRecurrence
名字 | 描述 | 价值 |
---|---|---|
daysOfMonth | 指定每月重复模式的值。 | int[] (必需) |
recurrenceType | 指定何时应应用重复周期。 | “Monthly”(必需) |
复发
名字 | 描述 | 价值 |
---|---|---|
endTime | 重复周期的结束时间。 | 字符串 |
recurrenceType | 对于 DailyRecurrence类型,设置为“每日”。 对于 MonthlyRecurrence类型,设置为“Monthly”。 对于 WeeklyRecurrence,请设置为“每周”。 | “每日” “Monthly” “每周”(必需) |
startTime | 重复周期的开始时间。 | 字符串 |
RemoveAllActionGroups
名字 | 描述 | 价值 |
---|---|---|
actionType | 应应用的操作。 | “RemoveAllActionGroups”(必需) |
附表
名字 | 描述 | 价值 |
---|---|---|
effectiveFrom | 计划从时间起生效。 在没有时区后缀的情况下采用 ISO-8601 格式的 Date-Time。 | 字符串 约束: Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$ |
effectiveUntil | 计划有效,直到时间。 在没有时区后缀的情况下采用 ISO-8601 格式的 Date-Time。 | 字符串 约束: Pattern = ^(?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))$ |
复发 | 重复周期列表。 | 定期[] |
timeZone | 计划时区。 | 字符串 |
WeeklyRecurrence
名字 | 描述 | 价值 |
---|---|---|
daysOfWeek | 指定每周重复模式的值。 | 包含任一项的字符串数组: “Friday” “Monday” “Saturday” “星期日” “星期四” “Tuesday” “星期三”(必需) |
recurrenceType | 指定何时应应用重复周期。 | “每周”(必需) |