Queries monitoring rules based on a partition filter expression.
Debugging
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 page number. |
PageSize | Integer | Yes | 20 | The number of entries per page. Valid values: 1 to 20. Default value: 10. |
ProjectId | Long | No | 12345 | The DataWorks workspace ID. |
Response parameters
Parameter | Type | Example | Description |
HttpStatusCode | Integer | 200 | The HTTP status code. |
RequestId | String | 38cbdef0-f6cf-49**** | The request ID. You can troubleshoot errors based on the ID. |
ErrorMessage | String | You have no permission. | The error message. |
Success | Boolean | true | Indicates whether the request was successful. Valid values:
|
ErrorCode | String | Invalid.Tenant.ConnectionNotExists | The error code. |
Data | Object | The list of monitoring rules. | |
PageNumber | Integer | 1 | The page number. |
PageSize | Integer | 20 | The number of entries per page. Valid values: 1 to 100. Default value: 10. |
TotalCount | Long | 400 | The total number of entries returned. |
Rules | Array of Rules | The details of the monitoring rule. | |
BlockType | Integer | 0 | The strength of the monitoring rule. The strength of a monitoring rule indicates the importance of the rule. Valid values:
|
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 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 task 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 task on the first, seventh, and thirtieth days | The name of the monitoring template. |
Trend | String | abs | The trend of the monitoring result. |
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:
|
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 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. |
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. |
Id | Integer | 1234 | The ID of the monitoring rule. |
RuleName | String | test | The name of the monitoring rule. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListQualityRules
&ProjectName=autotest
&EntityId=1234
&PageNumber=1
&PageSize=20
&ProjectId=12345
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListQualityRulesResponse>
<HttpStatusCode>200</HttpStatusCode>
<RequestId>38cbdef0-f6cf-49****</RequestId>
<ErrorMessage>You have no permission.</ErrorMessage>
<Success>true</Success>
<ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
<Data>
<PageNumber>1</PageNumber>
<PageSize>20</PageSize>
<TotalCount>400</TotalCount>
<Rules>
<BlockType>0</BlockType>
<OnDutyAccountName>test</OnDutyAccountName>
<Property>id</Property>
<WarningThreshold>10</WarningThreshold>
<TableName>dual</TableName>
<OnDuty>1912****</OnDuty>
<Comment>Monitoring rule for a table</Comment>
<RuleCheckerRelationId>132323</RuleCheckerRelationId>
<FixCheck>true</FixCheck>
<MethodId>21</MethodId>
<TemplateName>Check for the fluctuations of table rows on an SQL task on the first, seventh, and thirtieth days</TemplateName>
<Trend>abs</Trend>
<HistoryWarningThreshold>history max:40%,history min:10%</HistoryWarningThreshold>
<RuleType>0</RuleType>
<MatchExpression>dt=$[yyyymmdd]</MatchExpression>
<ProjectName>autotest</ProjectName>
<PropertyKey>table_count</PropertyKey>
<CriticalThreshold>40</CriticalThreshold>
<HistoryCriticalThreshold>history max:80%,history min:50%</HistoryCriticalThreshold>
<MethodName>count/table_count</MethodName>
<CheckerId>7</CheckerId>
<EntityId>1234</EntityId>
<ExpectValue>1000</ExpectValue>
<TemplateId>7</TemplateId>
<Id>1234</Id>
<RuleName>test</RuleName>
</Rules>
</Data>
</ListQualityRulesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"HttpStatusCode" : 200,
"RequestId" : "38cbdef0-f6cf-49****",
"ErrorMessage" : "You have no permission.",
"Success" : true,
"ErrorCode" : "Invalid.Tenant.ConnectionNotExists",
"Data" : {
"PageNumber" : 1,
"PageSize" : 20,
"TotalCount" : 400,
"Rules" : {
"BlockType" : 0,
"OnDutyAccountName" : "test",
"Property" : "id",
"WarningThreshold" : 10,
"TableName" : "dual",
"OnDuty" : "1912****",
"Comment": "Monitoring rule for a table",
"RuleCheckerRelationId" : 132323,
"FixCheck" : true,
"MethodId" : 21,
"TemplateName": "Check for the fluctuations of table rows on an SQL task on the first, seventh, and thirtieth days",
"Trend" : "abs",
"HistoryWarningThreshold" : "history max:40%,history min:10%",
"RuleType" : 0,
"MatchExpression" : "dt=$[yyyymmdd]",
"ProjectName" : "autotest",
"PropertyKey" : "table_count",
"CriticalThreshold" : 40,
"HistoryCriticalThreshold" : "history max:80%,history min:50%",
"MethodName" : "count/table_count",
"CheckerId" : 7,
"EntityId" : 1234,
"ExpectValue" : 1000,
"TemplateId" : 7,
"Id" : 1234,
"RuleName" : "test"
}
}
}
Error codes
For a list of error codes, see Service error codes.