全部產品
Search
文件中心

DataWorks:ListQualityRules - 根據分區運算式擷取規則列表

更新時間:Mar 18, 2026

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

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情