All Products
Search
Document Center

DataWorks:GetQualityRule

Last Updated:Oct 17, 2024

Queries the information about 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
RuleIdlongYes

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

1234
ProjectNamestringYes

The name of the compute engine or data source.

autotest
ProjectIdlongYes

The DataWorks workspace ID.

12345

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

HttpStatusCodeinteger

The HTTP status code.

200
RequestIdstring

The request ID.

576b9457-2cf5-4****
ErrorMessagestring

The error message.

You have no permission.
ErrorCodestring

The error code.

401
Successboolean

Indicates whether the request was successful.

true
Dataobject

The information about the monitoring rule.

BlockTypeinteger

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 whether a monitoring rule is a strong 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.
1
OnDutyAccountNamestring

The name of the Alibaba Cloud account that is used to configure the monitoring rule.

test
WarningThresholdstring

The threshold for a warning alert. The threshold indicates the deviation of the check result from the expected value. You can customize this threshold based on your business requirements.

10
Propertystring

The field whose data quality is checked based on the monitoring rule. This field is a column in the data source table that is monitored.

id
RuleTypeinteger

The type of the monitoring rule.

0
Commentstring

The description of the monitoring rule.

OnDutystring

The ID of the Alibaba Cloud account that is used to configure the monitoring rule.

1822931****
Checkerinteger

The checker ID. The value of this parameter corresponds to the ID at the frontend and is converted from the ID of the primary key.

9
FixCheckboolean

Indicates whether the monitoring is performed based on a fixed value.

true
MethodIdinteger

The ID of the task that is associated with the partition filter expression.

8
CriticalThresholdstring

The threshold for a critical alert. The threshold indicates the deviation of the check result from the expected value. You can specify a 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.

20
PredictTypeinteger

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

  • 0: The threshold is not a dynamic threshold.
  • 1: The threshold is a dynamic threshold.
0
TemplateNamestring

The name of the monitoring template.

SQL task table rows, 1,7, 30 days fluctuation test
CheckerNamestring

The name of the checker.

compared with a fixed value
RuleNamestring

The name of the monitoring rule.

MethodNamestring

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
EntityIdlong

The ID of the partition filter expression.

165523
WhereConditionstring

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

id>10
Operatorstring

The comparison operator of the monitoring rule.

>=
ExpectValuestring

The expected value.

30
Trendstring

The trend of the check result.

abs
TemplateIdinteger

The ID of the monitoring template.

7
Idlong

The monitoring rule ID.

123232
OpenSwitchboolean

Indicates whether the monitoring rule is enabled.

true

Examples

Sample success responses

JSONformat

{
  "HttpStatusCode": 200,
  "RequestId": "576b9457-2cf5-4****",
  "ErrorMessage": "You have no permission.",
  "ErrorCode": "401",
  "Success": true,
  "Data": {
    "BlockType": 1,
    "OnDutyAccountName": "test",
    "WarningThreshold": "10",
    "Property": "id",
    "RuleType": 0,
    "Comment": "",
    "OnDuty": "1822931****",
    "Checker": 9,
    "FixCheck": true,
    "MethodId": 8,
    "CriticalThreshold": "20",
    "PredictType": 0,
    "TemplateName": "SQL task table rows, 1,7, 30 days fluctuation test",
    "CheckerName": "compared with a fixed value",
    "RuleName": "",
    "MethodName": "table_count",
    "EntityId": 165523,
    "WhereCondition": "id>10",
    "Operator": ">=",
    "ExpectValue": "30",
    "Trend": "abs",
    "TemplateId": 7,
    "Id": 123232,
    "OpenSwitch": true,
    "TaskSetting": ""
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-06-18The response structure of the API has changedView Change Details
2023-08-29The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-03-08The request parameters of the API has changedView Change Details