查看告警规则列表
该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com.cn
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
当前接口为公测版。如果您在使用该接口过程中遇到任何问题,欢迎您联系 Zilliz Cloud 技术支持。
export BASE_URL="https://api.cloud.zilliz.com.cn"
认证令牌,应为具备适当权限的 API 密钥。
The ID of the project to which the alert rules belong.
The number of items to return in each page.
The page number to return.
export TOKEN="YOUR_API_KEY"
curl --request GET \
--url "${BASE_URL}/v2/alertRules?projectId=proj-xxxxxxxxxxxxxxxxxxxxxx" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json"
Returns a list of alert rules.
响应码。
告警规则总数。
当前页码。
每页记录数。
告警规则列表。
告警规则 ID。
告警规则所属项目 ID。
告警规则名称。
告警规则级别。
告警规则监控的指标名称。
告警规则阈值。
告警规则的时间窗口,单位为分钟。
告警规则使用的比较运算符。
告警规则适用的集群 ID 列表。
集群 ID。
告警规则是否启用。
告警规则是否发送已解决的通知。
The actions to take when the alert rule is triggered.
An action to take when the alert rule is triggered.
操作类型。
操作配置。
告警通知的接收者。仅当操作类型为 EMAIL 和 SMS 时适用。
用于接收通知的邮件地址列表。
用于接收通知的邮件地址。
用于接收通知的组织角色列表。
用于接收通知的组织角色。
用于接收通知的项目角色列表。
用于接收通知的项目角色。
告警通知应发送到的 URL。仅当操作类型为 WEBHOOK 时适用。
告警通知应发送到的 URL。仅当操作类型为 SLACK、LARK、WECOM 时适用。
您的 PagerDuty 或 OpsGenie 服务所在的区域。仅当操作类型为 PAGERDUTY 和 OPSGENIE 时适用。
您的 PagerDuty 或 OpsGenie 服务的 API 密钥。仅当操作类型为 PAGERDUTY 和 OPSGENIE 时适用。
Returns an error message.
响应码。
错误描述。
{
"code": 0,
"data": {
"count": 1,
"currentPage": 1,
"pageSize": 10,
"alertRules": [
{
"id": "12391290837zs09sad0d09123",
"projectId": "proj-b44a39b0c51cf21791a841",
"ruleName": "my alert name",
"level": "CRITICAL|WARNING",
"metricName": "REQUEST_LATENCY_SEARCH_P99",
"threshold": "70",
"windowSize": "10",
"comparisonMethod": "GREATER_THAN",
"targetClusterIds": [
"in01-xxxxxxxxxxxx"
],
"enabled": true,
"sendResolved": true,
"actions": [
{
"type": "EMAIL",
"config": {
"recipients": {
"members": [
"your-email@your-org.com"
],
"orgRoles": [
"OWNER",
"MEMBER",
"BILLING_ADMIN"
],
"projectRoles": [
"OWNER",
"MEMBER"
]
}
}
},
{
"type": "SMS",
"config": {
"recipients": {
"members": [
"your-email@your-org.com"
],
"orgRoles": [
"OWNER",
"MEMBER",
"BILLING_ADMIN"
],
"projectRoles": [
"OWNER",
"MEMBER"
]
}
}
},
{
"type": "WEBHOOK",
"config": {
"url": "https://xxxx"
}
},
{
"type": "SLACK",
"config": {
"webhookUrl": "https://xxxx"
}
},
{
"type": "LARK",
"config": {
"webhookUrl": "https://xxxx"
}
},
{
"type": "WECOM",
"config": {
"webhookUrl": "https://xxxx"
}
},
{
"type": "PAGERDUTY",
"config": {
"region": "US",
"apiKey": "..."
}
},
{
"type": "OPSGENIE",
"config": {
"region": "US",
"apiKey": "..."
}
}
]
}
]
}
}