Creates a monitoring rule.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
BlockType | integer | Yes | The strength type of the monitoring rule. Valid values: 0 and 1. The value 0 indicates that the monitoring rule is a weak rule. The value 1 indicates that the monitoring rule is a strong rule. | 0 |
EntityId | long | Yes | The ID of the partition filter expression. | 15224 |
Comment | string | No | The description of the monitoring rule. | |
Checker | integer | Yes | The checker ID. | 9 |
ExpectValue | string | No | The expected value. | 0 |
Trend | string | No | The trend of the monitoring result. Valid values:
| abs |
MethodName | string | Yes | The method used to collect sample data. If you want to use a custom SQL statement as a sampling method, set this parameter to user_defined. | count/table_count |
Operator | string | No | The comparison operator, such as >, >=, =, ≠, <, or <=. Note
If you set the Checker parameter to 9, you must configure the Operator parameter.
| > |
ProjectName | string | Yes | The name of the compute engine or data source. | autotest |
Property | string | No | The fields that you want to monitor. If you want to monitor all fields in a table and check the table rows, set this parameter to table_count. If you want to monitor all fields in a table and check the table size, set this parameter to table_size. | table_id |
PropertyType | string | No | The data type of the fields that you want to monitor. If you want to monitor all fields in a table, set this parameter to table. If you want to monitor only a specific field, set this parameter to bigint. | bigint |
RuleType | integer | Yes | The type of the monitoring rule. Valid values: 0, 1, and 2. The value 0 indicates that the monitoring rule is created by the system. The value 1 indicates that the monitoring rule is created by a user. The value 2 indicates that the monitoring rule is a workspace-level rule. | 0 |
WhereCondition | string | No | The filter condition or custom SQL statement. | table_id>1 |
CriticalThreshold | string | No | The threshold for a critical alert. The threshold indicates the deviation of the monitoring result from the expected value. You can customize this threshold based on your business requirements. If a strong rule is used and a critical alert is triggered, nodes are blocked. | 20 |
WarningThreshold | string | No | The threshold for a warning alert. The threshold indicates the deviation of the monitoring result from the expected value. You can customize this threshold based on your business requirements. | 10 |
TemplateId | integer | No | The template ID. | 7 |
RuleName | string | Yes | The name of the monitoring rule. | 1234 |
PredictType | integer | Yes | Specifies whether the monitoring rule is a dynamic threshold rule. Valid values: 0 and 2. The value 0 indicates that the monitoring rule is not a dynamic threshold rule. The value 2 indicates that the monitoring rule is a dynamic threshold rule. | 0 |
ProjectId | long | Yes | The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID. | 10000 |
TaskSetting | string | No | The variable settings inserted before the custom rule. Format: x=a,y=b. | x=a,y=b |
Response parameters
Examples
Sample success responses
JSON
format
{
"HttpStatusCode": 200,
"Data": "12345",
"ErrorMessage": "You have no permission.",
"RequestId": "ecb967ec-c137-48****",
"ErrorCode": "401",
"Success": true
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-11-15 | The request parameters of the API has changed | View Change Details |
2023-03-08 | The request parameters of the API has changed | View Change Details |