ListQualityRules

Updated at:

Queries the list of quality rules based on a partition expression.

Note

This API has been deprecated. We recommend migrating to dataworks-public(2024-05-18) - GetDataQualityScan for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:*

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectName

string

Yes

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

autotest

EntityId

integer

Yes

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

12345

PageNumber

integer

Yes

The page number.

1

PageSize

integer

Yes

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

20

ProjectId

integer

No

The ID of the DataWorks workspace.

12345

Response elements

Element

Type

Description

Example

object

The response structure.

HttpStatusCode

integer

The HTTP status code.

200

RequestId

string

The request ID, which is used for troubleshooting.

38cbdef0-f6cf-49****

ErrorMessage

string

The error message.

You have no permission.

Success

boolean

Specifies whether the call was successful. Valid values:

  • true: The call was successful.

  • false: The call failed.

true

ErrorCode

string

The error code.

Invalid.Tenant.ConnectionNotExists

Data

object

The list of rules.

PageNumber

integer

The page number.

1

PageSize

integer

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

20

TotalCount

integer

The total number of returned entries.

400

Rules

array<object>

The details of the quality rules.

object

The data structure of the returned rule.

BlockType

integer

The severity of the quality rule, which indicates the importance of the rule. Valid values:

  • 1: Strong rule.

  • 0: Weak rule. You can set important rules as strong rules based on your business requirements. If a strong rule is triggered and a red alert is generated, the scheduled task is blocked.

0

OnDutyAccountName

string

The name of the Alibaba Cloud account that configured the quality rule.

test

Property

string

The name of the field.

id

WarningThreshold

string

The orange alert threshold. This threshold indicates the deviation from the expected value of the sample. You can customize alert threshold based on your business requirements.

10

TableName

string

The name of the table.

dual

OnDuty

string

The ID of the account that configured the quality rule.

1912****

Comment

string

The description of the rule.

Verify table rules

RuleCheckerRelationId

integer

The internal association ID of the rule details.

132323

FixCheck

boolean

The fixed value check.

true

MethodId

integer

The ID of the method used to collect sample data.

21

TemplateName

string

The name of the quality rule template used.

Number of SQL task table rows, 1, 7, and 30 days wave detection

Trend

string

The trend of the check result.

abs

HistoryWarningThreshold

string

The historical orange alert threshold.

history max:40%,history min:10%

RuleType

integer

The type of the rule. Valid values:

  • 0: System template rule.

  • 1: Custom SQL rule.

  • 4: Custom template rule.

0

MatchExpression

string

The partition expression.

dt=$[yyyymmdd]

ProjectName

string

The name of the engine or data source.

autotest

PropertyKey

string

The property key used for frontend rule linkage in Data Quality. You can ignore this field.

table_count

CriticalThreshold

string

The red alert threshold. This threshold indicates the deviation from the expected value of the sample. You can customize this threshold based on your business requirements. If a strong rule is used and the alert threshold is triggered, the scheduling node is blocked.

40

HistoryCriticalThreshold

string

The historical red alert threshold.

history max:80%,history min:50%

MethodName

string

The name of the method used to collect sample data. Valid values include 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.

count/table_count

CheckerId

integer

The ID of the checker.

7

EntityId

integer

The ID of the partition expression.

1234

ExpectValue

string

The expected value.

1000

TemplateId

integer

The ID of the quality rule template used.

7

Id

integer

The ID of the rule.

1234

RuleName

string

The name of the rule.

test

Examples

Success response

JSON format

{
  "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": "Verify table rules",
        "RuleCheckerRelationId": 132323,
        "FixCheck": true,
        "MethodId": 21,
        "TemplateName": "Number of SQL task table rows, 1, 7, and 30 days wave detection",
        "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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.