Queries the historical monitoring results based on a partition filter expression.

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 ListQualityResultsByEntity

The operation that you want to perform. Set the value to ListQualityResultsByEntity.

EntityId Integer Yes 152322134

The ID of the partition filter expression. You can call the GetQualityEntity operation to query the ID of the partition filter expression.

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.

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

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

PageSize Integer Yes 10

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

PageNumber Integer Yes 1

The number of the page to return.

ProjectName String Yes autotest

The name of the compute engine instance or data source. You can obtain the name from data source configurations.

Response parameters

Parameter Type Example Description
HttpStatusCode Integer 200

The HTTP status code returned.

ErrorMessage String You have no permission.

The error message returned.

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

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

ErrorCode String 401

The error code returned.

Data Object

The data structure of the monitoring results returned.

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.

TotalCount Long 50

The total number of entries returned.

RuleChecks Array of RuleChecks

The monitoring results returned.

BlockType Integer 0

The type of the monitoring rule. The type 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 whether a monitoring rule is a strong rule based on your business requirements. If a strong rule is used and a critical alert is triggered, nodes are blocked.

WarningThreshold Float 0.1

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

Property String type

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

TableName String dual

The name of the table that is monitored.

Comment String Test rule

The description of the monitoring rule.

CheckResultStatus Integer 0

The check result of the monitoring rule. Valid values:

  • 0: indicates that the data source table is normal.
  • 1: indicates that a warning alert is reported.
  • 2: indicates that a critical alert is reported.
TemplateName String Compare the Number of Unique Field Values Against Expectation

The name of the monitoring template.

CheckerName String fulx

The name of the checker.

RuleId Integer 123123232

The ID of the monitoring rule.

FixedCheck Boolean false

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

  • true: indicates that the monitoring is performed based on a fixed value.
  • false: indicates that the monitoring is performed based on a non-fixed value.
Op String >

The comparison operator.

UpperValue Float 25555

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

ActualExpression String ds=20200912

The partition in the monitored data source table.

ExternalId String 1112323123

The ID of the node.

TimeCost String 202

The time that was taken to run the monitoring task. Unit: seconds.

Trend String abs

The trend of the monitoring result.

ExternalType String CWF2

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

BizDate Long 1600704000000

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

CheckResult Integer 0

The monitoring result. The value of this parameter is the same as the value of the CheckResultStatus parameter. Valid values:

  • 0: indicates that the data source table is normal.
  • 1: indicates that a warning alert is reported.
  • 2: indicates that a critical alert is reported.
ResultString String test

The string of the monitoring result.

MatchExpression String ds=$[yyyymmdd]

The partition filter expression.

CheckerType Integer 1

The monitoring type. Valid values:

  • 1: VOLATILITY_CHECK
  • 2: FIXEDVALUE_CHECK
ProjectName String autotest

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

BeginTime Long 1600704000000

The time when the monitoring started.

DateType String YMD

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

CriticalThreshold Float 0.5

The threshold for a critical alert. 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 a critical alert is reported, nodes are blocked.

IsPrediction Boolean true

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

  • true: indicates that the monitoring result is the same as the predicted result.
  • false: indicates that the monitoring result is different from the predicted result.
RuleName String Test

The name of the monitoring rule.

CheckerId Integer 7

The ID of the checker.

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 time when the monitoring ended.

MethodName String count_distinct

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.

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.

EntityId Integer 15432322

The ID of the partition filter expression.

WhereCondition String id>0

The filter condition of the monitoring rule.

ExpectValue Float 200

The expected value.

TemplateId Integer 5

The ID of the monitoring template.

TaskId String 16008552981681a0d6****

The ID of the monitoring task.

Id Integer 121212121

The ID of the primary key.

ReferenceValue Array of ReferenceValue

The historical sample values.

DiscreteProperty String 0

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.

Value Float 19

The check value.

BizDate String 2020-12-03

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

SingleCheckResult Integer 0

The monitoring result.

Threshold Float 0.5

The threshold.

SampleValue Array of SampleValue

The sample values.

DiscreteProperty String 0

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.

BizDate String 2020-12-03

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

Value Float 19

The current sample value.

Examples

Sample requests

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

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListQualityResultsByEntityResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <ErrorMessage>You have no permission.</ErrorMessage>
    <RequestId>CBA58543-00D4-41****</RequestId>
    <Success>true</Success>
    <ErrorCode>401</ErrorCode>
    <Data>
        <PageNumber>1</PageNumber>
        <PageSize>10</PageSize>
        <TotalCount>50</TotalCount>
        <RuleChecks>
            <BlockType>0</BlockType>
            <WarningThreshold>0.1</WarningThreshold>
            <Property>type</Property>
            <TableName>dual</TableName>
            <Comment>Test rule </Comment>
            <CheckResultStatus>0</CheckResultStatus>
            <TemplateName>Compare the Number of Unique Field Values Against Expectation</TemplateName>
            <CheckerName>fulx</CheckerName>
            <RuleId>123123232</RuleId>
            <FixedCheck>false</FixedCheck>
            <Op>&gt;</Op>
            <UpperValue>25555</UpperValue>
            <ActualExpression>ds=20200912</ActualExpression>
            <ExternalId>1112323123</ExternalId>
            <TimeCost>202</TimeCost>
            <Trend>abs</Trend>
            <ExternalType>CWF2</ExternalType>
            <BizDate>1600704000000</BizDate>
            <CheckResult>0</CheckResult>
            <ResultString>test</ResultString>
            <MatchExpression>ds=$[yyyymmdd]</MatchExpression>
            <CheckerType>1</CheckerType>
            <ProjectName>autotest</ProjectName>
            <BeginTime>1600704000000</BeginTime>
            <DateType>YMD</DateType>
            <CriticalThreshold>0.5</CriticalThreshold>
            <IsPrediction>true</IsPrediction>
            <RuleName>Test </RuleName>
            <CheckerId>7</CheckerId>
            <DiscreteCheck>true</DiscreteCheck>
            <EndTime>1600704000000</EndTime>
            <MethodName>count_distinct</MethodName>
            <LowerValue>2344</LowerValue>
            <EntityId>15432322</EntityId>
            <WhereCondition>id&gt;0</WhereCondition>
            <ExpectValue>200</ExpectValue>
            <TemplateId>5</TemplateId>
            <TaskId>16008552981681a0d6****</TaskId>
            <Id>121212121</Id>
            <ReferenceValue>
                <DiscreteProperty>0</DiscreteProperty>
                <Value>19</Value>
                <BizDate>2020-12-03</BizDate>
                <SingleCheckResult>0</SingleCheckResult>
                <Threshold>0.5</Threshold>
            </ReferenceValue>
            <SampleValue>
                <DiscreteProperty>0</DiscreteProperty>
                <BizDate>2020-12-03</BizDate>
                <Value>19</Value>
            </SampleValue>
        </RuleChecks>
    </Data>
</ListQualityResultsByEntityResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "HttpStatusCode" : 200,
  "ErrorMessage" : "You have no permission.",
  "RequestId" : "CBA58543-00D4-41****",
  "Success" : true,
  "ErrorCode" : 401,
  "Data" : {
    "PageNumber" : 1,
    "PageSize" : 10,
    "TotalCount" : 50,
    "RuleChecks" : {
      "BlockType" : 0,
      "WarningThreshold" : 0.1,
      "Property" : "type",
      "TableName" : "dual",
      "Comment": "Test rule",
      "CheckResultStatus" : 0,
      "TemplateName": "Compare the Number of Unique Field Values Against Expectation",
      "CheckerName" : "fulx",
      "RuleId" : 123123232,
      "FixedCheck" : false,
      "Op" : "&gt;",
      "UpperValue" : 25555,
      "ActualExpression" : "ds=20200912",
      "ExternalId" : 1112323123,
      "TimeCost" : 202,
      "Trend" : "abs",
      "ExternalType" : "CWF2",
      "BizDate" : 1600704000000,
      "CheckResult" : 0,
      "ResultString" : "test",
      "MatchExpression" : "ds=$[yyyymmdd]",
      "CheckerType" : 1,
      "ProjectName" : "autotest",
      "BeginTime" : 1600704000000,
      "DateType" : "YMD",
      "CriticalThreshold" : 0.5,
      "IsPrediction" : true,
      "RuleName" : "Test",
      "CheckerId" : 7,
      "DiscreteCheck" : true,
      "EndTime" : 1600704000000,
      "MethodName" : "count_distinct",
      "LowerValue" : 2344,
      "EntityId" : 15432322,
      "WhereCondition" : "id&gt;0",
      "ExpectValue" : 200,
      "TemplateId" : 5,
      "TaskId" : "16008552981681a0d6****",
      "Id" : 121212121,
      "ReferenceValue" : {
        "DiscreteProperty" : 0,
        "Value" : 19,
        "BizDate" : "2020-12-03",
        "SingleCheckResult" : 0,
        "Threshold" : 0.5
      },
      "SampleValue" : {
        "DiscreteProperty" : 0,
        "BizDate" : "2020-12-03",
        "Value" : 19
      }
    }
  }
}

Error codes

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