全部產品
Search
文件中心

DataWorks:GetQualityRule - 擷取規則的資訊

更新時間:Jul 31, 2026

調用GetQualityRule擷取校正規則的資訊。

說明

目前該API介面已標記為棄用,推薦使用替代API:dataworks-public(2024-05-18) - GetDataQualityScan。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

dataworks:*

get

*全部資源

*

無 無

請求參數

名稱

類型

必填

描述

樣本值

RuleId

integer

是

校正規則的 ID。您可以調用 ListQualityRules 介面查看 RuleId 的相關資訊。

1234

ProjectName

string

是

引擎或者資料來源的名稱。

autotest

ProjectId

integer

否

DataWorks 專案空間 ID。

12345

返回參數

名稱

類型

描述

樣本值

object

返回資料結構。

HttpStatusCode

integer

HTTP 狀態代碼。

200

RequestId

string

請求 ID。

576b9457-2cf5-4****

ErrorMessage

string

錯誤資訊。

You have no permission.

ErrorCode

string

錯誤碼。

401

Success

boolean

調用是否成功。

true

Data

object

擷取的規則資訊。

BlockType

integer

校正規則的強弱。強弱表示規則的重要程度。取值如下:

  • 1,表示強規則。

  • 0,表示弱規則。 您可以根據實際需求設定重要的規則為強規則。如果使用強規則並觸發了紅色警示,則會阻塞調度任務。

1

OnDutyAccountName

string

配置校正規則的阿里雲帳號名稱。

test

WarningThreshold

string

橙色警示閾值。表示與樣本預期的偏離程度,您可以根據業務需求自訂該閾值。

10

Property

string

規則屬性的欄位,即被校正資料來源表的 column 名稱。

id

RuleType

integer

規則的類型:

  • 0:系統模板規則

  • 1:自訂 SQL 規則

  • 4:自訂模板規則

0

Comment

string

校正規則的描述資訊。

Verify that the primary key is unique

OnDuty

string

配置校正規則的帳號 ID。

1822931****

Checker

integer

校正器 ID。該欄位對應前端的 ID 標識,需要由 pkId 轉換。

9

FixCheck

boolean

固定值校正。

true

MethodId

integer

採集樣本資料方法的 ID。

8

CriticalThreshold

string

紅色警示閾值。表示與樣本預期的偏離程度。您可以根據業務需求自訂該閾值。使用強規則並觸發紅色閾值,會阻塞調度任務。

20

PredictType

integer

是否為動態閾值:

  • 0 表示非動態閾值。

  • 1 表示動態臨界值規則。

0

TemplateName

string

使用的校正模板的名稱。

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

CheckerName

string

校正器的名稱。

compared with a fixed value

RuleName

string

規則的名稱。

View table fluctuations

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 等。

table_count

EntityId

integer

分區運算式的 ID。

165523

WhereCondition

string

校正任務使用的過濾條件或自訂 SQL 陳述式。

id>10

Operator

string

操作符。

>=

ExpectValue

string

期望值。

30

Trend

string

校正結果的趨勢。

abs

TemplateId

integer

使用的校正模板的 ID。

7

Id

integer

規則的 ID。

123232

OpenSwitch

boolean

規則是否開啟

true

TaskSetting

string

在自訂規則之前插入的變數設定,格式如:x=a,y=b

x=a,y=b

樣本

正常返回樣本

JSON格式

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

錯誤碼

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

變更歷史

更多資訊,參考變更詳情。