調用CreateMetricRuleTemplate介面建立警示模板。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cms:CreateMetricRuleTemplate |
create |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Name |
string |
是 |
警示模板名稱。 |
Template1 |
| Description |
string |
否 |
警示模板描述資訊。 |
ECS_Template1 |
| AlertTemplates |
array<object> |
否 |
警示模板列表。 |
|
|
object |
否 |
警示模板。 |
||
| Escalations.Info.Threshold |
string |
否 |
普通層級警示閾值。 N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
20 |
| MetricName |
string |
是 |
監控項名稱。 N 的取值範圍:1~200。 關於如何擷取監控項,請參見 DescribeMetricMetaList 或雲產品監控項。 |
cpu_total |
| Webhook |
string |
否 |
警示發生回調時的 URL 地址。 N 的取值範圍:1~200。 填寫公網可訪問的 URL 地址,CloudMonitor會將警示資訊通過 POST 請求推送到該地址,目前僅支援 HTTP 協議。 |
http://ww.aliyun.com |
| Escalations.Warn.Threshold |
string |
否 |
警告層級警示閾值。 N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
30 |
| Namespace |
string |
是 |
雲產品的資料命名空間。 N 的取值範圍:1~200。 關於如何擷取雲產品的資料命名空間,請參見 DescribeMetricMetaList 或雲產品監控項。 |
acs_ecs_dashboard |
| Period |
integer |
否 |
監控資料的彙總周期。單位:秒。 預設為監控項對應的最小周期,通常不需要指定。 N 的取值範圍:1~200。 |
60 |
| RuleName |
string |
是 |
警示規則名稱。 N 的取值範圍:1~200。 |
ECS_Rule1 |
| Escalations.Critical.Times |
integer |
否 |
發送緊急警示通知需要監控指標達到警示閾值的次數。 N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
3 |
| Selector |
string |
否 |
Dimension 擴充欄位的選項。 N 的取值範圍:1~200。 例如:警示模板被應用到了一個應用分組中,當該參數設定為 說明
關於擴充欄位選項的取值,請參見 DescribeMetricRuleTemplateAttribute 。 |
{"disk":"/"} |
| Escalations.Info.Statistics |
string |
否 |
普通層級警示統計方法。 N 的取值範圍:1~200。 該參數的取值由指定雲產品的 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
Average |
| Escalations.Warn.Times |
integer |
否 |
發送警告警示通知需要監控指標達到警示閾值的次數。 N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
1 |
| Escalations.Info.ComparisonOperator |
string |
否 |
普通層級閾值比較符。取值:
N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
GreaterThanOrEqualToThreshold |
| Category |
string |
是 |
雲產品名稱縮寫。 N 的取值範圍:1~200。 關於如何擷取雲產品名稱縮寫,請參見 DescribeProjectMeta 介面的返回參數 |
ecs |
| Escalations.Critical.Threshold |
string |
否 |
觸發緊急層級警示通知的閾值。 N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
30 |
| Escalations.Critical.Statistics |
string |
否 |
緊急層級警示統計方法。 N 的取值範圍:1~200。 該參數的取值由指定雲產品的 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
Average |
| Escalations.Critical.ComparisonOperator |
string |
否 |
緊急層級閾值比較符。取值:
N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
GreaterThanOrEqualToThreshold |
| Escalations.Warn.ComparisonOperator |
string |
否 |
警告層級閾值比較符。取值:
N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
GreaterThanOrEqualToThreshold |
| Escalations.Info.Times |
integer |
否 |
發送普通警示通知需要監控指標達到警示閾值的次數。 N 的取值範圍:1~200。 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
1 |
| Escalations.Warn.Statistics |
string |
否 |
警告層級警示統計方法。 N 的取值範圍:1~200。 該參數的取值由指定雲產品的 說明
警示層級 Critical(嚴重)、Warn(警告)或 Info(資訊)至少設定一個,且該警示層級中的參數 Statistics、ComparisonOperator、Threshold 和 Times 必須同時設定。 |
Average |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回資料。 |
||
| Code |
integer |
狀態代碼。 說明
200 表示成功。 |
200 |
| Message |
string |
錯誤資訊。 |
The Request is not authorization. |
| RequestId |
string |
請求 ID。 |
9763ED1A-4D09-41BF-851E-310421750204 |
| Success |
boolean |
操作是否成功。取值:
|
true |
| Id |
integer |
警示模板 ID。 |
12345 |
樣本
正常返回樣本
JSON格式
{
"Code": 200,
"Message": "The Request is not authorization.",
"RequestId": "9763ED1A-4D09-41BF-851E-310421750204",
"Success": true,
"Id": 12345
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidQueryParameter | %s | |
| 401 | AccessDeniedException | You donot have sufficient access to perform this action. | |
| 412 | ResourcesOverLimit | Resources over limit. | |
| 500 | InternalFailure | %s | |
| 402 | LimitExceeded | The quota for this customer had been reached. | |
| 403 | InvalidClientTokenId | not allow this operation. | 沒有許可權 |
| 206 | %s | %s | |
| 503 | %s | %s | |
| 406 | %s | %s | |
| 429 | Throttli∂ngException | The request was denied due to request throttling. | |
| 409 | %s | %s | |
| 409 | ResourceConflict | Concurrent modification of resources. | |
| 409 | ResourceExist | Resources already exist. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。