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

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 ListQualityResultsByRule

The operation that you want to perform.

EndDate String Yes 2020-09-22 00:00:00

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

PageNumber Integer Yes 1

The number of the page to return.

PageSize Integer Yes 10

The number of entries to return on each page. Default value: 10. Maximum value: 100.

ProjectName String Yes autotest

The name of the engine or data source.

RuleId Integer Yes 152322134

The ID of the monitoring rule. You can use the ID and information such as a partition filter expression to perform a joint query.

StartDate String Yes 2020-09-20 00:00:00

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

RegionId String No cn-hangzhou

The region ID. 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 used to call the operation.

Response parameters

Parameter Type Example Description
Data Struct

The top structure of the monitoring results.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

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

RuleChecks Array of RuleChecks

The monitoring results returned.

ActualExpression String ds=20200925

The partition of the monitored table in the data source.

BeginTime Long 1600704000000

The time when the monitoring started.

BizDate Long 1600704000000

The date on which the business was performed. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

BlockType Integer 1

The type of the monitoring rule. The strength of monitoring rules indicates the importance of the rules. 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 whether a monitoring rule is a strong rule based on your business requirements. If a strong rule is used and error alerts are reported, nodes are blocked.

CheckResult Integer 2

The monitoring result. Valid values: 0, 1, and 2. The value 1 indicates that the monitoring result is normal. The value 1 indicates that a warning alert is reported. The value 2 indicates that an error alert is reported.

CheckResultStatus Integer 2

The status of the monitoring result. Valid values: 0, 1, and 2. The value 0 indicates that the monitoring result is in a normal state. The value 1 indicates that an alert is reported. The value 2 indicates that nodes are blocked.

CheckerId Integer 7

The ID of the checker.

CheckerName String fulx

The name of the checker.

CheckerType Integer 0

The type of the checker.

Comment String Description of the monitoring rule

The description of the monitoring rule.

CriticalThreshold Float 0.6

The error threshold. The threshold indicates the deviation of monitoring results from expected values. You can customize this threshold based on your business requirements. If a strong rule is used and error alerts are reported, nodes are blocked.

DateType String YMD

The type of the scheduling cycle. Valid values: YMD.

DiscreteCheck Boolean true

Indicates whether the monitoring is discrete monitoring. Valid values:

  • true: indicates that the monitoring is discrete monitoring.
  • false: indicates that the monitoring is not discrete monitoring.
EndTime Long 1600704000000

The end time of the monitoring.

EntityId Integer 14534343

The ID of the partition filter expression.

ExpectValue Float 90

The expected value.

ExternalId String 123112232

The ID of the node.

ExternalType String CWF2

The type of the scheduling system. Only CWF is supported.

FixedCheck Boolean false

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

  • true: indicates that the monitoring for a fixed value is performed.
  • false: indicates whether the monitoring for a fixed value is not performed.
Id Integer 2231123

The ID of the primary key.

IsPrediction Boolean false

Indicates whether the monitoring result is consistent with the predicted result. Valid values:

  • true: indicates that the monitoring result is consistent with the predicted result.
  • false: indicates that the monitoring result is inconsistent with the predicted result.
LowerValue Float 2344

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

MatchExpression String ds=$[yyyymmdd]

The partition filter expression.

MethodName String max

The sampling method. The value of this parameter includes 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, table_count-count_distinct.

Op String >

The comparison operator.

ProjectName String autotest

The name of the engine or data source.

Property String type

The field of the rule attribute. This field is the column name of the data source table that is monitored.

ReferenceValue Array of ReferenceValue

The historical sample value.

BizDate String 1600704000000

The date on which the business was performed. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

DiscreteProperty String type1

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

SingleCheckResult Integer 2

The string of the monitoring result.

Threshold Float 0.2

The threshold.

Value Float 20

The sample value.

ResultString String ResultString

The string of the monitoring result.

RuleId Integer 123421

The ID of the monitoring rule.

RuleName String Name of the monitoring rule

The name of the monitoring rule.

SampleValue Array of SampleValue

The sample value.

BizDate String 1600704000000

The date on which the business was performed. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

DiscreteProperty String type2

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

Value Float 23

The sample value.

TableName String dual

The name of the table that is monitored.

TaskId String 16008552981681a0d6****

The ID of the monitoring task.

TemplateId Integer 5

The ID of the monitoring template.

TemplateName String Compare the Number of Unique Field Values Against Expectation

The name of the monitoring template.

TimeCost String 10

The time that was taken to run the monitoring task.

Trend String up

The trend of the monitoring result.

UpperValue Float 22200

The upper limit of the prediction result. The upper limit is automatically generated based on the threshold that you specified.

WarningThreshold Float 0.1

The warning threshold. The threshold indicates the deviation of monitoring results from expected values. You can customize this threshold based on your business requirements.

WhereCondition String type!='type2'

The filter condition of the monitoring rule.

TotalCount Long 200

The total number of entries returned.

ErrorCode String 401

The error code returned.

ErrorMessage String You have no permission.

The error message returned.

HttpStatusCode Integer 200

The HTTP status code.

RequestId String CBA58543-00D4-41****

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListQualityResultsByRule
&EndDate=2020-09-22 00:00:00
&PageNumber=1
&PageSize=10
&ProjectName=autotest
&RuleId=152322134
&StartDate=2020-09-20 00:00:00
&<Common request parameters>

Sample success responses

XML format

<RequestId>CBA58543-00D4-41****</RequestId>
<Data>
    <TotalCount>200</TotalCount>
    <PageSize>10</PageSize>
    <PageNumber>1</PageNumber>
    <RuleChecks>
        <Op>&amp;gt;</Op>
        <TaskId>16008552981681a0d6****</TaskId>
        <EndTime>1600704000000</EndTime>
        <DiscreteCheck>true</DiscreteCheck>
        <CheckerName>fulx</CheckerName>
        <ExpectValue>90</ExpectValue>
        <ProjectName>autotest</ProjectName>
        <RuleId>123421</RuleId>
        <WarningThreshold>0.1</WarningThreshold>
        <WhereCondition>type!='type2'</WhereCondition>
        <BeginTime>1600704000000</BeginTime>
        <CheckResultStatus>2</CheckResultStatus>
        <MatchExpression>ds=$[yyyymmdd]</MatchExpression>
        <UpperValue>22200</UpperValue>
        <IsPrediction>false</IsPrediction>
        <CheckResult>2</CheckResult>
        <TemplateName>Compare the Number of Unique Field Values Against Expectation</TemplateName>
        <TimeCost>10</TimeCost>
        <FixedCheck>false</FixedCheck>
        <MethodName>max</MethodName>
        <ResultString>ResultString</ResultString>
        <Property>type</Property>
        <DateType>YMD</DateType>
        <BizDate>1600704000000</BizDate>
        <TemplateId>5</TemplateId>
        <RuleName>Name of the monitoring rule</RuleName>
        <Comment>Description of the monitoring rule</Comment>
        <CriticalThreshold>0.6</CriticalThreshold>
        <ExternalId>123112232</ExternalId>
        <Trend>up</Trend>
        <CheckerType>0</CheckerType>
        <ExternalType>CWF2</ExternalType>
        <CheckerId>7</CheckerId>
        <EntityId>14534343</EntityId>
        <TableName>dual</TableName>
        <BlockType>1</BlockType>
        <Id>2231123</Id>
        <ActualExpression>ds=20200925</ActualExpression>
        <LowerValue>2344</LowerValue>
    </RuleChecks>
    <RuleChecks>
        <SampleValue>
            <SingleCheckResult>2</SingleCheckResult>
            <Value>20</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>type1</DiscreteProperty>
            <Threshold>0.2</Threshold>
        </SampleValue>
        <SampleValue>
            <Value>23</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>type2</DiscreteProperty>
        </SampleValue>
        <ReferenceValue>
            <SingleCheckResult>2</SingleCheckResult>
            <Value>20</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>type1</DiscreteProperty>
            <Threshold>0.2</Threshold>
        </ReferenceValue>
        <ReferenceValue>
            <Value>23</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>type2</DiscreteProperty>
        </ReferenceValue>
    </RuleChecks>
</QualityResults>

JSON format

{
    "RequestId": "CBA58543-00D4-41****",
    "QualityResults": {
        "TotalCount": 200,
        "PageSize": 10,
        "PageNumber": 1,
        "RuleChecks": [
            {
                "Op": "&gt;",
                "TaskId": "16008552981681a0d6****",
                "EndTime": 1600704000000,
                "DiscreteCheck": true,
                "CheckerName": "fulx",
                "ExpectValue": 90,
                "ProjectName": "autotest",
                "RuleId": 123421,
                "WarningThreshold": 0.1,
                "WhereCondition": "type!='type2'",
                "BeginTime": 1600704000000,
                "CheckResultStatus": 2,
                "MatchExpression": "ds=$[yyyymmdd]",
                "UpperValue": 22200,
                "IsPrediction": false,
                "CheckResult": 2,
                "TemplateName": "Compare the Number of Unique Field Values Against Expectation",
                "TimeCost": 10,
                "FixedCheck": false,
                "MethodName": "max",
                "ResultString": "ResultString",
                "Property": "type",
                "DateType": "YMD",
                "BizDate": 1600704000000,
                "TemplateId": 5,
                "RuleName":"Name of the monitoring rule",
                "Comment": "Description of the monitoring rule",
                "CriticalThreshold": 0.6,
                "ExternalId": 123112232,
                "Trend": "up",
                "CheckerType": 0,
                "ExternalType": "CWF2",
                "CheckerId": 7,
                "EntityId": 14534343,
                "TableName": "dual",
                "BlockType": 1,
                "Id": 2231123,
                "ActualExpression": "ds=20200925",
                "LowerValue": 2344
            },
            {
                "SampleValue": [
                    {
                        "SingleCheckResult": 2,
                        "Value": 20,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": "type1",
                        "Threshold": 0.2
                    },
                    {
                        "Value": 23,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": "type2"
                    }
                ],
                "ReferenceValue": [
                    {
                        "SingleCheckResult": 2,
                        "Value": 20,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": "type1",
                        "Threshold": 0.2
                    },
                    {
                        "Value": 23,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": "type2"
                    }
                ]
            }
        ]
    }
}

Error codes

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