Queries the information of a monitoring rule.

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 GetQualityRule

The operation that you want to perform.

ProjectName String Yes autotest

The name of the compute engine or data source.

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.

RuleId Long Yes 1234

The ID of the monitoring rule.

Response parameters

Parameter Type Example Description
Data Struct

The information of the monitoring rule.

BlockType Integer 1

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.

Checker Integer 9

The ID of the checker. The value of this parameter corresponds to the ID at the frontend and is converted from the lD of the primary key.

CheckerName String compared with a fixed value

The name of the checker.

Comment String Unique primary key verification

The description of the monitoring rule.

CriticalThreshold String 20

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 Long 165523

The ID of the partition filter expression.

ExpectValue String 30

The expected value.

FixCheck Boolean true

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

Id Long 123232

The ID of the monitoring rule.

MethodId Integer 8

The ID of the sampling method of the monitoring rule.

MethodName String 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 1822931****

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.

Operator String >=

The comparison operator of the monitoring rule.

PredictType Integer 0

Indicates whether the threshold is a dynamic threshold. Valid values:

  • 0: The threshold is not a dynamic threshold.
  • 1: The threshold is a dynamic threshold.
Property String id

The field that is monitored. This field is a column name in the data source table that is monitored.

RuleName String View fluctuations in a table

The name of the monitoring rule.

RuleType Integer 0

The type of the monitoring rule.

TemplateId Integer 7

The ID of the monitoring template.

TemplateName String SQL task table rows, 1,7, 30 days fluctuation test

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.

WhereCondition String id>10

The filter condition or custom SQL statement that is used for monitoring.

ErrorCode String 401

The error code returned.

ErrorMessage String You have no permission.

The error message returned.

HttpStatusCode Integer 200

The HTTP status code returned.

RequestId String 576b9457-2cf5-4****

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetQualityRule
&ProjectName=autotest
&RegionId=cn-shanghai
&RuleId=1234
&<Common request parameters>

Sample success responses

XML format

<RequestId>576b9457-2cf5-4***</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>
    <Operator>&gt;&amp;gt;=</Operator>
    <Comment>Unique primary key verification</Comment>
    <Checker>9</Checker>
    <CriticalThreshold>20</CriticalThreshold>
    <CheckerName>compared with a fixed value</CheckerName>
    <ExpectValue>30</ExpectValue>
    <WarningThreshold>10</WarningThreshold>
    <OnDuty>1822931****</OnDuty>
    <OnDutyAccountName>test</OnDutyAccountName>
    <Trend>abs</Trend>
    <WhereCondition>id&amp;gt;10</WhereCondition>
    <RuleType>0</RuleType>
    <EntityId>165523</EntityId>
    <MethodId>8</MethodId>
    <FixCheck>true</FixCheck>
    <BlockType>1</BlockType>
    <TemplateName>SQL task table rows, 1,7, 30 days fluctuation test</TemplateName>
    <PredictType>0</PredictType>
    <Id>123232</Id>
    <MethodName>table_count</MethodName>
    <Property>id</Property>
    <TemplateId>7</TemplateId>
    <RuleName>View fluctuations in a table</RuleName>
</Data>
<ErrorCode>401</ErrorCode>
<ErrorMessage>You have no permission.</ErrorMessage>
<Success>true</Success>

JSON format

{
    "RequestId": "576b9457-2cf5-4***",
    "HttpStatusCode": 200,
    "Data": {
        "Operator": ">&gt;=",
        "Comment": "Unique primary key verification",
        "Checker": 9,
        "CriticalThreshold": 20,
        "CheckerName": "compared with a fixed value",
        "ExpectValue": 30,
        "WarningThreshold": 10,
        "OnDuty": "1822931****",
        "OnDutyAccountName": "test",
        "Trend": "abs",
        "WhereCondition": "id&gt;10",
        "RuleType": 0,
        "EntityId": 165523,
        "MethodId": 8,
        "FixCheck": true,
        "BlockType": 1,
        "TemplateName": "SQL task table rows, 1,7, 30 days fluctuation test",
        "PredictType": 0,
        "Id": 123232,
        "MethodName": "table_count",
        "Property": "id",
        "TemplateId": 7,
        "RuleName": "View fluctuations in a table"
    },
    "ErrorCode": 401,
    "ErrorMessage": "You have no permission.",
    "Success": true
}

Error codes

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