google-cloud-functions - 使用 create_alert_policy 方法的协议消息条件没有“conditionAbsent”字段错误
问题描述
我正在尝试在 python 中使用 Cloud Functions 创建警报策略。我有以下非常简单的警报策略:
alert_policy = {
'combiner': 'OR',
'conditions': [
{
'conditionAbsent': {
'duration': '3900s',
'filter': 'resource.type = "l7_lb_rule" AND metric.type = "logging.googleapis.com/user/name_stuff_here"'
}
}
]
}
运行该功能时,出现以下错误:Protocol message Condition has no "conditionAbsent" field error
我应该如何编写此警报政策?Displayname
由于我已完全删除的字段,我也遇到了一些错误。是否有警报策略生成器或类似的东西可以验证警报 json?
解决方案
更仔细地查看我发现conditionAbsent
应该传递的文档condition_absent
推荐阅读
- python - 按另一个数组对 numpy 数组进行排序
- python - Python 请求库、发送帖子、获取、验证和下载文件
- wordpress - 从结帐中删除“购物车已更新”
- nunit - NUnit CLI/C++ TestCase:不能使用数组作为参数
- python - 矩形和鼠标之间的碰撞
- c# - 如何根据 GraphQL 中的查询参数解析特定的 DbContext?
- go - Go Fyne 中的绑定表数据
- docker - 从 Ubuntu 容器中启动 weston
- pytorch - 使用 huggingface 的标记器手动填充 BatchEncodings 列表
- java - ElasticSearch 获取具有一个值但来自多个位置的数据