文档

GetQualityRule

更新时间:

调用GetQualityRule获取校验规则的信息。

调试

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

请求参数

名称

类型

是否必选

示例值

描述

Action String GetQualityRule

系统规定参数。取值:GetQualityRule

RuleId Long 1234

校验规则的ID。您可以调用ListQualityRules接口查看RuleId的相关信息。

ProjectName String autotest

引擎或者数据源的名称。

ProjectId Long 12345

DataWorks项目空间ID。

返回数据

名称

类型

示例值

描述

HttpStatusCode Integer 200

HTTP状态码。

RequestId String 576b9457-2cf5-4****

请求ID。

ErrorMessage String You have no permission.

错误信息。

ErrorCode String 401

错误码。

Success Boolean true

调用是否成功。

Data Object

获取的规则信息。

BlockType Integer 1

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

  • 1,表示强规则。
  • 0,表示弱规则。

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

OnDutyAccountName String test

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

WarningThreshold String 10

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

Property String id

规则属性的字段,即被校验数据源表的column名称。

RuleType Integer 0

规则的类型。

Comment String 校验主键唯一

校验规则的描述信息。

OnDuty String 1822931****

配置校验规则的账号ID。

Checker Integer 9

校验器ID。该字段对应前端的ID标识,需要由pkId转换。

FixCheck Boolean true

固定值校验。

MethodId Integer 8

采集样本数据方法的ID。

CriticalThreshold String 20

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

PredictType Integer 0

是否为动态阈值:

  • 0表示非动态阈值。
  • 1表示动态阈值规则。
TemplateName String SQL task table rows, 1,7, 30 days fluctuation test

使用的校验模板的名称。

CheckerName String compared with a fixed value

校验器的名称。

RuleName String 查看表波动

规则的名称。

MethodName String table_count

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

EntityId Long 165523

分区表达式的ID。

WhereCondition String id>10

校验任务使用的过滤条件或自定义SQL语句。

Operator String >=

操作符。

ExpectValue String 30

期望值。

Trend String abs

校验结果的趋势。

TemplateId Integer 7

使用的校验模板的ID。

Id Long 123232

规则的ID。

OpenSwitch Boolean true

规则是否开启

示例

请求示例

http(s)://[Endpoint]/?Action=GetQualityRule
&RuleId=1234
&ProjectName=autotest
&ProjectId=12345
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GetQualityRuleResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <RequestId>576b9457-2cf5-4****</RequestId>
    <ErrorMessage>You have no permission.</ErrorMessage>
    <ErrorCode>401</ErrorCode>
    <Success>true</Success>
    <Data>
        <BlockType>1</BlockType>
        <OnDutyAccountName>test</OnDutyAccountName>
        <WarningThreshold>10</WarningThreshold>
        <Property>id</Property>
        <RuleType>0</RuleType>
        <Comment>校验主键唯一</Comment>
        <OnDuty>1822931****</OnDuty>
        <Checker>9</Checker>
        <FixCheck>true</FixCheck>
        <MethodId>8</MethodId>
        <CriticalThreshold>20</CriticalThreshold>
        <PredictType>0</PredictType>
        <TemplateName>SQL task table rows, 1,7, 30 days fluctuation test</TemplateName>
        <CheckerName>compared with a fixed value</CheckerName>
        <RuleName>查看表波动</RuleName>
        <MethodName>table_count</MethodName>
        <EntityId>165523</EntityId>
        <WhereCondition>id&gt;10</WhereCondition>
        <Operator>&gt;=</Operator>
        <ExpectValue>30</ExpectValue>
        <Trend>abs</Trend>
        <TemplateId>7</TemplateId>
        <Id>123232</Id>
        <OpenSwitch>true</OpenSwitch>
    </Data>
</GetQualityRuleResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/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" : "校验主键唯一",
    "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" : "查看表波动",
    "MethodName" : "table_count",
    "EntityId" : 165523,
    "WhereCondition" : "id&gt;10",
    "Operator" : "&gt;=",
    "ExpectValue" : 30,
    "Trend" : "abs",
    "TemplateId" : 7,
    "Id" : 123232,
    "OpenSwitch" : true
  }
}

错误码

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

  • 本页导读 (1)
文档反馈