ListQualityRules - 根据分区表达式获取规则列表

更新时间:
复制为 MD 格式

调用ListQualityRules根据分区表达式获取校验规则列表。

说明

目前该API接口已标记为弃用,推荐使用替代API:dataworks-public(2024-05-18) - GetDataQualityScan

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

ProjectName

string

引擎或者数据源的名称。您可以从数据源配置中获取名称。

autotest

EntityId

integer

分区表达式的 ID。您可以调用 GetQualityEntity 获取分区表达式 ID。

12345

PageNumber

integer

页码数。

1

PageSize

integer

每页显示的条数,默认为 10 条,最大为 20 条。

20

ProjectId

integer

DataWorks 项目空间 ID

12345

返回参数

名称

类型

描述

示例值

object

返回数据结构。

HttpStatusCode

integer

HTTP 返回码。

200

RequestId

string

请求 ID,用于后续错误排查使用。

38cbdef0-f6cf-49****

ErrorMessage

string

错误信息。

You have no permission.

Success

boolean

调用是否成功,取值如下:

  • true:调用成功。

  • false:调用失败。

true

ErrorCode

string

错误码。

Invalid.Tenant.ConnectionNotExists

Data

object

获取的规则列表。

PageNumber

integer

页码数。

1

PageSize

integer

每页显示的条数,默认为 10 条,最大为 100 条。

20

TotalCount

integer

返回数据总量。

400

Rules

array<object>

校验规则的详情。

object

返回数据结构。

BlockType

integer

校验规则的强弱。强弱表示规则的重要程度。取值如下:

  • 1,表示强规则。

  • 0,表示弱规则。 您可以根据实际需求设置重要的规则为强规则。如果使用强规则并触发了红色告警,则会阻塞调度任务。

0

OnDutyAccountName

string

配置校验规则的阿里云账号名称。

test

Property

string

字段的名称。

id

WarningThreshold

string

橙色告警阈值。表示与样本预期的偏离程度,您可以根据业务需求自定义该阈值。

10

TableName

string

表的名称。

dual

OnDuty

string

配置校验规则的账号 ID。

1912****

Comment

string

规则的描述信息。

Verify table rules

RuleCheckerRelationId

integer

规则详情的内部关联 ID。

132323

FixCheck

boolean

固定值校验。

true

MethodId

integer

采集样本数据方法的 ID。

21

TemplateName

string

使用的校验模板的名称。

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

Trend

string

校验结果的趋势。

abs

HistoryWarningThreshold

string

历史橙色告警阈值。

history max:40%,history min:10%

RuleType

integer

规则的类型:

  • 0:系统模板规则

  • 1:自定义 SQL 规则

  • 4:自定义模板规则

0

MatchExpression

string

分区表达式。

dt=$[yyyymmdd]

ProjectName

string

引擎或者数据源的名称。

autotest

PropertyKey

string

用于数据质量前端规则联动,可以忽略。

table_count

CriticalThreshold

string

红色告警阈值。表示与样本预期的偏离程度。您可以根据业务需求自定义该阈值。使用强规则并触发红色阈值,会阻塞调度任务。

40

HistoryCriticalThreshold

string

历史红色告警阈值。

history max:80%,history min:50%

MethodName

string

采集样本数据方法的名称。包括 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、table_count-count_distinct 等。

count/table_count

CheckerId

integer

校验器 ID。

7

EntityId

integer

分区表达式的 ID。

1234

ExpectValue

string

期望值。

1000

TemplateId

integer

使用的校验模板的 ID。

7

Id

integer

规则的 ID。

1234

RuleName

string

规则名称。

test

示例

正常返回示例

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": "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"
      }
    ]
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情