【发布时间】:2021-08-18 00:25:49
【问题描述】:
我想使用监控 v3 API 创建一个新的警报策略。我正在关注这个documentation
我有这个云功能:
from google.cloud import monitoring_v3
import json
client = monitoring_v3.AlertPolicyServiceClient()
alert_policy = {
"displayName": "This is a test",
"combiner": "OR",
"conditions": [
{
"displayName": "This is a test",
"conditionAbsent": {
"duration": "3900s",
filter: "resource.type = \"l7_lb_rule\" AND metric.type = \"logging.googleapis.com/user/metric_name_here\""
}
}
],
}
name = 'projects/my-project'
client.create_alert_policy(name, alert_policy)
运行测试函数时出现日志错误TypeError: create_alert_policy() takes from 1 to 2 positional arguments but 3 were given
我在这里缺少什么?
【问题讨论】:
标签: python google-cloud-platform google-cloud-functions google-cloud-monitoring