Queries monitoring rules 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 ListQualityRules

The operation that you want to perform.

EntityId Long Yes 1234

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

PageNumber Integer Yes 1

The number of the page to return.

PageSize Integer Yes 20

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

ProjectName String Yes autotest

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

RegionId String Yes cn-shanghai

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 list of monitoring rules.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 20

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

Rules Array of Rules

The details of the monitoring rule.

BlockType Integer 0

The type of the monitoring rule. The strength of monitoring rules indicates the importance of the rules. 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 strong rule is used and a critical alert is reported, nodes are blocked.

CheckerId Integer 7

The ID of the checker.

Comment String Monitoring rule for a table

The description of the monitoring rule.

CriticalThreshold String 40

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

EntityId Integer 1234

The ID of the partition filter expression.

ExpectValue String 1000

The expected value.

FixCheck Boolean true

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

HistoryCriticalThreshold String history max:80%,history min:50%

The historical threshold for a critical alert.

HistoryWarningThreshold String history max:40%,history min:10%

The historical threshold for a warning alert.

Id Integer 1234

The ID of the monitoring rule.

MatchExpression String dt=$[yyyymmdd]

The partition filter expression.

MethodId Integer 21

The ID of the sampling method of the monitoring rule.

MethodName String count/table_count

The name of the sampling method of the monitoring rule, 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, and table_count-count_distinct.

OnDuty String 1912****

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

OnDutyAccountName String test

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

ProjectName String autotest

The name of the compute engine or data source.

Property String id

The field that is monitored.

PropertyKey String table_count

The type of the field. This parameter can be ignored.

RuleCheckerRelationId Integer 132323

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

RuleType Integer 0

The type of the monitoring rule. Valid values:

  • 0: The monitoring rule is created by the system.
  • 1: The monitoring rule is created by a user.
  • 2: The monitoring rule is a project-level rule.
TableName String dual

The name of the table.

TemplateId Integer 7

The ID of the monitoring template.

TemplateName String Check for fluctuations of table rows on an SQL node on the first, seventh, and thirtieth day

The name of the monitoring template.

Trend String abs

The trend of the monitoring results.

WarningThreshold String 10

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

TotalCount Long 400

The total number of entries returned.

ErrorCode String Invalid.Tenant.ConnectionNotExists

The error code returned.

ErrorMessage String You have no permission.

The error message returned.

HttpStatusCode Integer 200

The HTTP status code returned.

RequestId String 38cbdef0-f6cf-49****

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListQualityRules
&EntityId=1234
&PageNumber=1
&PageSize=20
&ProjectName=autotest
&RegionId=cn-shanghai
&<Common request parameters>

Sample success responses

XML format

<RequestId>38cbdef0-f6cf-49****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>
    <TotalCount>400</TotalCount>
    <PageSize>20</PageSize>
    <PageNumber>1</PageNumber>
    <Rules>
        <HistoryCriticalThreshold>history max:80%,history min:50%</HistoryCriticalThreshold>
        <Comment>Monitoring rule for a table</Comment>
        <HistoryWarningThreshold>history max:40%,history min:10%</HistoryWarningThreshold>
        <RuleCheckerRelationId>132323</RuleCheckerRelationId>
        <CriticalThreshold>40</CriticalThreshold>
        <ProjectName>autotest</ProjectName>
        <ExpectValue>1000</ExpectValue>
        <WarningThreshold>10</WarningThreshold>
        <OnDuty>1912****</OnDuty>
        <OnDutyAccountName>test</OnDutyAccountName>
        <Trend>abs</Trend>
        <RuleType>0</RuleType>
        <CheckerId>7</CheckerId>
        <MatchExpression>dt=$[yyyymmdd]</MatchExpression>
        <EntityId>1234</EntityId>
        <TableName>dual</TableName>
        <MethodId>21</MethodId>
        <FixCheck>true</FixCheck>
        <BlockType>0</BlockType>
        <TemplateName>Check for fluctuations of table rows on an SQL node on the first, seventh, and thirtieth day</TemplateName>
        <Id>1234</Id>
        <MethodName>count/table_count</MethodName>
        <Property>id</Property>
        <TemplateId>7</TemplateId>
        <PropertyKey>table_count</PropertyKey>
    </Rules>
</Data>
<ErrorCode>401</ErrorCode>
<ErrorMessage>You have no permission.</ErrorMessage>
<Success>true</Success>

JSON format

{
    "RequestId": "38cbdef0-f6cf-49****",
    "HttpStatusCode": 200,
    "Data": {
        "TotalCount": 400,
        "PageSize": 20,
        "PageNumber": 1,
        "Rules": {
            "HistoryCriticalThreshold": "history max:80%,history min:50%",
            "Comment": "Monitoring rule for a table",
            "HistoryWarningThreshold": "history max:40%,history min:10%",
            "RuleCheckerRelationId": 132323,
            "CriticalThreshold": 40,
            "ProjectName": "autotest",
            "ExpectValue": 1000,
            "WarningThreshold": 10,
            "OnDuty": "1912****",
            "OnDutyAccountName": "test",
            "Trend": "abs",
            "RuleType": 0,
            "CheckerId": 7,
            "MatchExpression": "dt=$[yyyymmdd]",
            "EntityId": 1234,
            "TableName": "dual",
            "MethodId": 21,
            "FixCheck": true,
            "BlockType": 0,
            "TemplateName": "Check for fluctuations of table rows on an SQL node on the first, seventh, and thirtieth day",
            "Id": 1234,
            "MethodName": "count/table_count",
            "Property": "id",
            "TemplateId": 7,
            "PropertyKey": "table_count"
        }
    },
    "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
    "ErrorMessage": "You have no permission.",
    "Success": true
}

Error codes

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