调用GetQualityRule获取规则的信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetQualityRule |
要执行的操作。 |
ProjectName | String | 是 | autotest |
引擎或者数据源的名称。 |
RegionId | String | 是 | cn-shanghai |
地域的ID。 |
RuleId | Long | 是 | 1234 |
规则的ID。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Struct |
获取的规则信息。 |
|
BlockType | Integer | 1 |
强弱性:0表示弱规则、1表示强规则。 |
Checker | Integer | 9 |
校验器,该字段对应于前端的ID标识,需要由pkId转换。 |
CheckerName | String | compared with a fixed value |
校验器的名称。 |
Comment | String | 校验主键唯一 |
规则的描述信息。 |
CriticalThreshold | String | 20 |
红色告警阈值。 |
EntityId | Long | 165523 |
分区表达式的ID。 |
ExpectValue | String | 30 |
期望值。 |
FixCheck | Boolean | true |
固定值校验。 |
Id | Long | 123232 |
规则的ID。 |
MethodId | Integer | 8 |
采集方法的ID。 |
MethodName | String | table_count |
采集方法的名称。 |
OnDuty | String | 1822931**** |
规则配置人。 |
Operator | String | >= |
操作符。 |
PredictType | Integer | 0 |
是否为动态阈值:0表示非动态阈值、1表示动态阈值规则。 |
Property | String | id |
字段。 |
RuleName | String | 查看表波动 |
规则的名称。 |
RuleType | Integer | 0 |
规则的类型。 |
TemplateId | Integer | 7 |
模板的ID。 |
TemplateName | String | SQL task table rows, 1,7, 30 days fluctuation test |
模板的名称。 |
Trend | String | abs |
趋势。 |
WarningThreshold | String | 10 |
橙色告警阈值。 |
WhereCondition | String | id>10 |
过滤条件或自定义SQL。 |
ErrorCode | String | 401 |
错误码。 |
ErrorMessage | String | You have no permission. |
错误信息。 |
HttpStatusCode | Integer | 200 |
HTTP返回码。 |
RequestId | String | 576b9457-2cf5-4**** |
请求ID。 |
Success | Boolean | true |
调用是否成功。 |
示例
请求示例
http(s)://[Endpoint]/?Action=GetQualityRule
&ProjectName=autotest
&RegionId=cn-shanghai
&RuleId=1234
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>576b9457-2cf5-4***</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>
<Operator>>&gt;=</Operator>
<Comment>校验主键唯一</Comment>
<Checker>9</Checker>
<CriticalThreshold>20</CriticalThreshold>
<CheckerName>compared with a fixed value</CheckerName>
<ExpectValue>30</ExpectValue>
<WarningThreshold>10</WarningThreshold>
<OnDuty>1822931****</OnDuty>
<Trend>abs</Trend>
<WhereCondition>id&gt;10</WhereCondition>
<RuleType>0</RuleType>
<EntityId>165523</EntityId>
<MethodId>8</MethodId>
<FixCheck>true</FixCheck>
<BlockType>1</BlockType>
<TemplateName>SQL task table rows, 1,7, 30 days fluctuation test</TemplateName>
<PredictType>0</PredictType>
<Id>123232</Id>
<MethodName>table_count</MethodName>
<Property>id</Property>
<TemplateId>7</TemplateId>
<RuleName>查看表波动</RuleName>
</Data>
<ErrorCode>401</ErrorCode>
<ErrorMessage>You have no permission.</ErrorMessage>
<Success>true</Success>
JSON
格式
{
"RequestId": "576b9457-2cf5-4***",
"HttpStatusCode": 200,
"Data": {
"Operator": ">>=",
"Comment": "校验主键唯一",
"Checker": 9,
"CriticalThreshold": 20,
"CheckerName": "compared with a fixed value",
"ExpectValue": 30,
"WarningThreshold": 10,
"OnDuty": "1822931****",
"Trend": "abs",
"WhereCondition": "id>10",
"RuleType": 0,
"EntityId": 165523,
"MethodId": 8,
"FixCheck": true,
"BlockType": 1,
"TemplateName": "SQL task table rows, 1,7, 30 days fluctuation test",
"PredictType": 0,
"Id": 123232,
"MethodName": "table_count",
"Property": "id",
"TemplateId": 7,
"RuleName": "查看表波动"
},
"ErrorCode": 401,
"ErrorMessage": "You have no permission.",
"Success": true
}
错误码
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交