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. Set the value to ListQualityRules.

ProjectName String Yes autotest

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

EntityId Long Yes 1234

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

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.

ProjectId Long No 12345

The ID of the workspace.

Response parameters

Parameter Type Example Description
HttpStatusCode Integer 200

The HTTP status code.

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

The ID of the request. You can use the ID to troubleshoot errors.

ErrorMessage String You have no permission.

The error message.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
ErrorCode String Invalid.Tenant.ConnectionNotExists

The error code.

Data Object

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.

TotalCount Long 400

The total number of returned entries.

Rules Array of Rules

The details of the monitoring rules.

BlockType Integer 0

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

OnDutyAccountName String test

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

Property String id

The name of the monitored field.

WarningThreshold String 10

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.

TableName String dual

The name of the table.

OnDuty String 1912****

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

Comment String Monitoring rule for a table

The description of the monitoring rule.

RuleCheckerRelationId Integer 132323

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

FixCheck Boolean true

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

MethodId Integer 21

The ID of the sampling method of the monitoring rule.

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

The name of the monitoring template.

Trend String abs

The trend of the monitoring results.

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

The historical threshold for a warning alert.

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 workspace-level rule.
MatchExpression String dt=$[yyyymmdd]

The partition filter expression.

ProjectName String autotest

The name of the compute engine instance or data source.

PropertyKey String table_count

The field that is used to associate with monitoring rules at the frontend. This parameter can be ignored.

CriticalThreshold String 40

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.

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

The historical threshold for a critical alert.

MethodName String count/table_count

The name of 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.

CheckerId Integer 7

The ID of the checker.

EntityId Integer 1234

The ID of the partition filter expression.

ExpectValue String 1000

The expected value.

TemplateId Integer 7

The ID of the monitoring template that is used to create the monitoring rule.

Id Integer 1234

The ID of the monitoring rule.

RuleName String test

The name of the scheduling rule.

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

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

<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>
        <HistoryWarningThreshold>history max:40%,history min:10%</HistoryWarningThreshold>
        <RuleCheckerRelationId>132323</RuleCheckerRelationId>
        <ExpectValue>1000</ExpectValue>
        <ProjectName>autotest</ProjectName>
        <WarningThreshold>10</WarningThreshold>
        <OnDuty>1912****</OnDuty>
        <MatchExpression>dt=$[yyyymmdd]</MatchExpression>
        <MethodId>21</MethodId>
        <TemplateName>Check for the fluctuations of table rows on an SQL node on the first, seventh, and thirtieth days</TemplateName>
        <MethodName>count/table_count</MethodName>
        <Property>id</Property>
        <RuleName>test</RuleName>
        <TemplateId>7</TemplateId>
        <Comment>Monitoring rule for a table</Comment>
        <CriticalThreshold>40</CriticalThreshold>
        <Trend>abs</Trend>
        <RuleType>0</RuleType>
        <CheckerId>7</CheckerId>
        <EntityId>1234</EntityId>
        <TableName>dual</TableName>
        <FixCheck>true</FixCheck>
        <BlockType>0</BlockType>
        <OnDutyAccountName>test</OnDutyAccountName>
        <Id>1234</Id>
        <PropertyKey>table_count</PropertyKey>
    </Rules>
</Data>
<ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
<ErrorMessage>You have no permission.</ErrorMessage>
<Success>true</Success>

JSON format

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

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

Error codes

For a list of error codes, see Service error codes.