All Products
Search
Document Center

DataWorks:ListQualityResultsByRule

Last Updated:Nov 21, 2024

Queries monitoring results after the data quality of a data source or a compute engine is monitored based on monitoring rules.

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 use the ID and information such as a partition filter expression to perform a joint query.

152322134
StartDatestringYes

The beginning of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.

This parameter is used together with the EndDate parameter. The interval between the time specified by this parameter and the time specified by the EndDate parameter cannot exceed 7 days.

2020-09-20 00:00:00
EndDatestringYes

The end of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.

This parameter is used together with the StartDate parameter. The interval between the time specified by this parameter and the time specified by the StartDate parameter cannot exceed 7 days.

2020-09-22 00:00:00
PageSizeintegerYes

The number of entries per page. Default value: 10. Maximum value: 100.

10
PageNumberintegerYes

The page number.

1
ProjectNamestringYes

The name of the compute engine or data source for which data quality is monitored.

autotest
ProjectIdlongYes

The DataWorks workspace ID.

12345

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

HttpStatusCodeinteger

The HTTP status code.

200
ErrorMessagestring

The error message.

You have no permission.
RequestIdstring

The request ID.

CBA58543-00D4-41****
ErrorCodestring

The error code.

401
Successboolean

Indicates whether the request was successful.

true
Dataobject

The data structure of the monitoring results returned.

PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page. Default value: 10. Maximum value: 100.

10
TotalCountlong

The total number of entries returned.

200
RuleChecksarray<object>

The returned monitoring results.

RuleChecksobject
BlockTypeinteger

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

  • 1: indicates that the monitoring rule is a strong rule.
  • 0: indicates that 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.
1
WarningThresholdfloat

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.

0.1
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.

type
TableNamestring

The name of the table that is monitored.

dual
Commentstring

The description of the monitoring rule.

CheckResultStatusinteger

The status of the monitoring result.

2
TemplateNamestring

The name of the monitoring template.

CheckerNamestring

The name of the checker.

fulx
RuleIdlong

The ID of the monitoring rule.

123421
FixedCheckboolean

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

  • true
  • false
false
Opstring

The comparison operator.

>
UpperValuefloat

The upper limit of the predicted result. The value of this parameter is automatically generated based on the threshold that you specify.

22200
ActualExpressionstring

The partition in the monitored data source table.

ds=20200925
ExternalIdstring

The node ID.

123112232
TimeCoststring

The time that was taken to run the monitoring task.

10
Trendstring

The trend of the monitoring result.

up
ExternalTypestring

The type of the scheduling system. Only CWF scheduling systems are supported.

CWF2
BizDatelong

The data timestamp. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

1600704000000
CheckResultinteger

The monitoring result.

2
ResultStringstring

The string of the monitoring result.

ResultString
MatchExpressionstring

The partition filter expression.

ds=$[yyyymmdd]
CheckerTypeinteger

The type of the checker.

0
ProjectNamestring

The name of the compute engine or data source for which data quality is monitored.

autotest
BeginTimelong

The time when the monitoring started.

1600704000000
DateTypestring

The scheduling frequency. In most cases, the value of this parameter is YMD. This value indicates year, month, and day.

YMD
CriticalThresholdfloat

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.

0.6
IsPredictionboolean

Indicates whether the monitoring result is the same as the predicted result. Valid values:

  • true
  • false
false
RuleNamestring

The name of the monitoring rule.

CheckerIdinteger

The checker ID.

7
DiscreteCheckboolean

Indicates whether the monitoring is discrete monitoring. Valid values:

  • true
  • false
true
EndTimelong

The time when the monitoring ended.

1600704000000
MethodNamestring

The method used to collect sample data, such as 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.

max
LowerValuefloat

The lower limit of the predicted result. The value of this parameter is automatically generated based on the threshold that you specify.

2344
EntityIdlong

The ID of the partition filter expression.

14534343
WhereConditionstring

The filter condition of the monitoring task.

type!='type2'
ExpectValuefloat

The expected value.

90
TemplateIdinteger

The ID of the monitoring template.

5
TaskIdstring

The monitoring task ID.

16008552981681a0d6****
Idlong

The primary key ID.

2231123
ReferenceValuearray<object>

The historical sample values.

ReferenceValueobject
DiscretePropertystring

The values of the sample field that are grouped by using the GROUP BY clause. For example, the values of the Gender field are grouped by using the GROUP BY clause. In this case, the values of DiscreteProperty are Male, Female, and null.

type1
Valuefloat

The sample value.

20
BizDatestring

The data timestamp. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

1600704000000
SingleCheckResultinteger

The string of the monitoring result.

2
Thresholdfloat

The threshold.

0.2
SampleValuearray<object>

The current sample values.

SampleValueobject
DiscretePropertystring

The values of the sample field that are grouped by using the GROUP BY clause. For example, the values of the Gender field are grouped by using the GROUP BY clause. In this case, the values of DiscreteProperty are Male, Female, and null.

type2
BizDatestring

The data timestamp. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

1600704000000
Valuefloat

The sample value.

23
Openboolean

Indicates whether the monitoring rule is enabled.

true

Examples

Sample success responses

JSONformat

{
  "HttpStatusCode": 200,
  "ErrorMessage": "You have no permission.",
  "RequestId": "CBA58543-00D4-41****",
  "ErrorCode": "401",
  "Success": true,
  "Data": {
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 200,
    "RuleChecks": [
      {
        "BlockType": 1,
        "WarningThreshold": 0.1,
        "Property": "type",
        "TableName": "dual",
        "Comment": "",
        "CheckResultStatus": 2,
        "TemplateName": "",
        "CheckerName": "fulx",
        "RuleId": 123421,
        "FixedCheck": false,
        "Op": ">",
        "UpperValue": 22200,
        "ActualExpression": "ds=20200925",
        "ExternalId": "123112232",
        "TimeCost": "10",
        "Trend": "up",
        "ExternalType": "CWF2",
        "BizDate": 1600704000000,
        "CheckResult": 2,
        "ResultString": "ResultString",
        "MatchExpression": "ds=$[yyyymmdd]",
        "CheckerType": 0,
        "ProjectName": "autotest",
        "BeginTime": 1600704000000,
        "DateType": "YMD",
        "CriticalThreshold": 0.6,
        "IsPrediction": false,
        "RuleName": "",
        "CheckerId": 7,
        "DiscreteCheck": true,
        "EndTime": 1600704000000,
        "MethodName": "max",
        "LowerValue": 2344,
        "EntityId": 14534343,
        "WhereCondition": "type!='type2'",
        "ExpectValue": 90,
        "TemplateId": 5,
        "TaskId": "16008552981681a0d6****",
        "Id": 2231123,
        "ReferenceValue": [
          {
            "DiscreteProperty": "type1",
            "Value": 20,
            "BizDate": "1600704000000",
            "SingleCheckResult": 2,
            "Threshold": 0.2
          }
        ],
        "SampleValue": [
          {
            "DiscreteProperty": "type2",
            "BizDate": "1600704000000",
            "Value": 23
          }
        ],
        "Open": true
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-05-10The 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