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

更新时间:2025-02-19 02:34:31

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

调试

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

授权信息

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

请求参数

名称类型必填描述示例值
名称类型必填描述示例值
ProjectNamestring

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

autotest
EntityIdlong

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

12345
PageNumberinteger

页码数。

1
PageSizeinteger

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

20
ProjectIdlong

DataWorks 项目空间 ID

12345

返回参数

名称类型描述示例值
名称类型描述示例值
object

返回数据结构。

HttpStatusCodeinteger

HTTP 返回码。

200
RequestIdstring

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

38cbdef0-f6cf-49****
ErrorMessagestring

错误信息。

You have no permission.
Successboolean

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

  • true:调用成功。
  • false:调用失败。
true
ErrorCodestring

错误码。

Invalid.Tenant.ConnectionNotExists
Dataobject

获取的规则列表。

PageNumberinteger

页码数。

1
PageSizeinteger

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

20
TotalCountlong

返回数据总量。

400
Rulesarray<object>

校验规则的详情。

Rulesobject

返回数据结构。

BlockTypeinteger

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

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

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

test
Propertystring

字段的名称。

id
WarningThresholdstring

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

10
TableNamestring

表的名称。

dual
OnDutystring

配置校验规则的账号 ID。

1912****
Commentstring

规则的描述信息。

Verify table rules
RuleCheckerRelationIdlong

规则详情的内部关联 ID。

132323
FixCheckboolean

固定值校验。

true
MethodIdinteger

采集样本数据方法的 ID。

21
TemplateNamestring

使用的校验模板的名称。

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

校验结果的趋势。

abs
HistoryWarningThresholdstring

历史橙色告警阈值。

history max:40%,history min:10%
RuleTypeinteger

规则的类型:

  • 0 表示系统创建。
  • 1 表示用户创建。
  • 2 表示项目级规则。
0
MatchExpressionstring

分区表达式。

dt=$[yyyymmdd]
ProjectNamestring

引擎或者数据源的名称。

autotest
PropertyKeystring

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

table_count
CriticalThresholdstring

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

40
HistoryCriticalThresholdstring

历史红色告警阈值。

history max:80%,history min:50%
MethodNamestring

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

校验器 ID。

7
EntityIdlong

分区表达式的 ID。

1234
ExpectValuestring

期望值。

1000
TemplateIdinteger

使用的校验模板的 ID。

7
Idlong

规则的 ID。

1234
RuleNamestring

规则名称。

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

错误码

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

变更历史

变更时间变更内容概要操作
变更时间变更内容概要操作
2024-01-22OpenAPI 返回结构发生变更查看变更详情
2023-07-11API 内部配置变更,不影响调用查看变更详情
2023-03-08OpenAPI 入参发生变更查看变更详情
2021-10-26OpenAPI 返回结构发生变更查看变更详情
  • 本页导读 (1)
  • 调试
  • 授权信息
  • 请求参数
  • 返回参数
  • 示例
  • 错误码
  • 变更历史