Updates a monitoring rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateQualityRule

The operation that you want to perform.

Id Long Yes 1234

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

ProjectName String Yes autotest

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

BlockType Integer No 0

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

  • 1: The monitoring rule is a strong rule.
  • 0: The monitoring rule is a weak rule.

    You can specify whether a monitoring rule is a strong rule based on your business requirements. If a strong rule is used and an error alert is reported, nodes are blocked.

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 Table row check

The description of the monitoring rule.

Checker Integer No 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 result.

Trend String No up

The trend of the monitoring results. Valid values:

  • up: increasing
  • down: decreasing
  • abs: absolute value
MethodName String No table_count

The method 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 of the monitoring rule.

Property String No id

The field that is monitored.

PropertyType String No bigint

The data type of the field.

RuleType Integer No 0

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.
WhereCondition String No dt=$[yyyymmdd]

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

CriticalThreshold String No 10

The error threshold of the monitoring rule. 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 reported, nodes are blocked.

WarningThreshold String No 5

The warning threshold of the monitoring rule. 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 ID of the region in which the DataWorks workspace resides. For example, the ID of the China (Shanghai) region is cn-shanghai, and that of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically 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:

  • 0: The monitoring rule is a statistical analysis rule.
  • 2: The monitoring rule is a dynamic threshold rule.

Response parameters

Parameter Type Example Description
Data Boolean true

Indicates whether the monitoring rule is updated.

ErrorCode String 0

The error code.

ErrorMessage String You have no permission.

The error message.

HttpStatusCode Integer 200

The HTTP status code.

RequestId String 576b9457-2cf5-4****

The ID of the request. You can troubleshoot errors based on the ID.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateQualityRule
&Id=1234
&ProjectName=autotest
&<Common request parameters>

Sample success responses

XML format

<RequestId>576b9457-2cf5-4****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>true</Data>
<ErrorCode>0</ErrorCode>
<ErrorMessage>You have no permission.</ErrorMessage>
<Success>true</Success>

JSON format

{
    "RequestId": "576b9457-2cf5-4****",
    "HttpStatusCode": 200,
    "Data": true,
    "ErrorCode": 0,
    "ErrorMessage": "You have no permission.",
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.