Skip to main content

Update Alert Rule (V2)

Updates an existing alert rule by its ID. The current user should be a project admin.

PUT/v2/alertRules/{ALERT_RULE_ID}
Connection Endpoint

The base URL for this API is in the following format:

https://api.cloud.zilliz.com

📘Notes

The endpoints on the control plane currently supports up to 20 requests per second per user per endpoint.

shell
export BASE_URL="https://api.cloud.zilliz.com"
Parameters
Authorizationstringheaderrequired

The authentication token should be an API key with appropriate privileges.

Example Value: Bearer {{TOKEN}}
ALERT_RULE_IDstringpathrequired

The ID of the alert rule to update.

Example Value: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Body
ruleNamestring

The name of the alert rule.

levelstringrequired

The level of the alert rule.

metricNamestringrequired

The name of the metric that the alert rule monitors.

thresholdstring

The threshold value of the alert rule.

windowSizestring

The time window for the alert rule in minutes.

enabledbooleanrequired

Indicates whether the alert rule is enabled.

sendResolvedbooleanrequired

Indicates whether to send notifications when the alert rule is resolved.

actionsarrayrequired

The actions to take when the alert rule is triggered.

[]actionsobjectrequired

An action to take when the alert rule is triggered.

typestringrequired

The type of the action.

configobjectrequired

The configuration for the action.

comparisonMethodstringrequired

The comparison operator used in the alert rule.

targetInstanceIdsarray

The IDs of the clusters to which the alert rule applies.

[]targetInstanceIdsstring

The ID of the cluster.

metricUnitstring

The unit of the metric (e.g., "bytes", "percent").

repeatIntervalSecondsinteger<int32>

The interval in seconds between repeated alert notifications.

bash
export TOKEN="YOUR_API_KEY"
export ALERT_RULE_ID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

curl --request PUT \
--url "${BASE_URL}/v2/alertRules/${ALERT_RULE_ID}" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"id": "12391290837zs09sad0d09123",
"projectId": "proj-b44a39b0c51cf21791a841",
"ruleName": "my alert name",
"level": "CRITICAL",
"metricName": "REQUEST_LATENCY_SEARCH_P99",
"threshold": "70",
"windowSize": "10",
"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": "..."
}
}
],
"comparisonMethod": "GREATER_THAN"
}'
Responses

Returns a list of alert rules in the specified project.

Returns a list of alert rules.

codeinteger<int32>

Response code.

dataobject

Response payload object returned by the alert rule update.

idstring

The ID of the alert rule.

orgIdstring

The ID of the organization this alert rule belongs to.

projectIdstring

The ID of the project to which the alert rule belongs.

enabledboolean

Indicates whether the alert rule is enabled.

sendResolvedboolean

Indicates whether to send notifications when the alert rule is resolved.

levelstring

The level of the alert rule.

ruleNamestring

The name of the alert rule.

metricNamestring

The name of the metric that the alert rule monitors.

metricUnitstring

The unit of the monitored metric.

windowSizestring

The time window for the alert rule in minutes.

thresholdstring

The threshold value of the alert rule.

comparisonMethodstring

The comparison operator used in the alert rule.

targetInstanceIdsarray

The IDs of the clusters to which the alert rule applies.

[]targetInstanceIdsstring

The ID of the cluster.

actionsarray

The actions to take when the alert rule is triggered.

[]actionsobject

An action to take when the alert rule is triggered.

typestringrequired

The type of the action.

configobjectrequired

The configuration for the action.

repeatIntervalSecondsinteger<int32>

Repeat interval in seconds for alert notifications

Returns an error message.

codeinteger

Response code.

messagestring

Error message.

Successjson
{
"code": 0,
"data": {
"id": "12391290837zs09sad0d09123",
"projectId": "proj-b44a39b0c51cf21791a841",
"ruleName": "my alert name",
"level": "CRITICAL",
"metricName": "REQUEST_LATENCY_SEARCH_P99",
"threshold": "70",
"windowSize": "10",
"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": "..."
}
}
],
"comparisonMethod": "GREATER_THAN",
"targetInstanceIds": [
"in01-xxxxxxxxxxxx"
]
}
}