All Products
Search
Document Center

:GetQualityRule

更新時間:May 21, 2024

Queries the information about 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. Set the value to GetQualityRule.

RuleId

Long

Yes

1234

The ID of the monitoring rule. You can call the ListQualityRules operation to query the ID.

ProjectName

String

Yes

autotest

The name of the compute engine instance or data source.

ProjectId

Long

Yes

12345

The workspace ID.

Response parameters

Parameter

Type

Example

Description

HttpStatusCode

Integer

200

The HTTP status code.

RequestId

String

576b9457-2cf5-4****

The request ID.

ErrorMessage

String

You have no permission.

The error message.

ErrorCode

String

401

The error code.

Success

Boolean

true

Indicates whether the request was successful.

Data

Object

The information about the monitoring rule.

BlockType

Integer

1

The strength of the monitoring rule. The strength 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 monitoring rule is a strong rule and the critical threshold is exceeded, a critical alert is reported and tasks that are associated with the rule are blocked from running.

OnDutyAccountName

String

test

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

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.

Property

String

id

The field whose data quality is checked based on the monitoring rule. This field is a column in the data source table that is monitored.

RuleType

Integer

0

The type of the monitoring rule.

Comment

String

Unique primary key verification

The description of the monitoring rule.

OnDuty

String

1822931****

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

Checker

Integer

9

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

FixCheck

Boolean

true

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

MethodId

Integer

8

The ID of the sampling method of the monitoring rule.

CriticalThreshold

String

20

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 monitoring rule is a strong rule and the critical threshold is exceeded, a critical alert is reported and tasks that are associated with the rule are blocked from running.

PredictType

Integer

0

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

  • 0: indicates that the threshold is not a dynamic threshold.

  • 1: indicates that the threshold is a dynamic threshold.

TemplateName

String

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

The name of the monitoring template.

CheckerName

String

compared with a fixed value

The name of the checker.

RuleName

String

View fluctuations in a table

The name of the monitoring rule.

MethodName

String

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.

EntityId

Long

165523

The ID of the partition filter expression.

WhereCondition

String

id>10

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

Operator

String

>=

The comparison operator of the monitoring rule.

ExpectValue

String

30

The expected value.

Trend

String

abs

The trend of the monitoring result.

TemplateId

Integer

7

The ID of the monitoring template.

Id

Long

123232

The monitoring rule ID.

OpenSwitch

Boolean

true

Indicates whether the monitoring rule is enabled.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetQualityRule
&RuleId=1234
&ProjectName=autotest
&ProjectId=12345
&<Common request parameters>

Sample success responses

XML format

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

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

JSON format

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

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

Error codes

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