Updates a monitoring rule.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | UpdateQualityRule |
The operation that you want to perform. |
BlockType | Integer | No | 0 |
The strength of the monitoring rule. The strength of a monitoring rule indicates the importance of the rule. Valid values:
|
EntityId | Long | No | 123 |
The ID of the partition filter expression. You can call the ListQualityRules operation to obtain the ID of the partition filter expression. |
Comment | String | No | Check the number of table rows. |
The description of the monitoring rule. |
Checker | Integer | Yes | 9 |
The ID of the checker. You can call the ListQualityRules operation to obtain the ID of the checker. |
ExpectValue | String | No | 300 |
The expected value of the monitoring rule. |
Id | Long | Yes | 1234 |
The ID of the monitoring rule. You can call the ListQualityRules operation to obtain the ID of the monitoring rule. |
Trend | String | No | up |
The trend of the monitoring result. Valid values:
|
MethodName | String | Yes | table_count |
The name of the method that is used to collect sample data, such as avg, count, sum, min, max, count_distinct, user_defined, table_count, table_size, table_dt_load_count, table_dt_refuseload_count, null_value, null_value/table_count, (table_count-count_distinct)/table_count, or table_count-count_distinct. |
Operator | String | No | > |
The comparison operator. |
ProjectName | String | Yes | autotest |
The name of the compute engine instance or data source. You can log on to the DataWorks console and go to the Workspace Management page to obtain the name. |
Property | String | Yes | id |
The name of the field to be monitored. |
PropertyType | String | No | bigint |
The data type of the field. |
RuleType | Integer | No | 0 |
The type of the monitoring rule. Valid values:
|
WhereCondition | String | No | dt=$[yyyymmdd] |
The filter condition or custom SQL statement that is used for monitoring. |
CriticalThreshold | String | No | 10 |
The threshold for an error 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 an error alert is triggered, nodes are blocked. |
WarningThreshold | String | No | 5 |
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. |
TemplateId | Integer | No | 7 |
The ID of the monitoring template. You can call the ListQualityRules operation to obtain the ID of the monitoring template. |
RegionId | String | No | cn-shanghai |
The region ID. For example, the ID of the China (Shanghai) region is cn-shanghai, and that of the China (Zhangjiakou) region is cn-zhangjiakou. The system determines the value of this parameter based on the endpoint that is used to call the operation. |
RuleName | String | No | Table row check |
The name of the monitoring rule. |
PredictType | Integer | No | 0 |
The category of the monitoring rule. Valid values:
|
OpenSwitch | Boolean | No | true |
Specifies whether to enable the monitoring rule in the production environment.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
HttpStatusCode | Integer | 200 |
The HTTP status code. |
Data | Boolean | true |
Indicates whether the monitoring rule is updated. |
ErrorMessage | String | You have no permission. |
The error message. |
RequestId | String | 576b9457-2cf5-4**** |
The ID of the request. You can troubleshoot errors based on the ID. |
ErrorCode | String | 0 |
The error code. |
Success | Boolean | true |
Indicates whether the request is successful. |
Examples
Sample request
http(s)://[Endpoint]/?Action=UpdateQualityRule
&BlockType=0
&EntityId=123
&Comment=Check the number of table rows.
&Checker=9
&ExpectValue=300
&Id=1234
&Trend=up
&MethodName=table_count
&Operator=>
&ProjectName=autotest
&Property=id
&PropertyType=bigint
&RuleType=0
&WhereCondition=dt=$[yyyymmdd]
&CriticalThreshold=10
&WarningThreshold=5
&TemplateId=7
&RuleName=Table row check
&PredictType=0
&OpenSwitch=true
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<UpdateQualityRuleResponse>
<HttpStatusCode>200</HttpStatusCode>
<Data>true</Data>
<ErrorMessage>You have no permission.</ErrorMessage>
<RequestId>576b9457-2cf5-4****</RequestId>
<ErrorCode>0</ErrorCode>
<Success>true</Success>
</UpdateQualityRuleResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"HttpStatusCode" : 200,
"Data" : true,
"ErrorMessage" : "You have no permission.",
"RequestId" : "576b9457-2cf5-4****",
"ErrorCode" : "0",
"Success" : true
}
Error codes
For a list of error codes, visit the API Error Center.