调用GetQualityRule获取校验规则的信息。
目前该API接口已标记为弃用,推荐使用替代API:dataworks-public(2024-05-18) - GetDataQualityScan。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
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 |
| OnDutyAccountName |
string |
配置校验规则的阿里云账号名称。 |
test |
| WarningThreshold |
string |
橙色告警阈值。表示与样本预期的偏离程度,您可以根据业务需求自定义该阈值。 |
10 |
| Property |
string |
规则属性的字段,即被校验数据源表的 column 名称。 |
id |
| RuleType |
integer |
规则的类型:
|
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 |
| 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"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。