GetQualityRule

Updated at:

Queries the information about a quality rule.

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

RuleId

integer

Yes

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

1234

ProjectName

string

Yes

The name of the engine or data source.

autotest

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.

576b9457-2cf5-4****

ErrorMessage

string

The error message.

You have no permission.

ErrorCode

string

The error code.

401

Success

boolean

Indicates whether the call was successful.

true

Data

object

The quality rule information.

BlockType

integer

The strength 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 used and a red alert is triggered, the scheduling node is blocked.

1

OnDutyAccountName

string

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

test

WarningThreshold

string

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

10

Property

string

The name of the column checked by the rule in the data source table.

id

RuleType

integer

The type of the rule. Valid values:

  • 0: system template rule.

  • 1: custom SQL rule.

  • 4: custom template rule.

0

Comment

string

The description of the quality rule.

Verify that the primary key is unique

OnDuty

string

The ID of the account that configured the quality rule.

1822931****

Checker

integer

The ID of the checker. This field corresponds to the frontend ID and must be converted from the pkId.

9

FixCheck

boolean

The fixed value check.

true

MethodId

integer

The ID of the method used to collect sample data.

8

CriticalThreshold

string

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

20

PredictType

integer

Indicates whether the threshold is dynamic. Valid values:

  • 0: non-dynamic threshold.

  • 1: dynamic threshold.

0

TemplateName

string

The name of the check template used.

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

CheckerName

string

The name of the checker.

compared with a fixed value

RuleName

string

The name of the rule.

View table fluctuations

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.

table_count

EntityId

integer

The ID of the partition expression.

165523

WhereCondition

string

The filter condition or custom SQL statement used by the check node.

id>10

Operator

string

The operator.

>=

ExpectValue

string

The expected value.

30

Trend

string

The trend of the check result.

abs

TemplateId

integer

The ID of the check template used.

7

Id

integer

The ID of the rule.

123232

OpenSwitch

boolean

Indicates whether the rule is enabled.

true

TaskSetting

string

The variable settings inserted before the custom rule. Format: x=a,y=b.

x=a,y=b

Examples

Success response

JSON format

{
  "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": "Verify that the primary key is unique",
    "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 table fluctuations",
    "MethodName": "table_count",
    "EntityId": 165523,
    "WhereCondition": "id>10",
    "Operator": ">=",
    "ExpectValue": "30",
    "Trend": "abs",
    "TemplateId": 7,
    "Id": 123232,
    "OpenSwitch": true,
    "TaskSetting": "x=a,y=b\n"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.