メインコンテンツまでスキップ

アラートルールを更新 (V2)

既存のアラートルールを ID で更新します。現在のユーザーはプロジェクト管理者である必要があります。

PUT/v2/alertRules/{ALERT_RULE_ID}
接続エンドポイント

このAPIのBase URLは以下の形式です:

https://api.cloud.zilliz.com

📘ノート

コントロールプレーンのエンドポイントは現在、ユーザーごと・エンドポイントごとに毎秒最大20リクエストまでサポートしています。

shell
export BASE_URL="https://api.cloud.zilliz.com"
パラメータ
Authorizationstringheader必要

認証トークンには、適切な権限を持つ API key を使用する必要があります。

値の例: Bearer {{TOKEN}}
ALERT_RULE_IDstringpath必要

更新するアラートルールの ID。

値の例: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
リクエスト・ボディ
ruleNamestring

アラートルールの名前。

levelstring必要

アラートルールのレベル。

metricNamestring必要

アラートルールが監視するメトリクスの名前。

thresholdstring

アラートルールのしきい値。

windowSizestring

アラートルールの時間ウィンドウ(分)。

enabledboolean必要

アラートルールが有効かどうかを示します。

sendResolvedboolean必要

アラートルールが解決されたときに通知を送信するかどうかを示します。

actionsarray必要

アラートルールがトリガーされたときに実行するアクション。

[]actionsobject必要

アラートルールがトリガーされたときに実行するアクション。

typestring必要

アクションのタイプ。

configobject必要

アクションの設定。

comparisonMethodstring必要

アラートルールで使用される比較演算子。

targetInstanceIdsarray

アラートルールが適用されるクラスターの ID。

[]targetInstanceIdsstring

クラスターの ID。

metricUnitstring

メトリクスの単位(例: "bytes"、"percent")。

repeatIntervalSecondsinteger<int32>

繰り返し送信されるアラート通知の間隔(秒)。

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"
}'
レスポンス

指定したプロジェクト内のアラートルールのリストを返します。

アラートルールのリストを返します。

codeinteger<int32>

レスポンスコード。

dataobject

アラートルール更新操作で返されるレスポンスペイロードオブジェクトです。

idstring

アラートルールの ID。

orgIdstring

このアラートルールが属する組織の ID。

projectIdstring

アラートルールが属するプロジェクトの ID。

enabledboolean

アラートルールが有効かどうかを示します。

sendResolvedboolean

アラートルールが解決されたときに通知を送信するかどうかを示します。

levelstring

アラートルールのレベル。

ruleNamestring

アラートルールの名前。

metricNamestring

アラートルールが監視するメトリクスの名前。

metricUnitstring

監視対象メトリックの単位。

windowSizestring

アラートルールの時間ウィンドウ(分)。

thresholdstring

アラートルールのしきい値。

comparisonMethodstring

アラートルールで使用される比較演算子。

targetInstanceIdsarray

アラートルールが適用されるクラスターの ID。

[]targetInstanceIdsstring

クラスターの ID。

actionsarray

アラートルールがトリガーされたときに実行するアクション。

[]actionsobject

アラートルールがトリガーされたときに実行するアクション。

typestring必要

アクションのタイプ。

configobject必要

アクションの設定。

repeatIntervalSecondsinteger<int32>

アラート通知の繰り返し間隔(秒)

エラーメッセージを返します。

codeinteger

レスポンスコード。

messagestring

エラーメッセージ。

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"
]
}
}