取得資料品質校驗任務執行個體詳情。
目前該API介面已標記為棄用,推薦使用替代API:dataworks-public(2024-05-18) - GetDataQualityScanRun。
介面說明
需要購買 DataWorks 基礎版及以上版本才能使用。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
dataworks:* |
get |
*全部資源。
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Id |
integer |
是 |
資料品質監控執行個體 ID。 |
7227550902 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
請求 ID。用於定位日誌,排查問題。 |
8abcb91f-d266-4073-b907-2ed67**** |
| DataQualityEvaluationTaskInstance |
object |
資料品質監控執行個體詳情。 |
|
| Status |
string |
資料品質監控執行個體狀態。
|
Passed |
| Task |
object |
資料品質監控。 |
|
| Name |
string |
資料品質監控名稱。 |
Data quality OpenAPI monitoring test |
| Notifications |
object |
通知設定。 |
|
| Condition |
string |
通知觸發條件,當滿足這個條件時,會觸發訊息通知。目前只能支援兩種條件運算式:
|
${severity} == "High" AND ${status} == "Critical" |
| Notifications |
array<object> |
警示方式。 |
|
|
array<object> |
|||
| NotificationReceivers |
array<object> |
接收方取值。 |
|
|
object |
|||
| ReceiverType |
string |
警示接收人類型。 |
DingdingUrl |
| Extension |
string |
警示傳送時的額外參數設定,JSON 格式,支援的 key 如下:
|
{ "atAll": true } |
| ReceiverValues |
array |
警示接收人。 |
|
|
string |
接收方取值。
|
https://api.fc.aliyuncs.com/webhook |
|
| NotificationChannels |
array<object> |
通知方式。 |
|
|
object |
|||
| Channels |
array |
通知方式。 |
|
|
string |
警示方式
|
|
|
| Hooks |
array<object> |
回呼設定。 |
|
|
object |
|||
| Type |
string |
Hook 類型,目前只支援一種:
|
BlockTaskInstance |
| Condition |
string |
Hook 觸發條件,當滿足這個條件時,會觸發 Hook 動作。目前只能支援兩種條件運算式:
|
(${severity} == "High" AND ${status} == "Critical") OR (${severity} == "Normal" AND ${status} == "Critical") OR (${severity} == "Normal" AND ${status} == "Error") |
| RuntimeConf |
string |
擴充設定,JSON 格式的字串,只對 EMR 類型的資料品質監控生效。
|
{ "queue": "default" } |
| Trigger |
object |
資料品質校驗任務的觸發設定。 |
|
| Type |
string |
品質監控觸發類型:
|
ByScheduledTaskInstance |
| TaskIds |
array |
排程任務 ID 清單,在 Type 為 ByScheduledTaskInstance 時有效。 |
|
|
integer |
排程任務 ID。 |
70006236752324 |
|
| Target |
object |
參閱 DataQualityTarget 範例,資料品質校驗任務的監控物件,參考 DataQualityTarget。 |
|
| Type |
string |
監控物件類型。
|
Table |
| DatabaseType |
string |
資料表所屬的資料庫類型。 |
maxcompute |
| TableGuid |
string |
資料表在資料地圖中的唯一 ID。 |
odps.api_trace.ods_d_api_log |
| PartitionSpec |
string |
監控的分割區範圍。 |
pt=$[yyyymmdd-1] |
| Description |
string |
資料品質監控的描述資訊。 |
OpenAPI quality monitoring test |
| Id |
integer |
資料品質監控 ID。 |
28544990 |
| ProjectId |
integer |
工作空間的 ID。 |
20629 |
| Parameters |
string |
資料品質校驗執行參數,JSON 格式,可用的 key 如下:
|
{ "triggerTime": 1733284062000 } |
| FinishTime |
integer |
執行個體執行的結束時間。 格式為 13 位數字,例如 |
1716344665000 |
| TriggerContext |
string |
執行個體觸發時的上下文資訊,JSON 格式。可能包含的 key 如下:
|
{ "triggerClient": "CWF2", "triggerClientId": 70001238945 } |
| CreateTime |
integer |
建立時間。 格式為 13 位數字,例如 |
1716344665000 |
| Id |
integer |
資料品質監控執行個體 ID。 |
7234231689 |
| ProjectId |
integer |
工作空間的 ID。 |
98330 |
| Results |
array<object> |
資料品質校驗結果清單。 |
|
|
array<object> |
|||
| Id |
integer |
校驗結果 ID。 |
10001 |
| Status |
string |
校驗結果狀態。 |
Passed |
| CreateTime |
integer |
校驗結果產生時間。 格式為 13 位數字,例如 |
1708284916414 |
| TaskInstanceId |
integer |
品質校驗任務執行個體 ID。 |
20001 |
| Sample |
string |
本次校驗所使用的樣本值。 |
[ { "gender": "male", "_count": 100 }, { "gender": "female", "_count": 100 } ] |
| Details |
array<object> |
本次校驗的詳情。 |
|
|
object |
|||
| ReferencedValue |
string |
使用引用的樣本,用來參與 CheckedValue 計算的基準值。 |
0.0 |
| CheckedValue |
string |
最終用來與閾值比較的值。 |
100.0 |
| Status |
string |
最終的比較結果狀態。 |
Passed |
| Rule |
object |
校驗開始時,規則設定快照。 |
|
| Id |
integer |
規則 ID,全域唯一識別碼。 |
100001 |
| Name |
string |
規則名稱,數字、英文字母、漢字、半形全形標點符號組合,最長 255 個字元。 |
資料表不能為空 |
| ProjectId |
integer |
DataWorks 專案空間 ID。 |
100 |
| Enabled |
boolean |
規則是否啟用。 |
|
| Severity |
string |
規則對於業務的等級(對應頁面上的強弱規則) |
High |
| Description |
string |
規則描述資訊,最長 500 個字元。 |
this is a odps _sql task |
| TemplateCode |
string |
建立規則時所引用的規則範本。 |
SYSTEM:user_defined_sql |
| Target |
object |
規則所監控的物件。 |
|
| Type |
string |
監控物件類型
|
Table |
| DatabaseType |
string |
資料表類型的資料集,資料表所屬的資料庫類型:
|
maxcompute |
| TableGuid |
string |
資料表在資料地圖中的唯一 ID。 |
odps.unit_test.tb_unit_test |
| SamplingConfig |
object |
樣本採樣所需的設定。 |
|
| Metric |
string |
採樣的指標名稱:
|
Min |
| MetricParameters |
string |
樣本採樣時,所需的參數。 |
{ "Columns": [ "id", "name" ] } |
| SettingConfig |
string |
具體執行採樣語句前,插入執行的一些執行時參數設定語句,最長 1000 個字元。目前只支援 MaxCompute。 |
SET odps.sql.udf.timeout=600s; |
| SamplingFilter |
string |
採樣時,對不關注的資料進行二次過濾的條件,最多 16777215 個字元。 |
id IS NULL |
| CheckingConfig |
object |
樣本校驗設定。 |
|
| Type |
string |
閾值計算方式:
|
Fixed |
| ReferencedSamplesFilter |
string |
有些類型的閾值需要查詢出一些參考樣本,然後對參考樣本的值進行彙總得出進行比較的閾值,這裡使用一個運算式來表示參考樣本的查詢方式。 |
{ "bizdate": [ "-1", "-7", "-1m" ] } |
| Thresholds |
object |
閾值設定。 |
|
| Expected |
object |
期望的閾值設定。 |
|
| Value |
string |
閾值數值。 |
100.0 |
| Operator |
string |
比較運算子
|
> |
| Expression |
string |
閾值運算式。 |
$checkValue > 0.01 |
| Warned |
object |
普通警告的閾值設定。 |
|
| Value |
string |
閾值數值。 |
100.0 |
| Operator |
string |
比較運算子
|
> |
| Expression |
string |
閾值運算式。 |
$checkValue > 0.01 |
| Critical |
object |
嚴重警告的閾值設定。 |
|
| Value |
string |
閾值數值。 |
100.0 |
| Operator |
string |
比較運算子
|
> |
| Expression |
string |
校驗運算式。 |
$checkValue > 0.01 |
| ErrorHandlers |
array<object> |
品質規則校驗問題處理器。 |
|
|
object |
|||
| Type |
string |
處理器類型。 |
SaveErrorData |
| ErrorDataFilter |
string |
如果是自訂 SQL 規則,需要使用者指定 SQL 來過濾問題資料。 |
SELECT * FROM tb_api_log WHERE id IS NULL |
樣本
正常返回樣本
JSON格式
{
"RequestId": "8abcb91f-d266-4073-b907-2ed67****",
"DataQualityEvaluationTaskInstance": {
"Status": "Passed",
"Task": {
"Name": "Data quality OpenAPI monitoring test\n",
"Notifications": {
"Condition": "${severity} == \"High\" AND ${status} == \"Critical\"",
"Notifications": [
{
"NotificationReceivers": [
{
"ReceiverType": "DingdingUrl",
"Extension": "{ \"atAll\": true }",
"ReceiverValues": [
"https://api.fc.aliyuncs.com/webhook"
]
}
],
"NotificationChannels": [
{
"Channels": [
"Mail"
]
}
]
}
]
},
"Hooks": [
{
"Type": "BlockTaskInstance",
"Condition": "(${severity} == \"High\" AND ${status} == \"Critical\") OR (${severity} == \"Normal\" AND ${status} == \"Critical\") OR (${severity} == \"Normal\" AND ${status} == \"Error\")"
}
],
"RuntimeConf": "{ \"queue\": \"default\" }",
"Trigger": {
"Type": "ByScheduledTaskInstance",
"TaskIds": [
70006236752324
]
},
"Target": {
"Type": "Table",
"DatabaseType": "maxcompute",
"TableGuid": "odps.api_trace.ods_d_api_log",
"PartitionSpec": "pt=$[yyyymmdd-1]"
},
"Description": "OpenAPI quality monitoring test",
"Id": 28544990,
"ProjectId": 20629
},
"Parameters": "{ \"triggerTime\": 1733284062000 }\n",
"FinishTime": 1716344665000,
"TriggerContext": "{ \"triggerClient\": \"CWF2\", \"triggerClientId\": 70001238945 }",
"CreateTime": 1716344665000,
"Id": 7234231689,
"ProjectId": 98330,
"Results": [
{
"Id": 10001,
"Status": "Passed",
"CreateTime": 1708284916414,
"TaskInstanceId": 20001,
"Sample": "[ { \"gender\": \"male\", \"_count\": 100 }, { \"gender\": \"female\", \"_count\": 100 } ]",
"Details": [
{
"ReferencedValue": "0.0",
"CheckedValue": "100.0",
"Status": "Passed"
}
],
"Rule": {
"Id": 100001,
"Name": "表不能为空",
"ProjectId": 100,
"Enabled": false,
"Severity": "High",
"Description": "this is a odps _sql task",
"TemplateCode": "SYSTEM:user_defined_sql",
"Target": {
"Type": "Table",
"DatabaseType": "maxcompute",
"TableGuid": "odps.unit_test.tb_unit_test"
},
"SamplingConfig": {
"Metric": "Min",
"MetricParameters": "{ \"Columns\": [ \"id\", \"name\" ] }",
"SettingConfig": "SET odps.sql.udf.timeout=600s;",
"SamplingFilter": "id IS NULL"
},
"CheckingConfig": {
"Type": "Fixed",
"ReferencedSamplesFilter": "{ \"bizdate\": [ \"-1\", \"-7\", \"-1m\" ] }",
"Thresholds": {
"Expected": {
"Value": "100.0",
"Operator": ">",
"Expression": "$checkValue > 0.01"
},
"Warned": {
"Value": "100.0",
"Operator": ">",
"Expression": "$checkValue > 0.01"
},
"Critical": {
"Value": "100.0",
"Operator": ">",
"Expression": "$checkValue > 0.01"
}
}
},
"ErrorHandlers": [
{
"Type": "SaveErrorData",
"ErrorDataFilter": "SELECT * FROM tb_api_log WHERE id IS NULL"
}
]
}
}
]
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。