CreateQualityRule
Creates a quality monitoring rule.
This API has been deprecated. We recommend migrating to dataworks-public(2024-05-18) - CreateDataQualityScan for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| BlockType |
integer |
Yes |
The strength of the rule. Valid values:
|
0 |
| EntityId |
integer |
Yes |
The ID of the partition expression. |
15224 |
| Comment |
string |
No |
The description of the rule. |
Verification |
| Checker |
integer |
No |
The ID of the checker. Valid values:
|
9 |
| ExpectValue |
string |
No |
The expected value. |
0 |
| Trend |
string |
No |
The trend of the check result. Valid values:
|
abs |
| MethodName |
string |
No |
The sampling method. If custom SQL is used, the value of this parameter is user_defined. |
count/table_count |
| Operator |
string |
No |
The comparison operator. Valid values include >, >=, =, ≠, <, and <=. Note
When Checker is set to 9, Operator is required. |
> |
| ProjectName |
string |
Yes |
The name of the engine or data source. |
autotest |
| Property |
string |
No |
The field to which the rule applies. For table-level checks, the fields are table_count for the number of rows and table_size for the table size. |
table_id |
| PropertyType |
string |
No |
The type of the field. Set this parameter to table for table-level fields, or specify a data type such as bigint for column-level fields. |
bigint |
| RuleType |
integer |
Yes |
The type of the rule. Valid values:
|
0 |
| WhereCondition |
string |
No |
The filter condition or custom SQL statement. |
table_id>1 |
| CriticalThreshold |
string |
No |
The threshold for a critical alert, which indicates the degree of deviation from the expected sample value. You can customize this threshold based on your business requirements. If a strong rule is used and the critical threshold is triggered, the scheduling task is blocked. |
20 |
| WarningThreshold |
string |
No |
The threshold for a warning alert, which indicates the degree of deviation from the expected sample value. You can customize this threshold based on your business requirements. |
10 |
| TemplateId |
integer |
No |
The ID of the template. |
7 |
| RuleName |
string |
Yes |
The name of the rule. |
1234 |
| PredictType |
integer |
Yes |
Specifies whether the threshold is dynamic. Valid values:
|
0 |
| ProjectId |
integer |
No |
The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the workspace configuration page to obtain the workspace ID. |
10000 |
| TaskSetting |
string |
No |
The variable settings inserted before the custom rule. Format: x=a,y=b. |
x=a,y=b |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Data |
string |
The ID of the created rule. |
12345 |
| ErrorMessage |
string |
The error message. |
You have no permission. |
| RequestId |
string |
The request ID. |
ecb967ec-c137-48**** |
| ErrorCode |
string |
The error code. |
401 |
| Success |
boolean |
Indicates whether the call was successful. |
true |
Examples
Success response
JSON format
{
"HttpStatusCode": 200,
"Data": "12345",
"ErrorMessage": "You have no permission.",
"RequestId": "ecb967ec-c137-48****",
"ErrorCode": "401",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.