All Products
Search
Document Center

DataWorks:UpdateQualityRule

Last Updated:Nov 21, 2024

Updates a monitoring rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
BlockTypeintegerNo

The strength of the monitoring rule. The strength of a monitoring rule indicates the importance of the rule. Valid values:

  • 1: The monitoring rule is a strong rule.
  • 0: The monitoring rule is a weak rule. You can specify the strength of a monitoring rule based on your business requirements. If a monitoring rule is a strong rule and the critical threshold is exceeded, a critical alert is reported and tasks that are associated with the rule are blocked from running.
0
EntityIdlongNo

The ID of the partition filter expression. You can call the ListQualityRules operation to obtain the ID of the partition filter expression.

123
CommentstringNo

The description of the monitoring rule.

CheckerintegerYes

The checker ID. Valid values: 2: indicates that the current value is compared with the average value of the previous 7 days. 3: indicates that the current value is compared with the average value of the previous 30 days. 4: indicates that the current value is compared with the value 1 day earlier. 5: indicates that the current value is compared with the value 7 days earlier. 6: indicates that the current value is compared with the value 30 days earlier. 7: indicates the variance between the current value and the value 7 days earlier. 8: indicates the variance between the current value and the value 30 days earlier. 9: indicates that the current value is compared with a fixed value. 10: indicates that the current value is compared with the value 1, 7, or 30 days earlier. 11: indicates that the current value is compared with the value of the previous cycle. You can call the ListQualityRules operation to query the ID.

9
ExpectValuestringNo

The expected value of the monitoring rule.

300
IdlongYes

The monitoring rule ID. You can call the ListQualityRules operation to query the ID of the monitoring rule.

1234
TrendstringNo

The trend of the monitoring result. Valid values:

  • up: increasing
  • down: decreasing
  • abs: absolute value
up
MethodNamestringYes

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.

table_count
OperatorstringNo

The comparison operator, such as >, >=, =, ≠, <, or <=.

Note If you set the Checker parameter to 9, you must configure the Operator parameter.
>
ProjectNamestringYes

The name of the compute engine or data source. You can log on to the DataWorks console and go to the Workspace page to obtain the name of the compute engine or data source.

autotest
PropertystringYes

The name of the field.

id
PropertyTypestringNo

The data type of the field.

bigint
RuleTypeintegerNo

The type of the monitoring rule. Valid values:

  • 0: The monitoring rule is created by the system.
  • 1: The monitoring rule is created by a user.
  • 2: The monitoring rule is a workspace-level rule.
0
WhereConditionstringNo

The filter condition or custom SQL statement that is used for monitoring.

dt=$[yyyymmdd]
CriticalThresholdstringNo

The threshold for a critical alert. The threshold indicates the deviation of the monitoring result from the expected value. You can specify a custom value for the threshold based on your business requirements. If a monitoring rule is a strong rule and the critical threshold is exceeded, a critical alert is reported and tasks that are associated with the rule are blocked from running.

10
WarningThresholdstringNo

The threshold for a warning alert. The threshold specifies the deviation of the monitoring result from the expected value. You can specify a custom value for the threshold based on your business requirements.

5
TemplateIdintegerNo

The ID of the monitoring template. You can call the ListQualityRules operation to obtain the ID of the monitoring template.

7
RuleNamestringNo

The name of the monitoring rule.

123
PredictTypeintegerNo

Specifies whether the threshold is a dynamic threshold. Valid values:

  • 0: The threshold is not a dynamic threshold.
  • 2: The threshold is a dynamic threshold.
0
OpenSwitchbooleanNo

Specifies whether to enable the monitoring rule in the production environment. Valid values:

  • true: The monitoring rule is triggered when the associated auto triggered node that generates the output data starts to run.
  • false: The monitoring rule is not triggered when the associated auto triggered node that generates the output data starts to run.
true
ProjectIdlongYes

The DataWorks workspace ID.

26
TaskSettingstringNo

The variable settings inserted before the custom rule. Format: x=a,y=b.

x=a,y=b

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

HttpStatusCodeinteger

The HTTP status code.

200
Databoolean

Indicates whether the monitoring rule is updated.

true
ErrorMessagestring

The error message.

You have no permission.
RequestIdstring

The request ID. You can troubleshoot issues based on the ID.

576b9457-2cf5-4****
ErrorCodestring

The error code.

0
Successboolean

Indicates whether the request was successful.

true

Examples

Sample success responses

JSONformat

{
  "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 Service error codes.

Change history

Change timeSummary of changesOperation
2024-11-14The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-11-15The request parameters of the API has changedView Change Details
2023-03-08The request parameters of the API has changedView Change Details